r26282: These modules expect errors, but if we don't wipe the error string, we
authorAndrew Bartlett <abartlet@samba.org>
Tue, 4 Dec 2007 02:37:41 +0000 (03:37 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:07 +0000 (05:48 +0100)
get phony error strings at the caller, which is very confusing.

Andrew Bartlett

source/dsdb/samdb/ldb_modules/objectclass.c
source/dsdb/samdb/ldb_modules/subtree_delete.c

index 5626d9a891d76e0e3d14af5c35182f653060493b..b996f052501e86bb51f458d166faf5ff1ecb4edb 100644 (file)
@@ -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));
index 92f539457e3ad0d82ec40640fbdf9edbd537d788..f8064a4967c02e509e968b11533399630f463ab6 100644 (file)
@@ -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);