From 81e8a18181d3f24ac837ae0295fc2fca927a7ddf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 29 Dec 2009 11:40:30 +1100 Subject: s4-ldb: allow modules to override error return values The samldb module overrides the error code for some returns when handling primaryGroupID. We need to take the error from the async callback to allow this to work reliably --- source4/lib/ldb/common/ldb_modules.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index e49d46a987..5e9d0e6e98 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -606,7 +606,7 @@ int ldb_next_request(struct ldb_module *module, struct ldb_request *request) * all our modules, and leaves us one less sharp * corner for module developers to cut themselves on */ - ldb_module_done(request, NULL, NULL, ret); + ret = ldb_module_done(request, NULL, NULL, ret); } return ret; } @@ -830,7 +830,9 @@ int ldb_module_done(struct ldb_request *req, } req->callback(req, ares); - return error; + /* returning ares->error here allows the callback routines in + modules to override the error code */ + return ares->error; } /* to be used *only* in modules init functions. -- cgit