From e0c5f1c1ab2db6042112ee445941b04ae162e778 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Sep 2011 17:18:24 +1000 Subject: s4-cracknames: use consistent search for crossRef objects This matches the search in other places Pair-Programmed-With: Andrew Bartlett Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Sep 8 05:02:54 CEST 2011 on sn-devel-104 --- source4/dsdb/samdb/cracknames.c | 6 ++++-- 1 file 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) */ -- cgit