summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-11-13 22:54:52 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:45:11 +0100
commit5d4f507a65144d8fe30b3fcd0b9cbcdc088146c6 (patch)
tree6a134f6519fd958bc3dde6cf4021ca1147521202 /source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
parent7f18e15e3f48d92a4f8f2b929a6337761b26fc67 (diff)
downloadsamba-5d4f507a65144d8fe30b3fcd0b9cbcdc088146c6.tar.gz
samba-5d4f507a65144d8fe30b3fcd0b9cbcdc088146c6.tar.bz2
samba-5d4f507a65144d8fe30b3fcd0b9cbcdc088146c6.zip
r25942: Make various ldb modules handle an LDB backend that enforces validity
of Base DNs in searches (returning an error of LDB_ERR_NO_SUCH_ENTRY). We need to handle this if ldb_tdb is to behave correctly compared with LDAP, as well as if we are using an LDAP backend. In doing so, I realised that subtree_rename and subtree_delete (prevention) need rather different wait loops, so it seemed easier to split it out into it's own module. I've fixed the licence on both of these modules to be GPLv3. Andrew Bartlett (This used to be commit d3894c90f31fb45e038ab478cd9d7d34962d069b)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/pdc_fsmo.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/pdc_fsmo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c b/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
index d78ba14ab4..ed9b554bb1 100644
--- a/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
+++ b/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
@@ -67,7 +67,12 @@ static int pdc_fsmo_init(struct ldb_module *module)
LDB_SCOPE_BASE,
NULL, pdc_attrs,
&pdc_res);
- if (ret != LDB_SUCCESS) {
+ if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ ldb_debug(module->ldb, LDB_DEBUG_WARNING,
+ "pdc_fsmo_init: no domain object present: (skip loading of domain details)");
+ talloc_free(mem_ctx);
+ return ldb_next_init(module);
+ } else if (ret != LDB_SUCCESS) {
ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
"pdc_fsmo_init: failed to search the domain object: %d:%s",
ret, ldb_strerror(ret));