summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/ntacls.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-04-08 21:01:17 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-04-08 23:20:36 +0200
commitdd4ef4e106d372cfadf7b47db8bf9dc25728b3bc (patch)
treeb8c6633312ee59748fe11e665516c63969e15680 /source4/scripting/python/samba/ntacls.py
parenta35d876537eb301d75a254d9da97268d041da8d6 (diff)
downloadsamba-dd4ef4e106d372cfadf7b47db8bf9dc25728b3bc.tar.gz
samba-dd4ef4e106d372cfadf7b47db8bf9dc25728b3bc.tar.bz2
samba-dd4ef4e106d372cfadf7b47db8bf9dc25728b3bc.zip
s4-python: More cleanups.
Diffstat (limited to 'source4/scripting/python/samba/ntacls.py')
-rw-r--r--source4/scripting/python/samba/ntacls.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/source4/scripting/python/samba/ntacls.py b/source4/scripting/python/samba/ntacls.py
index edcd643b2a..16e9463f09 100644
--- a/source4/scripting/python/samba/ntacls.py
+++ b/source4/scripting/python/samba/ntacls.py
@@ -41,29 +41,37 @@ def checkset_backend(lp,backend,eadbfile):
def getntacl(lp, file, backend=None, eadbfile=None):
checkset_backend(lp, backend, eadbfile)
eadbname = lp.get("posix:eadb")
- if eadbname != None and eadbname != "" :
+ if eadbname is not None and eadbname != "":
try:
- attribute = samba.xattr_tdb.wrap_getxattr(eadbname,file,xattr.XATTR_NTACL_NAME)
+ attribute = samba.xattr_tdb.wrap_getxattr(eadbname, file,
+ xattr.XATTR_NTACL_NAME)
except:
+ # FIXME: Don't catch all exceptions, just those related to opening
+ # xattrdb
print "Fail to open %s" % eadbname
- attribute = samba.xattr_native.wrap_getxattr(file,xattr.XATTR_NTACL_NAME)
+ attribute = samba.xattr_native.wrap_getxattr(file,
+ xattr.XATTR_NTACL_NAME)
else:
- attribute = samba.xattr_native.wrap_getxattr(file,xattr.XATTR_NTACL_NAME)
+ attribute = samba.xattr_native.wrap_getxattr(file,
+ xattr.XATTR_NTACL_NAME)
ntacl = ndr_unpack(xattr.NTACL,attribute)
return ntacl
def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None):
- checkset_backend(lp,backend,eadbfile)
+ checkset_backend(lp, backend, eadbfile)
ntacl=xattr.NTACL()
ntacl.version = 1
sid=security.dom_sid(domsid)
sd = security.descriptor.from_sddl(sddl, sid)
ntacl.info = sd
eadbname = lp.get("posix:eadb")
- if eadbname != None and eadbname != "":
+ if eadbname is not None and eadbname != "":
try:
- samba.xattr_tdb.wrap_setxattr(eadbname,file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
+ samba.xattr_tdb.wrap_setxattr(eadbname,
+ 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))
else: