dsdb:extended_dn_store: implement DSDB_CONTROL_DBCHECK_FIX_DUPLICATE_LINKS control
authorStefan Metzmacher <metze@samba.org>
Thu, 26 Oct 2017 05:47:48 +0000 (07:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 23 Nov 2017 12:26:24 +0000 (13:26 +0100)
This will be used by dbcheck to fix duplicate link values.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13095

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/samdb/ldb_modules/extended_dn_store.c

index 28ad9d01a8ba91234fb77897b75912f19c334043..a32ab8d6f935d89870787170c4b772d855e62731 100644 (file)
@@ -375,6 +375,7 @@ static int extended_dn_modify(struct ldb_module *module, struct ldb_request *req
 
        unsigned int i, j;
        struct extended_dn_context *ac;
+       struct ldb_control *fix_links_control = NULL;
        int ret;
 
        if (ldb_dn_is_special(req->op.mod.message->dn)) {
@@ -393,6 +394,12 @@ static int extended_dn_modify(struct ldb_module *module, struct ldb_request *req
                return ldb_next_request(module, req);
        }
 
+       fix_links_control = ldb_request_get_control(req,
+                                       DSDB_CONTROL_DBCHECK_FIX_DUPLICATE_LINKS);
+       if (fix_links_control != NULL) {
+               return ldb_next_request(module, req);
+       }
+
        for (i=0; i < req->op.mod.message->num_elements; i++) {
                const struct ldb_message_element *el = &req->op.mod.message->elements[i];
                const struct dsdb_attribute *schema_attr