From 7ad56d41740d6794a85889f268654564c48c8a74 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Feb 2020 13:28:56 +1300 Subject: dsdb: Simplifiy VANISH_LINKS handling: The variable "parent" is always non-NULL Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 34 +++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index a8a61d5df7c..3395e6395ac 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -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 */ -- cgit v1.2.1