mirror of
https://github.com/samba-team/samba.git
synced 2025-11-25 00:23:52 +03:00
r18245: Ensure we don't keep the rootdse record around (steal it onto the
correct memory context). Andrew Bartlett
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
3200031276
commit
b4f234e507
@@ -162,12 +162,14 @@ static const struct ldb_dn *ldb_set_default_basedn(struct ldb_context *ldb)
|
||||
tmp_ctx = talloc_new(ldb);
|
||||
ret = ldb_search(ldb, ldb_dn_new(tmp_ctx), LDB_SCOPE_BASE,
|
||||
"(objectClass=*)", attrs, &res);
|
||||
if (ret == LDB_SUCCESS && res->count == 1) {
|
||||
basedn = ldb_msg_find_attr_as_dn(ldb, res->msgs[0], "defaultNamingContext");
|
||||
if (ret == LDB_SUCCESS) {
|
||||
talloc_steal(tmp_ctx, res);
|
||||
if (res->count == 1) {
|
||||
basedn = ldb_msg_find_attr_as_dn(ldb, res->msgs[0], "defaultNamingContext");
|
||||
ldb_set_opaque(ldb, "default_baseDN", basedn);
|
||||
}
|
||||
}
|
||||
|
||||
ldb_set_opaque(ldb, "default_baseDN", basedn);
|
||||
|
||||
talloc_free(tmp_ctx);
|
||||
return basedn;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user