upgradeprovision: use the relax/(upgrade)provision when modifying object
authorMatthieu Patou <mat@matws.net>
Sat, 23 Oct 2010 18:01:30 +0000 (22:01 +0400)
committerMatthieu Patou <mat@samba.org>
Fri, 12 Nov 2010 19:40:21 +0000 (19:40 +0000)
For certain attribute we use the relax/provision control so that we
try to respect checks as this is not a good idea to always force
unwanted behavior.

source4/scripting/bin/upgradeprovision

index 4dd8f533be7f6ccaec0164ffa6abc4a357d6438d..e1ef57193d6c6ac6b4a720af830bd10e3b6e8687 100755 (executable)
@@ -984,10 +984,17 @@ def update_present(ref_samdb, samdb, basedn, listPresent, usns, invocationid):
         delta.dn = dn
         if len(delta.items()) >1:
             attributes=", ".join(delta.keys())
+            modcontrols = []
+            relaxedatt = ['iscriticalsystemobject', 'grouptype']
+            # Let's try to reduce as much as possible the use of relax control
+            #for checkedatt in relaxedatt:
+            for attr in delta.keys():
+                if attr.lower() in relaxedatt:
+                    modcontrols = ["relax:0", "local_oid:1.3.6.1.4.1.7165.4.3.16:0"]
             message(CHANGE, "%s is different from the reference one, changed"
                             " attributes: %s\n" % (dn, attributes))
             changed += 1
-            samdb.modify(delta)
+            samdb.modify(delta, modcontrols)
     return changed
 
 def reload_full_schema(samdb, names):