summaryrefslogtreecommitdiff
path: root/source4/scripting/bin
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-03-28 22:58:36 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-03-28 22:58:36 +0200
commitba74823c8f42dd3f4f0883163e42888ec35baf32 (patch)
tree338302efb1368e3309e5db5394d8dbd398e5e1df /source4/scripting/bin
parentd18d7cfa27a3f2a088c8f3ea9de4f9d8d89fea38 (diff)
downloadsamba-ba74823c8f42dd3f4f0883163e42888ec35baf32.tar.gz
samba-ba74823c8f42dd3f4f0883163e42888ec35baf32.tar.bz2
samba-ba74823c8f42dd3f4f0883163e42888ec35baf32.zip
upgradeprovision: Fix formatting, syntax error.
Diffstat (limited to 'source4/scripting/bin')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision37
1 files changed, 20 insertions, 17 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index bdc58c3f59..8f01bd3bf0 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -41,7 +41,7 @@ from ldb import SCOPE_SUBTREE, SCOPE_BASE, \
from samba import param
from samba import glue
from samba.misc import messageEltFlagToString
-from samba.provision import find_setup_dir, get_domain_descriptor, get_config_descriptor, secretsdb_self_join,set_gpo_acl,getpolicypath,create_gpo_struct
+from samba.provision import find_setup_dir, get_domain_descriptor, get_config_descriptor, secretsdb_self_join,set_gpo_acl,getpolicypath,create_gpo_struct
from samba.provisionexceptions import ProvisioningError
from samba.schema import get_linked_attributes, Schema, get_schema_descriptor
from samba.dcerpc import security
@@ -871,22 +871,24 @@ def update_machine_account_password(paths, creds, session, names):
def update_gpo(paths,creds,session,names):
- """Create missing GPO file object if needed
+ """Create missing GPO file object if needed
- Set ACL correctly also.
- """
- dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid)
- if not os.path.isdir(dir):
- create_gpo_struct(dir)
-
- dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid_dc)
- if not os.path.isdir(dir):
- create_gpo_struct(dir)
- 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"])
+ Set ACL correctly also.
+ """
+ dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid)
+ if not os.path.isdir(dir):
+ create_gpo_struct(dir)
+
+ dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid_dc)
+ if not os.path.isdir(dir):
+ create_gpo_struct(dir)
+ samdb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp)
+ set_gpo_acl(paths.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:
@@ -895,7 +897,8 @@ def updateOEMInfo(paths,creds,session,names):
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" )
+ delta["oEMInformation"] = MessageElement(info, FLAG_MOD_REPLACE,
+ "oEMInformation" )
sam_ldb.modify(delta)