# HG changeset patch # User Bruno Haible # Date 1315303545 -7200 # Node ID 79ba5f83de2a51f3f979d4da40196644147be92b # Parent 15d6c13d7aae757f70107f3c39824acfba894759 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. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-09-06 Bruno Haible + + 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 acl: Update for AIX >= 5.3 with NFS. diff --git a/tests/test-sameacls.c b/tests/test-sameacls.c --- a/tests/test-sameacls.c +++ b/tests/test-sameacls.c @@ -227,7 +227,11 @@ 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 @@ 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);