mirror of
https://github.com/samba-team/samba.git
synced 2025-12-17 04:23:50 +03:00
python/ntacls.py: let SMBHelper.get_acl() use the default values of self.smb_conn.get_acl()
Now that self.smb_conn.get_acl() has sane default values for secinfo and access_mask we can remove any additional logic in SMBHelper. The resulting values are the same. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
@@ -49,12 +49,6 @@ SECURITY_SECINFO_FLAGS = security.SECINFO_OWNER | \
|
||||
security.SECINFO_DACL | \
|
||||
security.SECINFO_SACL
|
||||
|
||||
|
||||
# SEC_FLAG_SYSTEM_SECURITY is required otherwise get Access Denied
|
||||
SECURITY_SEC_FLAGS = security.SEC_FLAG_SYSTEM_SECURITY | \
|
||||
security.SEC_STD_READ_CONTROL
|
||||
|
||||
|
||||
class XattrBackendError(Exception):
|
||||
"""A generic xattr backend error."""
|
||||
|
||||
@@ -335,11 +329,13 @@ class SMBHelper:
|
||||
self.smb_conn = smb_conn
|
||||
self.dom_sid = dom_sid
|
||||
|
||||
def get_acl(self, smb_path, as_sddl=False):
|
||||
def get_acl(self, smb_path, as_sddl=False,
|
||||
sinfo=None, access_mask=None):
|
||||
assert '/' not in smb_path
|
||||
|
||||
ntacl_sd = self.smb_conn.get_acl(
|
||||
smb_path, SECURITY_SECINFO_FLAGS, SECURITY_SEC_FLAGS)
|
||||
ntacl_sd = self.smb_conn.get_acl(smb_path,
|
||||
sinfo=sinfo,
|
||||
access_mask=access_mask)
|
||||
|
||||
return ntacl_sd.as_sddl(self.dom_sid) if as_sddl else ntacl_sd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user