bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] copy-acl: ignore ENOTSUP on HP-UX


From: Eric Blake
Subject: [PATCH] copy-acl: ignore ENOTSUP on HP-UX
Date: Mon, 9 Aug 2010 13:52:49 -0600

From: Pádraig Brady <address@hidden>

Fixes Coreutils bug 6053.

* lib/acl-internal.h (ACL_NOT_WELL_SUPPORTED): Move definition up,
so that it is available for HP-UX.
* lib/copy-acl.c (qcopy_acl): Use it.
Reported by Patrick M. Callahan.

Signed-off-by: Eric Blake <address@hidden>
---

I think this one should do it.

 ChangeLog          |    9 +++++++++
 lib/acl-internal.h |   23 ++++++++++++-----------
 lib/copy-acl.c     |    4 ++--
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d811718..37a822e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-09  Pádraig Brady <address@hidden>
+       and Eric Blake  <address@hidden>
+
+       copy-acl: ignore ENOTSUP on HP-UX
+       * lib/acl-internal.h (ACL_NOT_WELL_SUPPORTED): Move definition up,
+       so that it is available for HP-UX.
+       * lib/copy-acl.c (qcopy_acl): Use it.
+       Reported by Patrick M. Callahan.
+
 2010-08-09  Eric Blake  <address@hidden>

        readlinkat: adjust client modules
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 676e57a..7f9cde1 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -51,6 +51,18 @@
 # define fchmod(fd, mode) (-1)
 #endif

+/* Recognize some common errors such as from an NFS mount that does
+   not support ACLs, even when local drives do.  */
+#if defined __APPLE__ && defined __MACH__ /* MacOS X */
+# define ACL_NOT_WELL_SUPPORTED(Err) \
+     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY 
|| (Err) == ENOENT)
+#elif defined EOPNOTSUPP /* Tru64 NFS */
+# define ACL_NOT_WELL_SUPPORTED(Err) \
+     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY 
|| (Err) == EOPNOTSUPP)
+#else
+# define ACL_NOT_WELL_SUPPORTED(Err) \
+     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
+#endif

 #if USE_ACL

@@ -125,17 +137,6 @@ rpl_acl_set_fd (int fd, acl_t acl)
 #   define MODE_INSIDE_ACL 1
 #  endif

-#  if defined __APPLE__ && defined __MACH__ /* MacOS X */
-#   define ACL_NOT_WELL_SUPPORTED(Err) \
-     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY 
|| (Err) == ENOENT)
-#  elif defined EOPNOTSUPP /* Tru64 NFS */
-#   define ACL_NOT_WELL_SUPPORTED(Err) \
-     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY 
|| (Err) == EOPNOTSUPP)
-#  else
-#   define ACL_NOT_WELL_SUPPORTED(Err) \
-     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
-#  endif
-
 /* Return the number of entries in ACL.
    Return -1 and set errno upon failure to determine it.  */
 /* Define a replacement for acl_entries if needed. (Only Linux has it.)  */
diff --git a/lib/copy-acl.c b/lib/copy-acl.c
index c047913..421907d 100644
--- a/lib/copy-acl.c
+++ b/lib/copy-acl.c
@@ -420,7 +420,7 @@ qcopy_acl (const char *src_name, int source_desc, const 
char *dst_name,

       if (count < 0)
         {
-          if (errno == ENOSYS || errno == EOPNOTSUPP)
+          if (ACL_NOT_WELL_SUPPORTED (errno))
             {
               count = 0;
               break;
@@ -455,7 +455,7 @@ qcopy_acl (const char *src_name, int source_desc, const 
char *dst_name,
     {
       int saved_errno = errno;

-      if (errno == ENOSYS || errno == EOPNOTSUPP)
+      if (ACL_NOT_WELL_SUPPORTED (errno))
         {
           struct stat source_statbuf;

-- 
1.7.2.1




reply via email to

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