]> Savannah Git Hosting - gnulib.git/commitdiff
acl: Fix a test failure on IRIX 6.5 with NFS.
authorBruno Haible <bruno@clisp.org>
Tue, 6 Sep 2011 08:38:52 +0000 (10:38 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 6 Sep 2011 08:38:52 +0000 (10:38 +0200)
* lib/acl-internal.h (MODE_INSIDE_ACL): Define to 0 on IRIX.
* lib/set-mode-acl.c (qset_acl): Test !HAVE_ACL_TYPE_EXTENDED instead
of MODE_INSIDE_ACL. If !MODE_INSIDE_ACL, do a chmod_or_fchmod always.
* lib/copy-acl.c (qcopy_acl): Likewise.

ChangeLog
lib/acl-internal.h
lib/copy-acl.c
lib/set-mode-acl.c

index 00576191bf03e138610d6ede28693353bfcfa54c..01a68e888008a5238c94aae712488b98dd3d0fc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-06  Bruno Haible  <bruno@clisp.org>
+
+       acl: Fix a test failure on IRIX 6.5 with NFS.
+       * lib/acl-internal.h (MODE_INSIDE_ACL): Define to 0 on IRIX.
+       * lib/set-mode-acl.c (qset_acl): Test !HAVE_ACL_TYPE_EXTENDED instead
+       of MODE_INSIDE_ACL. If !MODE_INSIDE_ACL, do a chmod_or_fchmod always.
+       * lib/copy-acl.c (qcopy_acl): Likewise.
+
 2011-09-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        openat: port to AIX 7.1 with large files
index aade05570acc666227e8ad9239fdfe943cb9cca5..4f7166e4e967aced13d1327f0dd865dfdf84bf10 100644 (file)
@@ -146,7 +146,7 @@ rpl_acl_set_fd (int fd, acl_t acl)
 
 /* Set to 1 if a file's mode is implicit by the ACL.
    Set to 0 if a file's mode is stored independently from the ACL.  */
-#  if HAVE_ACL_COPY_EXT_NATIVE && HAVE_ACL_CREATE_ENTRY_NP /* MacOS X */
+#  if (HAVE_ACL_COPY_EXT_NATIVE && HAVE_ACL_CREATE_ENTRY_NP) || defined __sgi /* MacOS X, IRIX */
 #   define MODE_INSIDE_ACL 0
 #  else
 #   define MODE_INSIDE_ACL 1
index 030c4bfc98559805ffd2ecf576c0b110f8bf31f0..1532cb81a73cc979b0e3196cc61face191eae58c 100644 (file)
@@ -45,7 +45,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name,
 #if USE_ACL && HAVE_ACL_GET_FILE
   /* POSIX 1003.1e (draft 17 -- abandoned) specific version.  */
   /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */
-# if MODE_INSIDE_ACL
+# if !HAVE_ACL_TYPE_EXTENDED
   /* Linux, FreeBSD, IRIX, Tru64 */
 
   acl_t acl;
@@ -87,7 +87,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name,
   else
     acl_free (acl);
 
-  if (mode & (S_ISUID | S_ISGID | S_ISVTX))
+  if (!MODE_INSIDE_ACL || (mode & (S_ISUID | S_ISGID | S_ISVTX)))
     {
       /* We did not call chmod so far, and either the mode and the ACL are
          separate or special bits are to be set which don't fit into ACLs.  */
@@ -115,13 +115,9 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name,
     }
   return 0;
 
-# else /* !MODE_INSIDE_ACL */
+# else /* HAVE_ACL_TYPE_EXTENDED */
   /* MacOS X */
 
-#  if !HAVE_ACL_TYPE_EXTENDED
-#   error Must have ACL_TYPE_EXTENDED
-#  endif
-
   /* On MacOS X,  acl_get_file (name, ACL_TYPE_ACCESS)
      and          acl_get_file (name, ACL_TYPE_DEFAULT)
      always return NULL / EINVAL.  You have to use
index 7e12d571e14c3dc50a7ef7ad0e5bab711fd6d63e..3954c297af0cc4d417860ac8dcff53068bb5513c 100644 (file)
@@ -57,7 +57,7 @@ qset_acl (char const *name, int desc, mode_t mode)
 # if HAVE_ACL_GET_FILE
   /* POSIX 1003.1e draft 17 (abandoned) specific version.  */
   /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */
-#  if MODE_INSIDE_ACL
+#  if !HAVE_ACL_TYPE_EXTENDED
   /* Linux, FreeBSD, IRIX, Tru64 */
 
   /* We must also have acl_from_text and acl_delete_def_file.
@@ -132,21 +132,17 @@ qset_acl (char const *name, int desc, mode_t mode)
   if (S_ISDIR (mode) && acl_delete_def_file (name))
     return -1;
 
-  if (mode & (S_ISUID | S_ISGID | S_ISVTX))
+  if (!MODE_INSIDE_ACL || (mode & (S_ISUID | S_ISGID | S_ISVTX)))
     {
-      /* We did not call chmod so far, so the special bits have not yet
-         been set.  */
+      /* We did not call chmod so far, and either the mode and the ACL are
+         separate or special bits are to be set which don't fit into ACLs.  */
       return chmod_or_fchmod (name, desc, mode);
     }
   return 0;
 
-#  else /* !MODE_INSIDE_ACL */
+#  else /* HAVE_ACL_TYPE_EXTENDED */
   /* MacOS X */
 
-#   if !HAVE_ACL_TYPE_EXTENDED
-#    error Must have ACL_TYPE_EXTENDED
-#   endif
-
   /* On MacOS X,  acl_get_file (name, ACL_TYPE_ACCESS)
      and          acl_get_file (name, ACL_TYPE_DEFAULT)
      always return NULL / EINVAL.  You have to use