diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-06-10 23:12:53 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-06-11 01:47:55 +0200 |
commit | c446fbc3bfa345c8bc748a162dedb24857272aab (patch) | |
tree | 4abfb08ff2c994045de37896f2d2666adedf4ef3 /source4/scripting/python/samba/ntacls.py | |
parent | a53ca944163f5366493b4c36ed94fd9f92e86238 (diff) | |
download | samba-c446fbc3bfa345c8bc748a162dedb24857272aab.tar.gz samba-c446fbc3bfa345c8bc748a162dedb24857272aab.tar.bz2 samba-c446fbc3bfa345c8bc748a162dedb24857272aab.zip |
s4-python: Fix formatting.
Diffstat (limited to 'source4/scripting/python/samba/ntacls.py')
-rw-r--r-- | source4/scripting/python/samba/ntacls.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/ntacls.py b/source4/scripting/python/samba/ntacls.py index 478a5125bf..cfdb2621c4 100644 --- a/source4/scripting/python/samba/ntacls.py +++ b/source4/scripting/python/samba/ntacls.py @@ -30,7 +30,7 @@ class XattrBackendError(Exception): def checkset_backend(lp, backend, eadbfile): if backend is not None: if backend == "native": - lp.set("posix:eadb","") + lp.set("posix:eadb", "") elif backend == "tdb": if eadbfile != None: lp.set("posix:eadb", eadbfile) @@ -56,9 +56,10 @@ def getntacl(lp, file, backend=None, eadbfile=None): else: attribute = samba.xattr_native.wrap_getxattr(file, xattr.XATTR_NTACL_NAME) - ntacl = ndr_unpack(xattr.NTACL,attribute) + ntacl = ndr_unpack(xattr.NTACL, attribute) return ntacl + def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None): checkset_backend(lp, backend, eadbfile) ntacl = xattr.NTACL() @@ -70,17 +71,21 @@ def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None): if eadbname is not None and eadbname != "": try: samba.xattr_tdb.wrap_setxattr(eadbname, - file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl)) + file, xattr.XATTR_NTACL_NAME, ndr_pack(ntacl)) except: # FIXME: Don't catch all exceptions, just those related to opening # xattrdb - print "Fail to open %s"%eadbname - samba.xattr_native.wrap_setxattr(file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl)) + print "Fail to open %s" % eadbname + samba.xattr_native.wrap_setxattr(file, xattr.XATTR_NTACL_NAME, + ndr_pack(ntacl)) else: - samba.xattr_native.wrap_setxattr(file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl)) + samba.xattr_native.wrap_setxattr(file, xattr.XATTR_NTACL_NAME, + ndr_pack(ntacl)) + def ldapmask2filemask(ldm): - """Takes the access mask of a DS ACE and transform them in a File ACE mask""" + """Takes the access mask of a DS ACE and transform them in a File ACE mask. + """ RIGHT_DS_CREATE_CHILD = 0x00000001 RIGHT_DS_DELETE_CHILD = 0x00000002 RIGHT_DS_LIST_CONTENTS = 0x00000004 @@ -141,7 +146,7 @@ def dsacl2fsacl(dssddl, domsid): for files. It's used for Policy object provision """ sid = security.dom_sid(domsid) - ref = security.descriptor.from_sddl(dssddl,sid) + ref = security.descriptor.from_sddl(dssddl, sid) fdescr = security.descriptor() fdescr.owner_sid = ref.owner_sid fdescr.group_sid = ref.group_sid |