From ca156dd87d41d9dbd0eb90f4d8b7a2a73c78a47e Mon Sep 17 00:00:00 2001 From: Ben Walton Date: Fri, 12 Feb 2010 08:32:00 -0500 Subject: [PATCH] copy-acl: enhance Solaris ACL error handling Gracefully handle EOPNOTSUPP in qcopy_acl and qset_acl. These functions, as used in coreutils, were causing the test suite to fail on Solaris 8 i386 with ZFS-backed NFSv3 mounts. The failures included errors such as: FAIL: cp/backup-dir cp: preserving permissions for `y/x': Operation not supported on transport endpoint * lib/copy-acl.c (qcopy_acl): Also ignore EOPNOTSUPP. * lib/set-mode-acl.c (qset_acl): Likewise. Signed-off-by: Ben Walton Signed-off-by: Eric Blake --- ChangeLog | 6 ++++++ lib/copy-acl.c | 5 +++-- lib/set-mode-acl.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28c48ae6a..f6d7e6449 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-02 Ben Walton (tiny change) + + copy-acl: enhance Solaris ACL error handling + * lib/copy-acl.c (qcopy_acl): Also ignore EOPNOTSUPP. + * lib/set-mode-acl.c (qset_acl): Likewise. + 2010-03-02 Bruno Haible spawn: Don't override the system defined values on FreeBSD 8. diff --git a/lib/copy-acl.c b/lib/copy-acl.c index 1e822408e..c047913d4 100644 --- a/lib/copy-acl.c +++ b/lib/copy-acl.c @@ -294,7 +294,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name, if (count < 0) { - if (errno == ENOSYS || errno == ENOTSUP) + if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) { count = 0; entries = NULL; @@ -358,7 +358,8 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name, if (ret < 0 && saved_errno == 0) { saved_errno = errno; - if (errno == ENOSYS && !acl_nontrivial (count, entries)) + if ((errno == ENOSYS || errno == EOPNOTSUPP) + && !acl_nontrivial (count, entries)) saved_errno = 0; } else diff --git a/lib/set-mode-acl.c b/lib/set-mode-acl.c index c5b4726e2..2cd2c75f3 100644 --- a/lib/set-mode-acl.c +++ b/lib/set-mode-acl.c @@ -387,7 +387,7 @@ qset_acl (char const *name, int desc, mode_t mode) ret = acl (name, SETACL, sizeof (entries) / sizeof (aclent_t), entries); if (ret < 0) { - if (errno == ENOSYS) + if (errno == ENOSYS || errno == EOPNOTSUPP) return chmod_or_fchmod (name, desc, mode); return -1; } -- 2.11.0