summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-09-07 17:18:24 +1000
committerAndrew Tridgell <tridge@samba.org>2011-09-08 05:02:54 +0200
commite0c5f1c1ab2db6042112ee445941b04ae162e778 (patch)
tree1bfb68aa3cc82b8e2b1f9261d57aff4f80271998 /source4/dsdb/samdb
parentdd80fc60fd954a3bee86831e887135c4be7ea3fd (diff)
downloadsamba-e0c5f1c1ab2db6042112ee445941b04ae162e778.tar.gz
samba-e0c5f1c1ab2db6042112ee445941b04ae162e778.tar.bz2
samba-e0c5f1c1ab2db6042112ee445941b04ae162e778.zip
s4-cracknames: use consistent search for crossRef objects
This matches the search in other places Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Sep 8 05:02:54 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/cracknames.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 105de56056..56655ffaeb 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -442,8 +442,10 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
s[0] = '\0';
s++;
- domain_filter = talloc_asprintf(mem_ctx, "(&(objectClass=crossRef)(ncName=%s))",
- ldb_dn_get_linearized(samdb_dns_domain_to_dn(sam_ctx, mem_ctx, str)));
+ domain_filter = talloc_asprintf(mem_ctx, "(&(objectClass=crossRef)(dnsRoot=%s)(systemFlags:%s:=%u))",
+ ldb_binary_encode_string(mem_ctx, str),
+ LDB_OID_COMPARATOR_AND,
+ SYSTEM_FLAG_CR_NTDS_DOMAIN);
W_ERROR_HAVE_NO_MEMORY(domain_filter);
/* There may not be anything after the domain component (search for the domain itself) */