diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-07-03 10:20:39 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-07-12 04:32:00 +0200 |
commit | e2e6dd9d865b97bd5c574181f02208b79c895006 (patch) | |
tree | f5002b028e51e42e8ec58f4768330c8052865dea | |
parent | c9876defe6c641adc9935d85fca50702974a14d6 (diff) | |
download | samba-e2e6dd9d865b97bd5c574181f02208b79c895006.tar.gz |
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 <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
-rw-r--r-- | python/samba/ntacls.py | 6 |
1 files changed, 3 insertions, 3 deletions
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): |