]> Savannah Git Hosting - gnulib.git/commitdiff
acl: Fix a test failure on newer Solaris 10 with ZFS.
authorBruno Haible <bruno@clisp.org>
Tue, 6 Sep 2011 10:05:45 +0000 (12:05 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 6 Sep 2011 10:05:45 +0000 (12:05 +0200)
* tests/test-sameacls.c (main): Interpret acl GETACLCNT failure with
ENOSYS as no ACL.
Reported by Jim Meyering.

ChangeLog
tests/test-sameacls.c

index 5d5a4788d141a0baf9656c1436599c53710d1bae..176aff98bd168bf5ff883407e1356061b76d6a17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-06  Bruno Haible  <bruno@clisp.org>
+
+       acl: Fix a test failure on newer Solaris 10 with ZFS.
+       * tests/test-sameacls.c (main): Interpret acl GETACLCNT failure with
+       ENOSYS as no ACL.
+       Reported by Jim Meyering.
+
 2011-09-06  Bruno Haible  <bruno@clisp.org>
 
        acl: Update for AIX >= 5.3 with NFS.
index 848af20ec4bef5c90b1aecb462765be4435d0aed..421f841c8ed51e2846b9499c58177a8a53d9d4be 100644 (file)
@@ -227,7 +227,11 @@ main (int argc, char *argv[])
   int count2;
 
   count1 = acl (file1, GETACLCNT, 0, NULL);
+  if (count1 < 0 && errno == ENOSYS) /* Can happen on Solaris 10 with ZFS */
+    count1 = 0;
   count2 = acl (file2, GETACLCNT, 0, NULL);
+  if (count2 < 0 && errno == ENOSYS) /* Can happen on Solaris 10 with ZFS */
+    count2 = 0;
 
   if (count1 < 0)
     {
@@ -253,13 +257,13 @@ main (int argc, char *argv[])
       aclent_t *entries2 = XNMALLOC (count2, aclent_t);
       int i;
 
-      if (acl (file1, GETACL, count1, entries1) < count1)
+      if (count1 > 0 && acl (file1, GETACL, count1, entries1) < count1)
         {
           fprintf (stderr, "error retrieving the ACLs of file %s\n", file1);
           fflush (stderr);
           abort ();
         }
-      if (acl (file2, GETACL, count2, entries2) < count1)
+      if (count2 > 0 && acl (file2, GETACL, count2, entries2) < count1)
         {
           fprintf (stderr, "error retrieving the ACLs of file %s\n", file2);
           fflush (stderr);