how to speed up the freebsd ACL code

This commit is contained in:
Thomas Waldmann 2025-11-04 17:42:38 +01:00
parent e385103a1b
commit 3419d93a17
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -147,6 +147,10 @@ def acl_get(path, item, st, numeric_ids=False, fd=None):
If `numeric_ids` is True the user/group field is not preserved only uid/gid
"""
cdef int flags = ACL_TEXT_APPEND_ID
# Note: likely this could be faster if we always used ACL_TEXT_NUMERIC_IDS,
# and then used uid2user() and gid2group() to translate the numeric ids to names
# inside borg (borg has a LRUcache for these lookups).
# See how the Linux implementation does it.
flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0
if isinstance(path, str):
path = os.fsencode(path)