summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/linked_attributes.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-19 21:42:40 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-02 08:16:51 +1100
commit5dcb903f26045656372993822debcfbc956827b0 (patch)
tree8300c80a3367c023ce836eb9a158c4dfb3652fc2 /source4/dsdb/samdb/ldb_modules/linked_attributes.c
parent3c1259f10eb827de05198a8eaf79a4610d1d41e6 (diff)
downloadsamba-5dcb903f26045656372993822debcfbc956827b0.tar.gz
samba-5dcb903f26045656372993822debcfbc956827b0.tar.bz2
samba-5dcb903f26045656372993822debcfbc956827b0.zip
s4-dsdb: move checking for single valued links to samba modules
This uses the RELAX control and checking of single valued attributes in ldb modules to avoid problems with multi-valued links where all values but one are deleted
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/linked_attributes.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/linked_attributes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index 4113a58154..4c326bc240 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -116,7 +116,13 @@ static int linked_attributes_fix_links(struct ldb_module *module,
dsdb_dn_get_extended_linearized(el2->values, dsdb_dn2, 1));
}
- ret = dsdb_module_modify(module, msg, 0);
+ ret = dsdb_check_single_valued_link(target, el2);
+ if (ret != LDB_SUCCESS) {
+ talloc_free(tmp_ctx);
+ return ret;
+ }
+
+ ret = dsdb_module_modify(module, msg, DSDB_MODIFY_RELAX);
if (ret != LDB_SUCCESS) {
ldb_asprintf_errstring(ldb, "Linked attribute %s->%s between %s and %s - update failed - %s",
el->name, target->lDAPDisplayName,