summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-09-21 08:51:20 +1000
committerAndrew Tridgell <tridge@samba.org>2011-09-22 10:00:48 +1000
commit677600fb7f979b1ad486aadecf4d5a03a9508de3 (patch)
tree3a2db7c874c07173663b78783f4e94522f96f064 /source4/dsdb
parent585294e4db7364b5cb944270ceba2e55f63c2ec8 (diff)
downloadsamba-677600fb7f979b1ad486aadecf4d5a03a9508de3.tar.gz
samba-677600fb7f979b1ad486aadecf4d5a03a9508de3.tar.bz2
samba-677600fb7f979b1ad486aadecf4d5a03a9508de3.zip
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
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c11
1 files changed, 8 insertions, 3 deletions
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;
}