commit 18bcd853be0aa8f23510c60b6623771d802c2c2c
Author: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Date:   Fri Jul 17 18:43:39 2009 +0200

    [SAMBA 4] Improve the result value given by "ldb_module_done"
    
    I think we should consider both results.

diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 05dffd0..1035270 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -700,8 +700,11 @@ int ldb_module_done(struct ldb_request *req,
 	ares->response = talloc_steal(ares, response);
 	ares->error = error;
 
-	req->callback(req, ares);
-	return error;
+	error = req->callback(req, ares);
+	if (error != LDB_SUCCESS)
+		return error;
+	else
+		return ares->error;
 }
 
 /* to be used *only* in modules init functions.
