aboutsummaryrefslogtreecommitdiffstats
path: root/lib/qcopy-acl.c
diff options
context:
space:
mode:
authorPaul Eggert2024-07-15 19:03:17 -0700
committerPaul Eggert2024-07-16 15:37:18 -0700
commitf5dbdedcc53d2c57b9ddecbe9248c90ef0fa08d6 (patch)
treef839c5fb8a24a52ffb3eca7c80cffb0d8579aa43 /lib/qcopy-acl.c
parentfd8bdedde9655f04c03eb04af09f73ee77600f53 (diff)
downloademacs-f5dbdedcc53d2c57b9ddecbe9248c90ef0fa08d6.tar.gz
emacs-f5dbdedcc53d2c57b9ddecbe9248c90ef0fa08d6.zip
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'lib/qcopy-acl.c')
-rw-r--r--lib/qcopy-acl.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c
index dfc39cead05..877f42588b7 100644
--- a/lib/qcopy-acl.c
+++ b/lib/qcopy-acl.c
@@ -26,6 +26,20 @@
26#if USE_XATTR 26#if USE_XATTR
27 27
28# include <attr/libattr.h> 28# include <attr/libattr.h>
29# include <string.h>
30
31# if HAVE_LINUX_XATTR_H
32# include <linux/xattr.h>
33# endif
34# ifndef XATTR_NAME_NFSV4_ACL
35# define XATTR_NAME_NFSV4_ACL "system.nfs4_acl"
36# endif
37# ifndef XATTR_NAME_POSIX_ACL_ACCESS
38# define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access"
39# endif
40# ifndef XATTR_NAME_POSIX_ACL_DEFAULT
41# define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default"
42# endif
29 43
30/* Returns 1 if NAME is the name of an extended attribute that is related 44/* Returns 1 if NAME is the name of an extended attribute that is related
31 to permissions, i.e. ACLs. Returns 0 otherwise. */ 45 to permissions, i.e. ACLs. Returns 0 otherwise. */
@@ -33,7 +47,12 @@
33static int 47static int
34is_attr_permissions (const char *name, struct error_context *ctx) 48is_attr_permissions (const char *name, struct error_context *ctx)
35{ 49{
36 return attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS; 50 /* We need to explicitly test for the known extended attribute names,
51 because at least on CentOS 7, attr_copy_action does not do it. */
52 return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0
53 || strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0
54 || strcmp (name, XATTR_NAME_NFSV4_ACL) == 0
55 || attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
37} 56}
38 57
39#endif /* USE_XATTR */ 58#endif /* USE_XATTR */