From 269143fa0031ef0b6d801b47aab48ff3b1414565 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Oct 2010 20:58:38 +1100 Subject: s4-ldb: take advantage of ldb_match_msg_error() in more places this gives better error checking --- source4/lib/ldb/ldb_map/ldb_map_outbound.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source4/lib/ldb/ldb_map/ldb_map_outbound.c') diff --git a/source4/lib/ldb/ldb_map/ldb_map_outbound.c b/source4/lib/ldb/ldb_map/ldb_map_outbound.c index 98cd525e86..40be94c894 100644 --- a/source4/lib/ldb/ldb_map/ldb_map_outbound.c +++ b/source4/lib/ldb/ldb_map/ldb_map_outbound.c @@ -1070,14 +1070,19 @@ int map_return_entry(struct map_context *ac, struct ldb_reply *ares) const char * const *attrs; struct ldb_context *ldb; unsigned int i; + int ret; + bool matched; ldb = ldb_module_get_ctx(ac->module); /* Merged result doesn't match original query, skip */ - if (!ldb_match_msg(ldb, ares->message, - ac->req->op.search.tree, - ac->req->op.search.base, - ac->req->op.search.scope)) { + ret = ldb_match_msg_error(ldb, ares->message, + ac->req->op.search.tree, + ac->req->op.search.base, + ac->req->op.search.scope, + &matched); + if (ret != LDB_SUCCESS) return ret; + if (!matched) { ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_map: " "Skipping record '%s': " "doesn't match original search", -- cgit