From: Pádraig Brady Date: Wed, 15 Jan 2025 23:30:24 +0000 (+0000) Subject: file-has-acl: handle listxattr returning ENOTSUP X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=caf768863e2a411ede373164e861b0bf6b707bcc;p=gnulib.git file-has-acl: handle listxattr returning ENOTSUP listxattr() was seen to return ENOTSUP on virtiofs, which resulted in ls outputting "Not supported" errors. * lib/file-has-acl.c (aclinfo_may_indicate_xattr): Treat any non valid acl errno as being inconclusive as to whether there are xattrs available. --- diff --git a/ChangeLog b/ChangeLog index b195f7f80b..4fd072f1a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-01-15 Pádraig Brady + + file-has-acl: handle listxattr returning ENOTSUP + listxattr() was seen to return ENOTSUP on virtiofs, + which resulted in ls outputting "Not supported" errors. + * lib/file-has-acl.c (aclinfo_may_indicate_xattr): Treat any + non valid acl errno as being inconclusive as to whether there + are xattrs available. + 2025-01-15 Collin Funk libgmp-mpz: Respect Automake's silent-rules. diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index e8413f8f85..c02cfee842 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -101,14 +101,15 @@ enum { /* AI indicates XATTR may be present but wasn't accessible. This is the case when [l]listxattr failed with E2BIG, - or failed with EACCES which in Linux kernel 6.12 NFS can mean merely - that we lack read access. + or is not supported (!acl_errno_valid()), or failed with EACCES + which in Linux kernel 6.12 NFS can mean merely that we lack read access. */ static bool aclinfo_may_indicate_xattr (struct aclinfo const *ai) { - return ai->size < 0 && (ai->u.err == EACCES || ai->u.err == E2BIG); + return ai->size < 0 && (!acl_errno_valid (ai->u.err) + || ai->u.err == EACCES || ai->u.err == E2BIG); } /* Does NAME have XATTR? */