summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-12-04 03:37:41 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:07 +0100
commitd4fbd381fa5f75a76870531fe15bace4550e0f01 (patch)
treeeca3aa6ee60e1f765632834b7ed5f57adcbe6853 /source4/dsdb/samdb/ldb_modules
parente611afb3e4edc50d80c3145aa119d0d3b63dbacc (diff)
downloadsamba-d4fbd381fa5f75a76870531fe15bace4550e0f01.tar.gz
samba-d4fbd381fa5f75a76870531fe15bace4550e0f01.tar.bz2
samba-d4fbd381fa5f75a76870531fe15bace4550e0f01.zip
r26282: These modules expect errors, but if we don't wipe the error string, we
get phony error strings at the caller, which is very confusing. Andrew Bartlett (This used to be commit 9ac7f4f6098b392dbe4a883a802d2417e074586a)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c3
-rw-r--r--source4/dsdb/samdb/ldb_modules/subtree_delete.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 5626d9a891..b996f05250 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -453,6 +453,9 @@ static int objectclass_do_add(struct ldb_handle *h)
if (ac->search_res == NULL) {
if (ldb_dn_compare(ldb_get_root_basedn(ac->module->ldb), ac->orig_req->op.add.message->dn) == 0) {
/* Allow the tree to be started */
+
+ /* but don't keep any error string, it's meaningless */
+ ldb_set_errstring(ac->module->ldb, NULL);
} else {
ldb_asprintf_errstring(ac->module->ldb, "objectclass: Cannot add %s, parent does not exist!",
ldb_dn_get_linearized(ac->orig_req->op.add.message->dn));
diff --git a/source4/dsdb/samdb/ldb_modules/subtree_delete.c b/source4/dsdb/samdb/ldb_modules/subtree_delete.c
index 92f539457e..f8064a4967 100644
--- a/source4/dsdb/samdb/ldb_modules/subtree_delete.c
+++ b/source4/dsdb/samdb/ldb_modules/subtree_delete.c
@@ -89,6 +89,10 @@ static int subtree_delete_check_for_children(struct subtree_delete_context *ac)
}
*req = *ac->orig_req;
+ /* Ensure any (io) errors during the search for
+ * children don't propgate back in the error string */
+ ldb_set_errstr(ac->module->ldb, NULL);
+
ac->down_req = req;
ac->step = SD_DO_DEL;
return ldb_next_request(ac->module, req);