From d4fbd381fa5f75a76870531fe15bace4550e0f01 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 4 Dec 2007 03:37:41 +0100 Subject: 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) --- source4/dsdb/samdb/ldb_modules/objectclass.c | 3 +++ source4/dsdb/samdb/ldb_modules/subtree_delete.c | 4 ++++ 2 files changed, 7 insertions(+) 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); -- cgit