s4-dsdb: allow modification of linked attribute targets with relax
authorAndrew Tridgell <tridge@samba.org>
Tue, 29 Mar 2011 05:14:18 +0000 (16:14 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 29 Mar 2011 05:37:04 +0000 (07:37 +0200)
this is used to help recover a corrupt database.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/samdb/ldb_modules/objectclass_attrs.c

index 8f6cc669ba3ba86f57d595c189fb8dac0d4fd47c..9df121002f071c4d5f2dc903f526c3e89de2fe70 100644 (file)
@@ -127,7 +127,8 @@ static int attr_handler(struct oc_context *ac)
                        return LDB_ERR_NO_SUCH_ATTRIBUTE;
                }
 
-               if ((attr->linkID & 1) == 1) {
+               if ((attr->linkID & 1) == 1 &&
+                   !ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) {
                        /* 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",