mirror of https://github.com/borgbackup/borg.git
FreeBSD: simplify numeric_ids check
This commit is contained in:
parent
7df170c946
commit
4ebb5cdf3c
|
@ -170,11 +170,12 @@ def acl_get(path, item, st, numeric_ids=False, fd=None):
|
||||||
cdef _set_acl(path, type, item, attribute, numeric_ids=False, fd=None):
|
cdef _set_acl(path, type, item, attribute, numeric_ids=False, fd=None):
|
||||||
cdef acl_t acl = NULL
|
cdef acl_t acl = NULL
|
||||||
text = item.get(attribute)
|
text = item.get(attribute)
|
||||||
if text is not None:
|
if text:
|
||||||
if numeric_ids and type == ACL_TYPE_NFS4:
|
if numeric_ids:
|
||||||
text = _nfs4_use_stored_uid_gid(text)
|
if type == ACL_TYPE_NFS4:
|
||||||
elif numeric_ids and type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT):
|
text = _nfs4_use_stored_uid_gid(text)
|
||||||
text = posix_acl_use_stored_uid_gid(text)
|
elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT):
|
||||||
|
text = posix_acl_use_stored_uid_gid(text)
|
||||||
acl = acl_from_text(<bytes>text)
|
acl = acl_from_text(<bytes>text)
|
||||||
if acl == NULL:
|
if acl == NULL:
|
||||||
raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path))
|
raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path))
|
||||||
|
|
Loading…
Reference in New Issue