summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-03-18 15:02:35 +1100
committerAndrew Tridgell <tridge@samba.org>2011-03-18 05:46:58 +0100
commitc4cfffa4ed2037ba0faa18a1def00bc3745ff485 (patch)
treed4dca7a7d968cdfe5ffc9efb9c7f0c87f03940a6
parentde5cec48a4660eb6b4dd4138e3aff11a4ed57cdc (diff)
downloadsamba-c4cfffa4ed2037ba0faa18a1def00bc3745ff485.tar.gz
samba-c4cfffa4ed2037ba0faa18a1def00bc3745ff485.tar.xz
samba-c4cfffa4ed2037ba0faa18a1def00bc3745ff485.zip
s4-rootdse: improved operations error messages
this gives better localisation of errors in rootdse. This is to help track down a production error Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Fri Mar 18 05:46:58 CET 2011 on sn-devel-104
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index 30fa4d9c519..516194d2b71 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -998,18 +998,14 @@ static int rootdse_enable_recycle_bin(struct ldb_module *module,struct ldb_conte
tmp_ctx = talloc_new(mem_ctx);
ntds_settings_dn = samdb_ntds_settings_dn(ldb);
if (!ntds_settings_dn) {
- DEBUG(0, (__location__ ": Failed to find NTDS settings DN\n"));
- ret = LDB_ERR_OPERATIONS_ERROR;
talloc_free(tmp_ctx);
- return ret;
+ return ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, "Failed to find NTDS settings DN");
}
ntds_settings_dn = ldb_dn_copy(tmp_ctx, ntds_settings_dn);
if (!ntds_settings_dn) {
- DEBUG(0, (__location__ ": Failed to copy NTDS settings DN\n"));
- ret = LDB_ERR_OPERATIONS_ERROR;
talloc_free(tmp_ctx);
- return ret;
+ return ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, "Failed to copy NTDS settings DN");
}
msg = ldb_msg_new(tmp_ctx);
@@ -1204,11 +1200,11 @@ static int rootdse_become_master(struct ldb_module *module,
status_call = dcerpc_drepl_takeFSMORole_r(irpc_handle, tmp_ctx, &r);
if (!NT_STATUS_IS_OK(status_call)) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, nt_errstr(status_call));
}
status_fn = r.out.result;
if (!W_ERROR_IS_OK(status_fn)) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, win_errstr(status_fn));
}
return ldb_module_done(req, NULL, NULL, LDB_SUCCESS);
}