From 6b136a8184d6f703405d0f53613b061af3601725 Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Tue, 20 Nov 2018 16:02:05 +1300 Subject: [PATCH] replmd: remove unnecessary indent The previous refactor now means we return early if we don't need to re-apply isDeleted to the object. The 'else' is redundant and we can remove it to avoid unnecessary indent. This patch is basically just a whitespace change. It should not alter functionality. Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Nov 23 08:10:41 CET 2018 on sn-devel-144 --- .../dsdb/samdb/ldb_modules/repl_meta_data.c | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 97ab6ac7b9b..cfa63af7066 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -6847,6 +6847,9 @@ static int replmd_replicated_apply_isDeleted(struct replmd_replicated_request *a struct ldb_message *msg = ar->objs->objects[ar->index_current].msg; int ret; bool apply_isDeleted; + struct ldb_request *del_req = NULL; + struct ldb_result *res = NULL; + TALLOC_CTX *tmp_ctx = NULL; apply_isDeleted = replmd_should_apply_isDeleted(ar, msg); @@ -6855,67 +6858,63 @@ static int replmd_replicated_apply_isDeleted(struct replmd_replicated_request *a /* nothing to do */ ar->index_current++; return replmd_replicated_apply_next(ar); + } - } else { - /* - * Do a delete here again, so that if there is - * anything local that conflicts with this - * object being deleted, it is removed. This - * includes links. See MS-DRSR 4.1.10.6.9 - * UpdateObject. - * - * If the object is already deleted, and there - * is no more work required, it doesn't do - * anything. - */ - - /* This has been updated to point to the DN we eventually did the modify on */ + /* + * Do a delete here again, so that if there is + * anything local that conflicts with this + * object being deleted, it is removed. This + * includes links. See MS-DRSR 4.1.10.6.9 + * UpdateObject. + * + * If the object is already deleted, and there + * is no more work required, it doesn't do + * anything. + */ - struct ldb_request *del_req; - struct ldb_result *res; + /* This has been updated to point to the DN we eventually did the modify on */ - TALLOC_CTX *tmp_ctx = talloc_new(ar); - if (!tmp_ctx) { - ret = ldb_oom(ldb_module_get_ctx(ar->module)); - return ret; - } + tmp_ctx = talloc_new(ar); + if (!tmp_ctx) { + ret = ldb_oom(ldb_module_get_ctx(ar->module)); + return ret; + } - res = talloc_zero(tmp_ctx, struct ldb_result); - if (!res) { - ret = ldb_oom(ldb_module_get_ctx(ar->module)); - talloc_free(tmp_ctx); - return ret; - } + res = talloc_zero(tmp_ctx, struct ldb_result); + if (!res) { + ret = ldb_oom(ldb_module_get_ctx(ar->module)); + talloc_free(tmp_ctx); + return ret; + } - /* Build a delete request, which hopefully will artually turn into nothing */ - ret = ldb_build_del_req(&del_req, ldb_module_get_ctx(ar->module), tmp_ctx, - msg->dn, - NULL, - res, - ldb_modify_default_callback, - ar->req); - LDB_REQ_SET_LOCATION(del_req); - if (ret != LDB_SUCCESS) { - talloc_free(tmp_ctx); - return ret; - } + /* Build a delete request, which hopefully will artually turn into nothing */ + ret = ldb_build_del_req(&del_req, ldb_module_get_ctx(ar->module), tmp_ctx, + msg->dn, + NULL, + res, + ldb_modify_default_callback, + ar->req); + LDB_REQ_SET_LOCATION(del_req); + if (ret != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return ret; + } - /* - * This is the guts of the call, call back - * into our delete code, but setting the - * re_delete flag so we delete anything that - * shouldn't be there on a deleted or recycled - * object - */ - ret = replmd_delete_internals(ar->module, del_req, true); - if (ret == LDB_SUCCESS) { - ret = ldb_wait(del_req->handle, LDB_WAIT_ALL); - } + /* + * This is the guts of the call, call back + * into our delete code, but setting the + * re_delete flag so we delete anything that + * shouldn't be there on a deleted or recycled + * object + */ + ret = replmd_delete_internals(ar->module, del_req, true); + if (ret == LDB_SUCCESS) { + ret = ldb_wait(del_req->handle, LDB_WAIT_ALL); + } - talloc_free(tmp_ctx); - if (ret != LDB_SUCCESS) { - return ret; - } + talloc_free(tmp_ctx); + if (ret != LDB_SUCCESS) { + return ret; } ar->index_current++; -- 2.34.1