changeset 14904:812be65b0e8b

acl: Complete the 2010-08-10 fix. * lib/file-has-acl.c (file_has_acl) [HP-UX]: Also test against ENOTSUP. * lib/set-mode-acl.c (qset_acl) [HP-UX]: Likewise. * lib/copy-acl.c (qcopy_acl) [HP-UX]: Test for the errno values explicitly. * tests/test-sameacls.c (main) [HP-UX]: Also test against ENOTSUP. Reported in <http://debbugs.gnu.org/db/60/6053.html>.
author Bruno Haible <bruno@clisp.org>
date Mon, 13 Jun 2011 01:17:20 +0200
parents 303d327ef73f
children a9b67d6b93df
files ChangeLog lib/copy-acl.c lib/file-has-acl.c lib/set-mode-acl.c tests/test-sameacls.c
diffstat 5 files changed, 26 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-06-12  Bruno Haible  <bruno@clisp.org>
+
+	acl: Complete the 2010-08-10 fix.
+	* lib/file-has-acl.c (file_has_acl) [HP-UX]: Also test against ENOTSUP.
+	* lib/set-mode-acl.c (qset_acl) [HP-UX]: Likewise.
+	* lib/copy-acl.c (qcopy_acl) [HP-UX]: Test for the errno values
+	explicitly.
+	* tests/test-sameacls.c (main) [HP-UX]: Also test against ENOTSUP.
+	Reported in <http://debbugs.gnu.org/db/60/6053.html>.
+
 2011-06-12  Bruno Haible  <bruno@clisp.org>
 
 	spawn-pipe tests: Comments.
--- a/lib/copy-acl.c
+++ b/lib/copy-acl.c
@@ -420,7 +420,7 @@
 
       if (count < 0)
         {
-          if (ACL_NOT_WELL_SUPPORTED (errno))
+          if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
             {
               count = 0;
               break;
@@ -455,7 +455,7 @@
     {
       int saved_errno = errno;
 
-      if (ACL_NOT_WELL_SUPPORTED (errno))
+      if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
         {
           struct stat source_statbuf;
 
--- a/lib/file-has-acl.c
+++ b/lib/file-has-acl.c
@@ -527,7 +527,15 @@
           count = getacl (name, 0, NULL);
 
           if (count < 0)
-            return (errno == ENOSYS || errno == EOPNOTSUPP ? 0 : -1);
+            {
+              /* ENOSYS is seen on newer HP-UX versions.
+                 EOPNOTSUPP is typically seen on NFS mounts.
+                 ENOTSUP was seen on Quantum StorNext file systems (cvfs).  */
+              if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
+                return 0;
+              else
+                return -1;
+            }
 
           if (count == 0)
             return 0;
--- a/lib/set-mode-acl.c
+++ b/lib/set-mode-acl.c
@@ -432,7 +432,7 @@
     ret = setacl (name, sizeof (entries) / sizeof (struct acl_entry), entries);
   if (ret < 0)
     {
-      if (errno == ENOSYS || errno == EOPNOTSUPP)
+      if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
         return chmod_or_fchmod (name, desc, mode);
       return -1;
     }
--- a/tests/test-sameacls.c
+++ b/tests/test-sameacls.c
@@ -360,10 +360,12 @@
   int count2;
 
   count1 = getacl (file1, 0, NULL);
-  if (count1 < 0 && (errno == ENOSYS || errno == EOPNOTSUPP))
+  if (count1 < 0
+      && (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP))
     count1 = 0;
   count2 = getacl (file2, 0, NULL);
-  if (count2 < 0 && (errno == ENOSYS || errno == EOPNOTSUPP))
+  if (count2 < 0
+      && (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP))
     count2 = 0;
 
   if (count1 < 0)