dsdb: Simplifiy VANISH_LINKS handling: The variable "parent" is always non-NULL
authorAndrew Bartlett <abartlet@samba.org>
Mon, 24 Feb 2020 00:28:56 +0000 (13:28 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 28 Feb 2020 03:08:46 +0000 (03:08 +0000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index a8a61d5df7c3b2102a452bc8f758771b1b3ca99c..3395e6395ac8bf0de2504c1e3eaf463d35319e7f 100644 (file)
@@ -2829,12 +2829,10 @@ static int replmd_modify_la_delete(struct ldb_module *module,
                return ret;
        }
 
-       if (parent) {
-               vanish_links_ctrl = ldb_request_get_control(parent, DSDB_CONTROL_REPLMD_VANISH_LINKS);
-               if (vanish_links_ctrl) {
-                       vanish_links = true;
-                       vanish_links_ctrl->critical = false;
-               }
+       vanish_links_ctrl = ldb_request_get_control(parent, DSDB_CONTROL_REPLMD_VANISH_LINKS);
+       if (vanish_links_ctrl) {
+               vanish_links = true;
+               vanish_links_ctrl->critical = false;
        }
 
        /* we empty out el->values here to avoid damage if we return early. */
@@ -3344,20 +3342,18 @@ static int replmd_modify_handle_linked_attribs(struct ldb_module *module,
                        continue;
                }
                if ((schema_attr->linkID & 1) == 1) {
-                       if (parent) {
-                               struct ldb_control *ctrl;
+                       struct ldb_control *ctrl;
 
-                               ctrl = ldb_request_get_control(parent,
-                                               DSDB_CONTROL_REPLMD_VANISH_LINKS);
-                               if (ctrl != NULL) {
-                                       ctrl->critical = false;
-                                       continue;
-                               }
-                               ctrl = ldb_request_get_control(parent,
-                                               DSDB_CONTROL_DBCHECK);
-                               if (ctrl != NULL) {
-                                       continue;
-                               }
+                       ctrl = ldb_request_get_control(parent,
+                                                      DSDB_CONTROL_REPLMD_VANISH_LINKS);
+                       if (ctrl != NULL) {
+                               ctrl->critical = false;
+                               continue;
+                       }
+                       ctrl = ldb_request_get_control(parent,
+                                                      DSDB_CONTROL_DBCHECK);
+                       if (ctrl != NULL) {
+                               continue;
                        }
 
                        /* Odd is for the target.  Illegal to modify */