summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-12-27 01:59:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:14 -0500
commitf9dd1d7ef8ff30fcf21c08701a3fb95056f2b181 (patch)
tree443d1488d174383fbd9a5e252426ad72931d3791 /source4/auth
parentb4ae9868d0657c4380ebac376b0a11b1f85f5321 (diff)
downloadsamba-f9dd1d7ef8ff30fcf21c08701a3fb95056f2b181.tar.gz
samba-f9dd1d7ef8ff30fcf21c08701a3fb95056f2b181.tar.bz2
samba-f9dd1d7ef8ff30fcf21c08701a3fb95056f2b181.zip
r20352: Use the common function to find the DN for a domain.
Andrew Bartlett (This used to be commit 929fd1beee5cab647702a9b8d8d5e4c2aab23d11)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/auth_sam.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c
index 56187a6d54..6003cfd415 100644
--- a/source4/auth/auth_sam.c
+++ b/source4/auth/auth_sam.c
@@ -55,11 +55,10 @@ static NTSTATUS authsam_search_account(TALLOC_CTX *mem_ctx, struct ldb_context *
struct ldb_dn *domain_dn = NULL;
if (domain_name) {
- char *escaped_domain = ldb_binary_encode_string(mem_ctx, domain_name);
+ domain_dn = samdb_domain_to_dn(sam_ctx, mem_ctx, domain_name);
+
/* find the domain's DN */
- ret_domain = gendb_search(sam_ctx, mem_ctx, partitions_basedn, &msgs_domain_ref, domain_ref_attrs,
- "(&(&(|(&(dnsRoot=%s)(nETBIOSName=*))(nETBIOSName=%s))(objectclass=crossRef))(ncName=*))",
- escaped_domain, escaped_domain);
+ ret_domain = gendb_search_dn(sam_ctx, mem_ctx, domain_dn, &msgs_domain_ref, domain_ref_attrs);
if (ret_domain == -1) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -75,8 +74,6 @@ static NTSTATUS authsam_search_account(TALLOC_CTX *mem_ctx, struct ldb_context *
ret_domain, domain_name));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
-
- domain_dn = samdb_result_dn(sam_ctx, mem_ctx, msgs_domain_ref[0], "nCName", NULL);
}
/* pull the user attributes */