From 677600fb7f979b1ad486aadecf4d5a03a9508de3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Sep 2011 08:51:20 +1000 Subject: s4-dsdb: failing to find the object is not an error in dsdb_loadreps() we may not have replicated the partition yet, so this should be considered the same as having no repsFrom/repsTo --- source4/dsdb/common/util.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 3276ec8019..f5443ea59d 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2667,13 +2667,18 @@ WERROR dsdb_loadreps(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, struct ld TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); unsigned int i; struct ldb_message_element *el; + int ret; *r = NULL; *count = 0; - if (ldb_search(sam_ctx, tmp_ctx, &res, dn, LDB_SCOPE_BASE, attrs, NULL) != LDB_SUCCESS || - res->count < 1) { - DEBUG(0,("dsdb_loadreps: failed to read partition object\n")); + ret = dsdb_search_dn(sam_ctx, tmp_ctx, &res, dn, attrs, 0); + if (ret == LDB_ERR_NO_SUCH_OBJECT) { + /* partition hasn't been replicated yet */ + return WERR_OK; + } + if (ret != LDB_SUCCESS) { + DEBUG(0,("dsdb_loadreps: failed to read partition object: %s\n", ldb_errstring(sam_ctx))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; } -- cgit