From 6664ac88860d3e6d21ce6fdf06d2ff927496a31a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 8 Jun 2006 00:58:57 +0000 Subject: r16085: Set the error string if we fail to find a valid op to execute. Helps in chasing down bugs :-) Andrew Bartlett (This used to be commit 9ede8edbaf1731f32814917439326f49b5f9f3ef) --- source4/lib/ldb/common/ldb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/common/ldb.c') diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index ff5d2a2e8b..857c995a0e 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -189,9 +189,13 @@ void ldb_reset_err_string(struct ldb_context *ldb) } #define FIRST_OP(ldb, op) do { \ - module = ldb->modules; \ + module = ldb->modules; \ while (module && module->ops->op == NULL) module = module->next; \ - if (module == NULL) return LDB_ERR_OPERATIONS_ERROR; \ + if (module == NULL) { \ + ldb_set_errstring(ldb, \ + talloc_asprintf(ldb, "unable to find module or backend to handle operation: " #op)); \ + return LDB_ERR_OPERATIONS_ERROR; \ + } \ } while (0) /* -- cgit