bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix NFSv4 acl detection on F39


From: Ondrej Valousek
Subject: [PATCH] fix NFSv4 acl detection on F39
Date: Fri, 28 Apr 2023 22:38:45 +0200

On newer systems like Fedora 39, we can't distinguish from the 
getxattr(,XATTR_NAME_POSIX_ACL_*,,)
which filesystem we are on. The call return either success or ENODATA.
It never returns ENOTSUP as previously. Is it intentional?
This unfortunately means that we have to check for NFSv4 ACLs all the time which
makes it slightly more expensive (one more getxattr call needed)

---
 lib/file-has-acl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c
index b31a2ea252..653b55f0fd 100644
--- a/lib/file-has-acl.c
+++ b/lib/file-has-acl.c
@@ -157,8 +157,10 @@ file_has_acl (char const *name, struct stat const *sb)
             return 1;
         }
 
-      if (ret < 0)
+      if (ret <= 0)
         {
+          /* On newer systems, the two previous getxattr() calls do not tell
+             us if we are on NFS/NFSv4 or local FS :( */
           /* Check for NFSv4 ACLs.  The max length of a trivial
              ACL is 6 words for owner, 6 for group, 7 for everyone,
              all times 2 because there are both allow and deny ACEs.
-- 
2.40.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]