From: Joe Guo Date: Mon, 2 Jul 2018 22:20:39 +0000 (+1200) Subject: ntacls: reuse predefined SECURITY_SECINFO_FLAGS X-Git-Tag: tdb-1.3.16~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2e6dd9d865b97bd5c574181f02208b79c895006;p=thirdparty%2Fsamba.git ntacls: reuse predefined SECURITY_SECINFO_FLAGS Use predefined SECURITY_SECINFO_FLAGS to replace bitwise or operations on flag list. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13521 Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/python/samba/ntacls.py b/python/samba/ntacls.py index e5178115f66..dee906acd21 100644 --- a/python/samba/ntacls.py +++ b/python/samba/ntacls.py @@ -114,7 +114,7 @@ def getntacl(lp, file, backend=None, eadbfile=None, direct_db_access=True, servi elif ntacl.version == 4: return ntacl.info.sd else: - return smbd.get_nt_acl(file, security.SECINFO_OWNER | security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, service=service) + return smbd.get_nt_acl(file, SECURITY_SECINFO_FLAGS, service=service) def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None, use_ntvfs=True, skip_invalid_chown=False, passdb=None, service=None): @@ -150,7 +150,7 @@ def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None, use_ntvfs=True sd2 = sd sd2.owner_sid = administrator - smbd.set_nt_acl(file, security.SECINFO_OWNER |security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, sd2, service=service) + smbd.set_nt_acl(file, SECURITY_SECINFO_FLAGS, sd2, service=service) # and then set an NTVFS ACL (which does not set the posix ACL) to pretend the owner really was set use_ntvfs = True @@ -184,7 +184,7 @@ def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None, use_ntvfs=True samba.xattr_native.wrap_setxattr(file, xattr.XATTR_NTACL_NAME, ndr_pack(ntacl)) else: - smbd.set_nt_acl(file, security.SECINFO_OWNER | security.SECINFO_GROUP | security.SECINFO_DACL | security.SECINFO_SACL, sd, service=service) + smbd.set_nt_acl(file, SECURITY_SECINFO_FLAGS, sd, service=service) def ldapmask2filemask(ldm):