diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-10-11 11:00:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:39:40 -0500 |
commit | 36d73b0e71eb3fbbe8d660b7609806b0355bd09c (patch) | |
tree | 2ab0d165d05beafc64f580a5f60a6b7a18d78a13 /source4/libnet | |
parent | 87255dc743970cdfbccfe66c31504d518512da30 (diff) | |
download | samba-36d73b0e71eb3fbbe8d660b7609806b0355bd09c.tar.gz samba-36d73b0e71eb3fbbe8d660b7609806b0355bd09c.tar.bz2 samba-36d73b0e71eb3fbbe8d660b7609806b0355bd09c.zip |
r10894: make the handling of dn/distinguishedName much closer to real
ldap. Also ensure we put a objectclass on our private ldb's, so they
have some chance of being stored in ldap if you want to
(This used to be commit 1af2cc067f70f6654d08387fc28def67229bb06a)
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_samsync_ldb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c index ca9dc6b089..717e89ba4b 100644 --- a/source4/libnet/libnet_samsync_ldb.c +++ b/source4/libnet/libnet_samsync_ldb.c @@ -117,7 +117,6 @@ static NTSTATUS samsync_ldb_handle_domain(TALLOC_CTX *mem_ctx, const char *domain_attrs[] = {"nETBIOSName", "nCName", NULL}; struct ldb_message **msgs_domain; int ret_domain; - char *base_dn; ret_domain = gendb_search(state->sam_ldb, mem_ctx, NULL, &msgs_domain, domain_attrs, "(&(&(nETBIOSName=%s)(objectclass=crossRef))(ncName=*))", @@ -132,16 +131,14 @@ static NTSTATUS samsync_ldb_handle_domain(TALLOC_CTX *mem_ctx, state->base_dn[database] = samdb_result_dn(state, msgs_domain[0], "nCName", NULL); - base_dn = ldb_dn_linearize(mem_ctx, state->base_dn[database]); - state->dom_sid[database] = samdb_search_dom_sid(state->sam_ldb, state, state->base_dn[database], - "objectSid", "dn=%s", base_dn); + "objectSid", NULL); } else if (database == SAM_DATABASE_BUILTIN) { /* work out the builtin_dn - useful for so many calls its worth fetching here */ const char *dnstring = samdb_search_string(state->sam_ldb, mem_ctx, NULL, - "dn", "objectClass=builtinDomain"); + "distinguishedName", "objectClass=builtinDomain"); state->base_dn[database] = ldb_dn_explode(state, dnstring); state->dom_sid[database] = dom_sid_parse_talloc(state, SID_BUILTIN); } else { |