summaryrefslogtreecommitdiff
path: root/source4/scripting/bin/upgradeprovision
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-07-05 23:46:46 +0400
committerAndrew Bartlett <abartlet@samba.org>2010-07-15 22:08:21 +1000
commit0a1b1121c48e26c5218e2ccc0c8a8cc724b96624 (patch)
treec5f9dec4fa0274f786c85378a507595f960f40c3 /source4/scripting/bin/upgradeprovision
parent2afc2f20b65b28140274828249160f1483090b5e (diff)
downloadsamba-0a1b1121c48e26c5218e2ccc0c8a8cc724b96624.tar.gz
samba-0a1b1121c48e26c5218e2ccc0c8a8cc724b96624.tar.bz2
samba-0a1b1121c48e26c5218e2ccc0c8a8cc724b96624.zip
s4 upgradeprovision: do not copy RID Set it's automaticaly created by the RID manager
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting/bin/upgradeprovision')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision58
1 files changed, 34 insertions, 24 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index c22f3ce43b..888f3a8256 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -516,30 +516,40 @@ def add_missing_object(ref_samdb, samdb, dn, names, basedn, hash, index):
empty = Message()
delta = samdb.msg_diff(empty, reference[0])
delta.dn
- if delta.get("objectSid"):
- sid = str(ndr_unpack(security.dom_sid, str(reference[0]["objectSid"])))
- m = re.match(r".*-(\d+)$", sid)
- if m and int(m.group(1))>999:
- delta.remove("objectSid")
- for att in hashAttrNotCopied.keys():
- delta.remove(att)
- for att in backlinked:
- delta.remove(att)
- depend_on_yettobecreated = None
- for att in dn_syntax_att:
- depend_on_yet_tobecreated = check_dn_nottobecreated(hash, index,
- delta.get(str(att)))
- if depend_on_yet_tobecreated is not None:
- message(CHANGE, "Object %s depends on %s in attribute %s,"
- "delaying the creation" % (dn,
- depend_on_yet_tobecreated, att))
- return False
-
- delta.dn = dn
- message(CHANGE,"Object %s will be added" % dn)
- samdb.add(delta, ["relax:0"])
-
- return True
+ skip = False
+ try:
+ if str(reference[0].get("cn")) == "RID Set":
+ for klass in reference[0].get("objectClass"):
+ if str(klass).lower == "ridset":
+ skip = True
+ finally:
+ if delta.get("objectSid"):
+ sid = str(ndr_unpack(security.dom_sid, str(reference[0]["objectSid"])))
+ m = re.match(r".*-(\d+)$", sid)
+ if m and int(m.group(1))>999:
+ delta.remove("objectSid")
+ for att in hashAttrNotCopied.keys():
+ delta.remove(att)
+ for att in backlinked:
+ delta.remove(att)
+ depend_on_yettobecreated = None
+ for att in dn_syntax_att:
+ depend_on_yet_tobecreated = check_dn_nottobecreated(hash, index,
+ delta.get(str(att)))
+ if depend_on_yet_tobecreated is not None:
+ message(CHANGE, "Object %s depends on %s in attribute %s,"
+ "delaying the creation" % (dn,
+ depend_on_yet_tobecreated, att))
+ return False
+
+ delta.dn = dn
+ if not skip:
+ message(CHANGE,"Object %s will be added" % dn)
+ samdb.add(delta, ["relax:0"])
+ else:
+ message(CHANGE,"Object %s was skipped" % dn)
+
+ return True
def gen_dn_index_hash(listMissing):
"""Generate a hash associating the DN to its creation order