acl: Fix a test failure on IRIX 6.5 with NFS.
[gnulib.git] / lib / copy-acl.c
index 030c4bf..1532cb8 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