TODO: PART1 dsdb:ldb_modules: make use of LDB_FLAG_INTERNAL_DISABLE_DUP_VALUE_CHECK
authorStefan Metzmacher <metze@samba.org>
Tue, 9 Jan 2018 14:14:23 +0000 (15:14 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 30 Jan 2018 12:18:12 +0000 (13:18 +0100)
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index c6beb25e58b48e81e2aacc964be981dea30ffad0..a14c8381578823f943bb9bbd9b36a272f61194b5 100644 (file)
@@ -185,6 +185,13 @@ static int la_store_op(struct la_context *ac,
 
        ldb = ldb_module_get_ctx(ac->module);
 
+       if (schema_attr->linkID == 0) {
+               return ldb_operr(ldb);
+       }
+
+       if (schema_attr->linkID & 1) {
+               return ldb_operr(ldb);
+       }
 
        os = talloc_zero(ac, struct la_op_store);
        if (!os) {
@@ -826,6 +833,9 @@ static int linked_attributes_fix_links(struct ldb_module *module,
                /* we may be putting multiple values in an attribute -
                   disable checking for this attribute */
                el2->flags |= LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK;
+               if (target->linkID & 1) {
+                       el2->flags |= LDB_FLAG_INTERNAL_DISABLE_DUP_VALUE_CHECK;
+               }
 
                ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE, parent);
                if (ret != LDB_SUCCESS) {
@@ -1126,6 +1136,7 @@ static int la_do_op_request(struct ldb_module *module, struct la_context *ac, st
           valued and a backlink. We need to cope with that by
           ignoring the single value flag */
        ret_el->flags |= LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK;
+       ret_el->flags |= LDB_FLAG_INTERNAL_DISABLE_DUP_VALUE_CHECK;
 
 #if 0
        ldb_debug(ldb, LDB_DEBUG_WARNING,
index 2d4c1f50564d5ed229fd86f905671c2a1ae9aaaa..95724281f4284ccf2e1ae68da1d9f2229ef4d521 100644 (file)
@@ -419,6 +419,7 @@ static int replmd_process_backlink(struct ldb_module *module, struct la_backlink
           valued and a backlink. We need to cope with that by
           ignoring the single value flag */
        msg->elements[0].flags |= LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK;
+       msg->elements[0].flags |= LDB_FLAG_INTERNAL_DISABLE_DUP_VALUE_CHECK;
 
        ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE, parent);
        if (ret == LDB_ERR_NO_SUCH_ATTRIBUTE && !bl->active) {