diff options
author | Matthieu Patou <mat@matws.net> | 2011-07-21 00:50:38 +0400 |
---|---|---|
committer | Matthieu Patou <mat@samba.org> | 2011-07-26 23:34:24 +0200 |
commit | 5f1f15399843760d3c3cf98022c76017a3a415c8 (patch) | |
tree | d1ebbba54c85040e7af7b7850a2469a298180e24 /source4/scripting | |
parent | c79e08fb1bb36a36bb09e01fdf62094a850ec3ed (diff) | |
download | samba-5f1f15399843760d3c3cf98022c76017a3a415c8.tar.gz samba-5f1f15399843760d3c3cf98022c76017a3a415c8.tar.bz2 samba-5f1f15399843760d3c3cf98022c76017a3a415c8.zip |
s4-upgradeprovision: Detect recent provision in a more reliable way
Diffstat (limited to 'source4/scripting')
-rwxr-xr-x | source4/scripting/bin/upgradeprovision | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index 54f3cf1507..af97964713 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -1346,6 +1346,16 @@ def rebuild_sd(samdb, names): message(ERROR, "On %s bad stuff %s" % (str(delta.dn),badsd.as_sddl(names.domainsid))) return +def hasATProvision(samdb): + entry = samdb.search(expression="dn=@PROVISION", base = "", + scope=SCOPE_SUBTREE, + attrs=["dn"]) + + if entry != None and len(entry) == 1: + return True + else: + return False + def removeProvisionUSN(samdb): attrs = [samba.provision.LAST_PROVISION_USN_ATTRIBUTE, "dn"] entry = samdb.search(expression="dn=@PROVISION", base = "", @@ -1793,7 +1803,8 @@ if __name__ == '__main__': new_ldbs.groupedCommit() deltaattr = None # 11) - if re.match(".*alpha((9)|(\d\d+)).*", str(oem)): + message(GUESS, oem) + if hasATProvision(ldbs.sam) or re.match(".*alpha((9)|(\d\d+)).*", str(oem)): # 11) A # Starting from alpha9 we can consider that the structure is quite ok # and that we should do only dela |