diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-07-31 10:18:43 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-07-31 14:15:29 +0200 |
commit | fcb54ca25f0a28940d239c457ef1a295d6e5e325 (patch) | |
tree | 242e627060c0327ece7bfd5a04945c5be63c113e /source4/dsdb | |
parent | bc5be09bae77c5e34380a2204be2f489f45ed85b (diff) | |
download | samba-fcb54ca25f0a28940d239c457ef1a295d6e5e325.tar.gz samba-fcb54ca25f0a28940d239c457ef1a295d6e5e325.tar.bz2 samba-fcb54ca25f0a28940d239c457ef1a295d6e5e325.zip |
s4-dsdb: Improve tracing in repl_meta_data
When we call ldb_module_done() rather than just calling the callback, we make log entries
that are critical in debugging.
Andrew Bartlett
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index a1a0b87e45..91bc6c9511 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -3410,17 +3410,20 @@ static int replmd_op_possible_conflict_callback(struct ldb_request *req, struct struct replPropertyMetaData1 *rmd_name, *omd_name; struct ldb_message *msg; + req->callback = callback; + if (ares->error != LDB_ERR_ENTRY_ALREADY_EXISTS) { /* call the normal callback for everything except conflicts */ - return callback(req, ares); + return ldb_module_done(req, ares->controls, ares->response, ares->error); } ret = samdb_rodc(ldb_module_get_ctx(ar->module), &rodc); if (ret != LDB_SUCCESS) { - return ret; + ldb_asprintf_errstring(ldb_module_get_ctx(ar->module), "Failed to determine if we are an RODC when attempting to form conflict DN: %s", ldb_errstring(ldb_module_get_ctx(ar->module))); + return ldb_module_done(req, ares->controls, ares->response, LDB_ERR_OPERATIONS_ERROR); } - /* + /* * we have a conflict, and need to decide if we will keep the * new record or the old record */ @@ -3435,7 +3438,7 @@ static int replmd_op_possible_conflict_callback(struct ldb_request *req, struct conflict_dn = req->op.rename.newdn; break; default: - return ldb_module_operr(ar->module); + return ldb_module_done(req, ares->controls, ares->response, ldb_module_operr(ar->module)); } if (rodc) { @@ -3589,8 +3592,6 @@ static int replmd_op_possible_conflict_callback(struct ldb_request *req, struct goto failed; } - req->callback = callback; - return ldb_next_request(ar->module, req); } @@ -3599,7 +3600,7 @@ failed: * will stop with an error, but there is not much else we can * do */ - return callback(req, ares); + return ldb_module_done(req, ares->controls, ares->response, ares->error); } /* |