SQ repl_meta_data: Allow delete of an object with dangling backlinks master4-tmp
authorStefan Metzmacher <metze@samba.org>
Mon, 20 Nov 2017 10:49:53 +0000 (11:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 23 Nov 2017 14:30:27 +0000 (15:30 +0100)
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 091517c591e21ec4f4a5531bd45159532afce641..198ac84c730d7fe97b8a595f8b26735722088ba3 100644 (file)
@@ -3173,15 +3173,17 @@ static int replmd_modify_handle_linked_attribs(struct ldb_module *module,
                }
                if ((schema_attr->linkID & 1) == 1) {
                        if (parent) {
-                               struct ldb_control *ctrl
-                                       = ldb_request_get_control(parent,
-                                                                 DSDB_CONTROL_REPLMD_VANISH_LINKS);
-                               if (ctrl) {
+                               struct ldb_control *ctrl;
+
+                               ctrl = ldb_request_get_control(parent,
+                                               DSDB_CONTROL_REPLMD_VANISH_LINKS);
+                               if (ctrl != NULL) {
                                        ctrl->critical = false;
                                        continue;
                                }
-                               if (ldb_request_get_control(parent,
-                                                           DSDB_CONTROL_DBCHECK)) {
+                               ctrl = ldb_request_get_control(parent,
+                                               DSDB_CONTROL_DBCHECK);
+                               if (ctrl != NULL) {
                                        continue;
                                }
                        }
@@ -4301,10 +4303,11 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
                                                                old_dn, &guid,
                                                                el, sa, req);
                                if (ret == LDB_SUCCESS) {
-                                       /* now we continue, which means we
-                                          won't remove this backlink
-                                          directly
-                                       */
+                                       /*
+                                        * now we continue, which means we
+                                        * won't remove this backlink
+                                        * directly
+                                        */
                                        continue;
                                }