summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-11-05 20:44:14 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-11-06 00:12:43 +0100
commitab30a8bf0fb9bd4ee3c907183132f3b9abb67c7a (patch)
treea207980788d14864f62b9f4805495912f857af19
parent033451587db21d6e4b829e89a64f894a32682131 (diff)
downloadsamba-ab30a8bf0fb9bd4ee3c907183132f3b9abb67c7a.tar.gz
samba-ab30a8bf0fb9bd4ee3c907183132f3b9abb67c7a.tar.bz2
samba-ab30a8bf0fb9bd4ee3c907183132f3b9abb67c7a.zip
provision: Make dsacl2fsacl() take a security.dom_sid, not str
Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Nov 6 00:12:43 CET 2012 on sn-devel-104
-rw-r--r--source4/scripting/python/samba/netcmd/gpo.py4
-rw-r--r--source4/scripting/python/samba/ntacls.py3
-rw-r--r--source4/scripting/python/samba/provision/__init__.py4
3 files changed, 5 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/netcmd/gpo.py b/source4/scripting/python/samba/netcmd/gpo.py
index 53bfcaaa26..347231b523 100644
--- a/source4/scripting/python/samba/netcmd/gpo.py
+++ b/source4/scripting/python/samba/netcmd/gpo.py
@@ -975,9 +975,9 @@ class cmd_create(Command):
ds_sd = ndr_unpack(security.descriptor, ds_sd_ndr).as_sddl()
# Create a file system security descriptor
- domain_sid = self.samdb.get_domain_sid()
+ domain_sid = security.dom_sid(self.samdb.get_domain_sid())
sddl = dsacl2fsacl(ds_sd, domain_sid)
- fs_sd = security.descriptor.from_sddl(sddl, security.dom_sid(domain_sid))
+ fs_sd = security.descriptor.from_sddl(sddl, domain_sid)
# Set ACL
sio = ( security.SECINFO_OWNER |
diff --git a/source4/scripting/python/samba/ntacls.py b/source4/scripting/python/samba/ntacls.py
index f3040472df..89d450a1f1 100644
--- a/source4/scripting/python/samba/ntacls.py
+++ b/source4/scripting/python/samba/ntacls.py
@@ -198,14 +198,13 @@ def ldapmask2filemask(ldm):
return filemask
-def dsacl2fsacl(dssddl, domsid):
+def dsacl2fsacl(dssddl, sid):
"""
This function takes an the SDDL representation of a DS
ACL and return the SDDL representation of this ACL adapted
for files. It's used for Policy object provision
"""
- sid = security.dom_sid(domsid)
ref = security.descriptor.from_sddl(dssddl, sid)
fdescr = security.descriptor()
fdescr.owner_sid = ref.owner_sid
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index ba50ff30e6..47bc6f92d8 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -1395,7 +1395,7 @@ def set_gpos_acl(sysvol, dnsdomain, domainsid, domaindn, samdb, lp, use_ntvfs, p
acl = ndr_unpack(security.descriptor,
str(policy["nTSecurityDescriptor"])).as_sddl()
policy_path = getpolicypath(sysvol, dnsdomain, str(policy["cn"]))
- set_dir_acl(policy_path, dsacl2fsacl(acl, str(domainsid)), lp,
+ set_dir_acl(policy_path, dsacl2fsacl(acl, domainsid), lp,
str(domainsid), use_ntvfs,
passdb=passdb)
@@ -1522,7 +1522,7 @@ def check_gpos_acl(sysvol, dnsdomain, domainsid, domaindn, samdb, lp,
acl = ndr_unpack(security.descriptor,
str(policy["nTSecurityDescriptor"])).as_sddl()
policy_path = getpolicypath(sysvol, dnsdomain, str(policy["cn"]))
- check_dir_acl(policy_path, dsacl2fsacl(acl, str(domainsid)), lp,
+ check_dir_acl(policy_path, dsacl2fsacl(acl, domainsid), lp,
domainsid, direct_db_access)