s4-dsdb: allow deletion of backlinks if DSDB_CONTROL_DBCHECK given
authorAndrew Tridgell <tridge@samba.org>
Thu, 6 Oct 2011 03:21:02 +0000 (14:21 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 6 Oct 2011 03:34:22 +0000 (14:34 +1100)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

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

index 9893adae93752c353ac976c163acd428d0586dad..b6f91651dc93e484c42268510ab86591ea583fbb 100644 (file)
@@ -173,7 +173,8 @@ static int attr_handler(struct oc_context *ac)
                }
 
                if ((attr->linkID & 1) == 1 &&
-                   !ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) {
+                   !ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID) &&
+                   !ldb_request_get_control(ac->req, DSDB_CONTROL_DBCHECK)) {
                        /* Odd is for the target.  Illegal to modify */
                        ldb_asprintf_errstring(ldb, 
                                               "objectclass_attrs: attribute '%s' on entry '%s' must not be modified directly, it is a linked attribute", 
index fff542abca108f65c39a05f102b711a2b653896f..2be0760d14a65ce4c0d11b0120991f267678429d 100644 (file)
@@ -2179,6 +2179,9 @@ static int replmd_modify_handle_linked_attribs(struct ldb_module *module,
                        continue;
                }
                if ((schema_attr->linkID & 1) == 1) {
+                       if (parent && ldb_request_get_control(parent, DSDB_CONTROL_DBCHECK)) {
+                               continue;
+                       }
                        /* Odd is for the target.  Illegal to modify */
                        ldb_asprintf_errstring(ldb,
                                               "attribute %s must not be modified directly, it is a linked attribute", el->name);