summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-08-12 17:28:28 +0400
committerMatthieu Patou <mat@matws.net>2010-08-19 15:59:05 +0400
commita5653bcf837f6941fd26d233fbba15976fb0897e (patch)
treeb91e897bea47c921ad1a17a2ac07aeb7f3749eb7 /source4/scripting
parente378d7fd89beeffc20bafa04e0fcfb895eaccbf5 (diff)
downloadsamba-a5653bcf837f6941fd26d233fbba15976fb0897e.tar.gz
samba-a5653bcf837f6941fd26d233fbba15976fb0897e.tar.bz2
samba-a5653bcf837f6941fd26d233fbba15976fb0897e.zip
s4 upgradeprovision: add more attrbutes the ignore list
Also format in a pretty way the int64 ranges
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision14
-rwxr-xr-xsource4/scripting/python/samba/upgradehelpers.py11
2 files changed, 20 insertions, 5 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index fe339e00b7..857b0b3a51 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -60,6 +60,7 @@ from samba.upgradehelpers import (dn_sort, get_paths, newprovision,
delta_update_basesamdb, update_policyids,
update_machine_account_password,
search_constructed_attrs_stored,
+ int64range2str,
increment_calculated_keyversion_number)
replace=2**FLAG_MOD_REPLACE
@@ -107,6 +108,7 @@ hashOverwrittenAtt = { "prefixMap": replace, "systemMayContain": replace,
"wellKnownObjects":replace, "privilege":never,
"defaultSecurityDescriptor": replace,
"rIDAvailablePool": never,
+ "rIDNextRID": add, "rIDUsedPool": never,
"defaultSecurityDescriptor": replace + add,
"isMemberOfPartialAttributeSet": delete,
"attributeDisplayNames": replace + add}
@@ -411,7 +413,13 @@ def dump_denied_change(dn, att, flagtxt, current, reference):
message(CHANGE, "dn= " + str(dn)+" " + att+" with flag " + flagtxt
+" is not allowed to be changed/removed, I discard this change")
- if att != "objectSid" :
+ if att == "objectSid" :
+ message(CHANGE, "old : %s" % ndr_unpack(security.dom_sid, current[0]))
+ message(CHANGE, "new : %s" % ndr_unpack(security.dom_sid, reference[0]))
+ elif att == "rIDPreviousAllocationPool" or att == "rIDAllocationPool":
+ message(CHANGE, "old : %s" % int64range2str(current[0]))
+ message(CHANGE, "new : %s" % int64range2str(reference[0]))
+ else:
i = 0
for e in range(0, len(current)):
message(CHANGE, "old %d : %s" % (i, str(current[e])))
@@ -421,10 +429,6 @@ def dump_denied_change(dn, att, flagtxt, current, reference):
for e in range(0, len(reference)):
message(CHANGE, "new %d : %s" % (i, str(reference[e])))
i+=1
- else:
- message(CHANGE, "old : %s" % ndr_unpack(security.dom_sid, current[0]))
- message(CHANGE, "new : %s" % ndr_unpack(security.dom_sid, reference[0]))
-
def handle_special_add(samdb, dn, names):
"""Handle special operation (like remove) on some object needed during
diff --git a/source4/scripting/python/samba/upgradehelpers.py b/source4/scripting/python/samba/upgradehelpers.py
index a588a84346..7b09d4a441 100755
--- a/source4/scripting/python/samba/upgradehelpers.py
+++ b/source4/scripting/python/samba/upgradehelpers.py
@@ -886,3 +886,14 @@ def search_constructed_attrs_stored(samdb, rootdn, attrs):
hashAtt[att][str(ent.dn).lower()] = str(ent[att])
return hashAtt
+
+def int64range2str(value):
+ """Display the int64 range stored in value as xxx-yyy
+
+ :param value: The int64 range
+ :return: A string of the representation of the range
+ """
+
+ lvalue = long(value)
+ str = "%d-%d" % (lvalue&0xFFFFFFFF, lvalue>>32)
+ return str