summaryrefslogtreecommitdiff
path: root/source4/cldap_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-18 22:20:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:16 -0500
commitc15bab356d5b4f37de5678733afb28b27299f95d (patch)
treee7216560bac7301a7045220d73b5e629de345627 /source4/cldap_server
parent2faae939cec11de4890c2be24197619ea0e33637 (diff)
downloadsamba-c15bab356d5b4f37de5678733afb28b27299f95d.tar.gz
samba-c15bab356d5b4f37de5678733afb28b27299f95d.tar.bz2
samba-c15bab356d5b4f37de5678733afb28b27299f95d.zip
r17609: Kill one more use of the fake dnsDomain attribute.
Add a talloc_steal to avoid a memory leak of the ldb_search result. Andrew Bartlett (This used to be commit 69525129f9d199b1d4caeb5d52c918fc0bc95737)
Diffstat (limited to 'source4/cldap_server')
-rw-r--r--source4/cldap_server/netlogon.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c
index 4e7274f483..fb8040e4bc 100644
--- a/source4/cldap_server/netlogon.c
+++ b/source4/cldap_server/netlogon.c
@@ -47,8 +47,8 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
uint32_t version,
union nbt_cldap_netlogon *netlogon)
{
- const char *ref_attrs[] = {"nETBIOSName", "ncName", NULL};
- const char *dom_attrs[] = {"dnsDomain", "objectGUID", NULL};
+ const char *ref_attrs[] = {"nETBIOSName", "dnsRoot", "ncName", NULL};
+ const char *dom_attrs[] = {"objectGUID", NULL};
struct ldb_message **ref_res, **dom_res;
int ret, count = 0;
const char **services = lp_server_services();
@@ -96,6 +96,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
DEBUG(2,("Error finding domain '%s'/'%s' in sam: %s\n", domain, ldb_dn_linearize(mem_ctx, dom_dn), ldb_errstring(cldapd->samctx)));
return NT_STATUS_NO_SUCH_DOMAIN;
}
+ talloc_steal(mem_ctx, dom_ldb_result);
if (dom_ldb_result->count != 1) {
DEBUG(2,("Error finding domain '%s'/'%s' in sam\n", domain, ldb_dn_linearize(mem_ctx, dom_dn)));
return NT_STATUS_NO_SUCH_DOMAIN;
@@ -143,8 +144,8 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
pdc_name = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name());
domain_uuid = samdb_result_guid(dom_res[0], "objectGUID");
- realm = samdb_result_string(dom_res[0], "dnsDomain", lp_realm());
- dns_domain = samdb_result_string(dom_res[0], "dnsDomain", lp_realm());
+ realm = samdb_result_string(ref_res[0], "dnsRoot", lp_realm());
+ dns_domain = samdb_result_string(ref_res[0], "dnsRoot", lp_realm());
pdc_dns_name = talloc_asprintf(mem_ctx, "%s.%s",
strlower_talloc(mem_ctx, lp_netbios_name()),
dns_domain);