From 5f1f15399843760d3c3cf98022c76017a3a415c8 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Thu, 21 Jul 2011 00:50:38 +0400 Subject: s4-upgradeprovision: Detect recent provision in a more reliable way --- source4/scripting/bin/upgradeprovision | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/scripting/bin/upgradeprovision') 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 -- cgit