From 3fe747538bc79633ed7039c6c001902bacecef04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Fri, 14 Oct 2011 09:25:56 +0200 Subject: [PATCH] s4:repl_meta_data LDB module - "dsdb_search_module_dn" already checks if len(res) == 1 No need to perform an additional check here. As a return value we should always give back the original error code and not generate a new one (to let the caller know what is going on). Reviewed-by: abartlet --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index b3126c3e883..090e28fdf54 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -1243,10 +1243,10 @@ static int replmd_update_rpmd(struct ldb_module *module, DSDB_SEARCH_SHOW_DN_IN_STORAGE_FORMAT | DSDB_SEARCH_REVEAL_INTERNALS, req); - if (ret != LDB_SUCCESS || res->count != 1) { + if (ret != LDB_SUCCESS) { DEBUG(0,(__location__ ": Object %s failed to find uSNChanged\n", ldb_dn_get_linearized(msg->dn))); - return LDB_ERR_OPERATIONS_ERROR; + return ret; } objectclass_el = ldb_msg_find_element(res->msgs[0], "objectClass"); @@ -1275,10 +1275,10 @@ static int replmd_update_rpmd(struct ldb_module *module, DSDB_SEARCH_SHOW_EXTENDED_DN | DSDB_SEARCH_SHOW_DN_IN_STORAGE_FORMAT | DSDB_SEARCH_REVEAL_INTERNALS, req); - if (ret != LDB_SUCCESS || res->count != 1) { + if (ret != LDB_SUCCESS) { DEBUG(0,(__location__ ": Object %s failed to find replPropertyMetaData\n", ldb_dn_get_linearized(msg->dn))); - return LDB_ERR_OPERATIONS_ERROR; + return ret; } objectclass_el = ldb_msg_find_element(res->msgs[0], "objectClass"); -- 2.11.4.GIT