]> Savannah Git Hosting - gnulib.git/commitdiff
file-has-acl: handle listxattr returning ENOTSUP
authorPádraig Brady <P@draigBrady.com>
Wed, 15 Jan 2025 23:30:24 +0000 (23:30 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 18 Jan 2025 08:16:58 +0000 (09:16 +0100)
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.

ChangeLog
lib/file-has-acl.c

index 0c3047361bef9a340a1d45bb60b2791bc7ee55a8..eb40d0d685f4a4d1bf4a61a800d016cbb7ece305 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-01-15  Pádraig Brady  <P@draigBrady.com>
+
+       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-14  Bruno Haible  <bruno@clisp.org>
 
        assert-h: Fix compilation error with gcc >= 13 on Solaris 11.
index e8413f8f85f928cff19f757c64e0592d67e25c9a..c02cfee842bf5f7f847d641d28a4081b4e0f1aa3 100644 (file)
@@ -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?  */