]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: use fewer xattr-related syscalls
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Sep 2024 05:04:02 +0000 (22:04 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Sep 2024 05:08:45 +0000 (22:08 -0700)
commit4ce432ad8738387f1b2e80e883dc7080df3afabe
treeab9aa68df947edf6d1da35cd3e8ef3d151167930
parent218001187b8b27213cdfd86b5286d4ee3d51ede5
ls: use fewer xattr-related syscalls

* src/ls.c: Do not include <selinux/selinux.h> or "smack.h".
Include <linux/attr.h> if HAVE_LINUX_ATTR_H, for XATTR_NAME_CAPS.
(free_ent): Use aclinfo_scontext_free to free f->scontext.
(getfilecon_cache): Remove; no longer needed.
(file_has_aclinfo_cache): Rename from file_has_acl_cache,
and use file_has_aclinfo instead of file_has_acl.  All uses changed.
(gobble_file): Use file_has_aclinfo instead of file_has_acl, so
that we get more info about the file before deciding whether to
issue further syscalls for it.  Let file_has_aclinfo worry about
smack and SELinux.  Call has_capability only if the xattr list
mentions XATTR_NAME_CAPS.
src/ls.c