summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-04 14:36:14 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-04 16:10:39 +1000
commit9b02d2391443c3c56d607d034d9d200703aa840b (patch)
tree9e38b6aa6a7c24e9339fde652068caf0d4af2891 /source4/rpc_server
parent1937ab3668e6a4667ac4334a6e1bea2cc75cfb1d (diff)
downloadsamba-9b02d2391443c3c56d607d034d9d200703aa840b.tar.gz
samba-9b02d2391443c3c56d607d034d9d200703aa840b.tar.bz2
samba-9b02d2391443c3c56d607d034d9d200703aa840b.zip
s4:netlogon Fix warnings and segfault in GetDomainInfo call
- Correctly use samdb_search_string to do a 'base' search (this needs a NULL, not a "" argument for the format string) - There is no need (and it caused a security hole) to use talloc_asprintf() with the only argument being the string to duplicate. Andrew Bartlett
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 4fedf54fbc..cee94d8ea6 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1157,8 +1157,9 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
NT_STATUS_HAVE_NO_MEMORY(workstation_dn);
/* Gets the old DNS hostname */
- old_dns_hostname = samdb_search_string_v(sam_ctx, mem_ctx,
- workstation_dn, "dNSHostName", "", NULL);
+ old_dns_hostname = samdb_search_string(sam_ctx, mem_ctx,
+ workstation_dn, "dNSHostName",
+ NULL);
/* Gets host informations and put them in our directory */
new_msg = ldb_msg_new(mem_ctx);
@@ -1197,8 +1198,8 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
os_version = &r->in.query->workstation_info->os_version.os->os;
samdb_msg_set_string(sam_ctx, mem_ctx, new_msg,
- "operatingSystemServicePack",
- talloc_asprintf(mem_ctx, os_version->CSDVersion));
+ "operatingSystemServicePack",
+ os_version->CSDVersion);
samdb_msg_set_string(sam_ctx, mem_ctx, new_msg,
"operatingSystemVersion",