s4-dsdb: use LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK in dsdb
authorAndrew Tridgell <tridge@samba.org>
Thu, 4 Nov 2010 09:33:31 +0000 (20:33 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 4 Nov 2010 09:35:44 +0000 (20:35 +1100)
when we are creating linked attributes with multiple values (some
deleted), use LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK to disable
that checking.

source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index d54060b29323c18f355b7705b991a29fc93b6a75..60455251e38282c5f06c59653deeb2ca838d1a2c 100644 (file)
@@ -681,7 +681,11 @@ static int linked_attributes_fix_links(struct ldb_module *module,
                        return ret;
                }
 
-               ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE | DSDB_MODIFY_RELAX);
+               /* we may be putting multiple values in an attribute -
+                  disable checking for this attribute */
+               el2->flags |= LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK;
+
+               ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE);
                if (ret != LDB_SUCCESS) {
                        ldb_asprintf_errstring(ldb, "Linked attribute %s->%s between %s and %s - update failed - %s",
                                               el->name, target->lDAPDisplayName,
index d7ad46fd008f47de3dbff4564c093286156f060a..907cc4a066c77460ef1e54b6ee3fcdee85925bcd 100644 (file)
@@ -4090,7 +4090,9 @@ linked_attributes[0]:
                return ret;
        }
 
-       ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE | DSDB_MODIFY_RELAX);
+       old_el->flags |= LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK;
+
+       ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE);
        if (ret != LDB_SUCCESS) {
                ldb_debug(ldb, LDB_DEBUG_WARNING, "Failed to apply linked attribute change '%s'\n%s\n",
                          ldb_errstring(ldb),