+2025-01-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ file-has-acl: port to Linux 6.12 + NFS listxattr
+ * lib/file-has-acl.c (get_aclinfo): Try the getxattr-related calls
+ even if [l]listxattr fails with EACCES. Problem reported by
+ Pádraig Brady <https://bugs.gnu.org/74692#25>. Also, treat E2BIG
+ like EACCES.
+
2025-01-08 Paul Eggert <eggert@cs.ucla.edu>
fcntl-h: port better to musl on GNU/Linux
}
}
- if (0 < ai->size && flags & ACL_GET_SCONTEXT)
+ /* A security context can exist only if extended attributes do: i.e.,
+ [l]listxattr either returned a positive number, or failed with E2BIG,
+ or failed with EACCES which in Linux kernel 6.12 NFS can mean merely
+ that we lack read access. */
+ if (flags & ACL_GET_SCONTEXT
+ && (0 < ai->size
+ || (ai->size < 0 && (ai->u.err == E2BIG || ai->u.err == EACCES))))
{
if (is_smack_enabled ())
{
- if (aclinfo_has_xattr (ai, XATTR_NAME_SMACK))
+ if (ai->size < 0 || aclinfo_has_xattr (ai, XATTR_NAME_SMACK))
{
ssize_t r = smack_new_label_from_path (name, "security.SMACK64",
flags & ACL_SYMLINK_FOLLOW,
else
{
# if USE_SELINUX_SELINUX_H
- if (aclinfo_has_xattr (ai, XATTR_NAME_SELINUX))
+ if (ai->size < 0 || aclinfo_has_xattr (ai, XATTR_NAME_SELINUX))
{
ssize_t r =
((flags & ACL_SYMLINK_FOLLOW ? getfilecon : lgetfilecon)