summaryrefslogtreecommitdiff
path: root/source4/scripting/bin/upgradeprovision
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-03-29 00:37:26 +0400
committerJelmer Vernooij <jelmer@samba.org>2010-03-28 22:54:08 +0200
commitd18d7cfa27a3f2a088c8f3ea9de4f9d8d89fea38 (patch)
tree72e3ed3251b49dc74ef40643a721308f72aff43c /source4/scripting/bin/upgradeprovision
parent8d3ff2d41e9ffeb41d55613f645a72fbdda77861 (diff)
downloadsamba-d18d7cfa27a3f2a088c8f3ea9de4f9d8d89fea38.tar.gz
samba-d18d7cfa27a3f2a088c8f3ea9de4f9d8d89fea38.tar.bz2
samba-d18d7cfa27a3f2a088c8f3ea9de4f9d8d89fea38.zip
s4 upgradeprovision: add information about upgrade in oEMInformation to keep a better trace of different updates
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/scripting/bin/upgradeprovision')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision17
1 files changed, 15 insertions, 2 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index a04fd11b82..bdc58c3f59 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -34,7 +34,7 @@ import samba
import samba.getopt as options
from samba.credentials import DONT_USE_KERBEROS
from samba.auth import system_session, admin_session
-from samba import Ldb
+from samba import Ldb, version
from ldb import SCOPE_SUBTREE, SCOPE_BASE, \
FLAG_MOD_REPLACE, FLAG_MOD_ADD, FLAG_MOD_DELETE,\
MessageElement, Message, Dn
@@ -82,7 +82,7 @@ hashAttrNotCopied = { "dn": 1, "whenCreated": 1, "whenChanged": 1, "objectGU
# mandatory to replace them otherwise the provision will be broken somehow.
hashOverwrittenAtt = { "prefixMap": replace, "systemMayContain": replace, "systemOnly":replace, "searchFlags":replace,
"mayContain":replace, "systemFlags":replace, "description":replace,
- "oEMInformation":replace, "operatingSystemVersion":replace, "adminPropertyPages":replace,
+ "oEMInformation":never, "operatingSystemVersion":replace, "adminPropertyPages":replace,
"defaultSecurityDescriptor": replace, "wellKnownObjects":replace, "privilege":delete, "groupType":replace,
"rIDAvailablePool": never}
@@ -885,6 +885,18 @@ def update_gpo(paths,creds,session,names):
samdb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp)
set_gpo_acl(path.sysvol,names.dnsdomain,names.domainsid,names.domaindn,samdb,lp)
+def updateOEMInfo(paths,creds,session,names):
+ sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp, options=["modules:samba_dsdb"])
+ res = sam_ldb.search(expression="(objectClass=*)",base=str(names.rootdn),
+ scope=SCOPE_BASE, attrs=["dn","oEMInformation"])
+ if len(res) > 0:
+ info = res[0]["oEMInformation"]
+ info = "%s, upgrade to %s"%(info,version)
+ delta = Message()
+ delta.dn = Dn(sam_ldb,str(res[0]["dn"]))
+ descr = get_schema_descriptor(names.domainsid)
+ delta["oEMInformation"] = MessageElement(info, FLAG_MOD_REPLACE, "oEMInformation" )
+ sam_ldb.modify(delta)
def setup_path(file):
@@ -928,6 +940,7 @@ if __name__ == '__main__':
update_sd(paths, creds, session,names)
update_sd(paths, creds, admin_session_info, names)
check_updated_sd(newpaths, paths, creds, session, names)
+ updateOEMInfo(paths,creds,session,names)
message(SIMPLE, "Upgrade finished !")
# remove reference provision now that everything is done !
shutil.rmtree(provisiondir)