summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-03-08 03:32:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:23 -0500
commitf80d21069b7e22fbe8abdd59e7acb748f0a6b1ce (patch)
tree572f4658c930f243a9607bed9551013e3b601a26
parent35a606378d4491d6fbd0e4b45fd460989bb83a36 (diff)
downloadsamba-f80d21069b7e22fbe8abdd59e7acb748f0a6b1ce.tar.gz
samba-f80d21069b7e22fbe8abdd59e7acb748f0a6b1ce.tar.bz2
samba-f80d21069b7e22fbe8abdd59e7acb748f0a6b1ce.zip
r21760: Try to pin down were some errors are coming from. Ensure we at least
name the module. Andrew Bartlett (This used to be commit 2e85b1583b3da95db9b5b724b38748ff7d1f9efd)
-rw-r--r--source4/lib/ldb/common/ldb_modules.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 848ad7e551..59a2713df8 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -392,32 +392,49 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
int ldb_next_request(struct ldb_module *module, struct ldb_request *request)
{
+ int ret;
switch (request->operation) {
case LDB_SEARCH:
FIND_OP(module, search);
- return module->ops->search(module, request);
+ ret = module->ops->search(module, request);
+ break;
case LDB_ADD:
FIND_OP(module, add);
- return module->ops->add(module, request);
+ ret = module->ops->add(module, request);
+ break;
case LDB_MODIFY:
FIND_OP(module, modify);
- return module->ops->modify(module, request);
+ ret = module->ops->modify(module, request);
+ break;
case LDB_DELETE:
FIND_OP(module, del);
- return module->ops->del(module, request);
+ ret = module->ops->del(module, request);
+ break;
case LDB_RENAME:
FIND_OP(module, rename);
- return module->ops->rename(module, request);
+ ret = module->ops->rename(module, request);
+ break;
case LDB_EXTENDED:
FIND_OP(module, extended);
- return module->ops->extended(module, request);
+ ret = module->ops->extended(module, request);
+ break;
case LDB_SEQUENCE_NUMBER:
FIND_OP(module, sequence_number);
- return module->ops->sequence_number(module, request);
+ ret = module->ops->sequence_number(module, request);
+ break;
default:
FIND_OP(module, request);
- return module->ops->request(module, request);
+ ret = module->ops->request(module, request);
+ break;
+ }
+ if (ret == LDB_SUCCESS) {
+ return ret;
}
+ if (!ldb_errstring(module->ldb)) {
+ /* Set a default error string, to place the blame somewhere */
+ ldb_asprintf_errstring(module->ldb, "error in module %s: %s", module->ops->name, ldb_strerror(ret));
+ }
+ return ret;
}
int ldb_next_init(struct ldb_module *module)