replmd: remove unnecessary indent
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 20 Nov 2018 03:02:05 +0000 (16:02 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Nov 2018 07:10:41 +0000 (08:10 +0100)
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 <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov 23 08:10:41 CET 2018 on sn-devel-144

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 97ab6ac7b9bf0fcce2fe8b05dfdb04e454741220..cfa63af706690befa2886e22aa1e20f5ce62c485 100644 (file)
@@ -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++;