diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-11-20 14:21:06 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2014-12-12 17:48:27 +0100 |
commit | a6ecef4532e4529a819219cd814e2979c2df0797 (patch) | |
tree | 289ef557a13507fc8a9682c2c0c6d6fd50c150d8 /source4/dsdb/samdb | |
parent | 0d0a0f79d387c45e697d9de46ffe5c46a1f39295 (diff) | |
download | samba-a6ecef4532e4529a819219cd814e2979c2df0797.tar.gz samba-a6ecef4532e4529a819219cd814e2979c2df0797.tar.xz samba-a6ecef4532e4529a819219cd814e2979c2df0797.zip |
s4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control
Otherwise we can't find the GUID of the 'serverName' attribute
as ANONYMOUS.
This results in
root@ub1204-161:~# ldbsearch -U% -H ldap://172.31.9.161 -b '' -s base --extended-dn serverName
search error - LDAP error 1 LDAP_OPERATIONS_ERROR - <00002020: operations error at ../source4/dsdb/samdb/ldb_modules/rootdse.c:567> <>
While it works as system:
root@ub1204-161:~# ldbsearch -U% -H /var/lib/samba/private/sam.ldb -b '' -s base --extended-dn serverName
# record 1
dn:
serverName: <GUID=348c35e1-04e3-4988-a32c-32478d584551>;CN=UB1204-161,CN=Serve
rs,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=s4xdom,DC=base
# returned 1 records
# 1 entries
# 0 referrals
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10949
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/rootdse.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index b13dc9e5c5..111266f035 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -142,10 +142,8 @@ static int expand_dn_in_message(struct ldb_module *module, struct ldb_message *m return ret; } - - ret = ldb_request_add_control(req2, - LDB_CONTROL_EXTENDED_DN_OID, - edn_control->critical, edn); + ret = dsdb_request_add_controls(req2, DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_EXTENDED_DN); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); return ldb_error(ldb, ret, "Failed to add control"); |