2011-09-06 Bruno Haible <bruno@clisp.org>
+ acl: Fix a test failure on AIX >= 5.3 with NFS.
+ * tests/test-sameacls.c (main): Interpret aclx_get failure with ENOSYS
+ as no ACL.
+
+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
type1.u64 = ACL_ANY;
if (aclx_get (file1, 0, &type1, acl1, &aclsize1, &mode1) < 0)
{
- fprintf (stderr, "error accessing the ACLs of file %s\n", file1);
- fflush (stderr);
- abort ();
- }
- if (aclx_printStr (text1, &textsize1, acl1, aclsize1, type1, file1, 0) < 0)
- {
- fprintf (stderr, "cannot convert the ACLs of file %s to text\n", file1);
- fflush (stderr);
- abort ();
+ if (errno == ENOSYS)
+ text1[0] = '\0';
+ else
+ {
+ fprintf (stderr, "error accessing the ACLs of file %s\n", file1);
+ fflush (stderr);
+ abort ();
+ }
}
+ else
+ if (aclx_printStr (text1, &textsize1, acl1, aclsize1, type1, file1, 0) < 0)
+ {
+ fprintf (stderr, "cannot convert the ACLs of file %s to text\n", file1);
+ fflush (stderr);
+ abort ();
+ }
/* The docs say that type2 being 0 is equivalent to ACL_ANY, but it is not
true, in AIX 5.3. */
type2.u64 = ACL_ANY;
if (aclx_get (file2, 0, &type2, acl2, &aclsize2, &mode2) < 0)
{
- fprintf (stderr, "error accessing the ACLs of file %s\n", file2);
- fflush (stderr);
- abort ();
- }
- if (aclx_printStr (text2, &textsize2, acl2, aclsize2, type2, file2, 0) < 0)
- {
- fprintf (stderr, "cannot convert the ACLs of file %s to text\n", file2);
- fflush (stderr);
- abort ();
+ if (errno == ENOSYS)
+ text2[0] = '\0';
+ else
+ {
+ fprintf (stderr, "error accessing the ACLs of file %s\n", file2);
+ fflush (stderr);
+ abort ();
+ }
}
+ else
+ if (aclx_printStr (text2, &textsize2, acl2, aclsize2, type2, file2, 0) < 0)
+ {
+ fprintf (stderr, "cannot convert the ACLs of file %s to text\n", file2);
+ fflush (stderr);
+ abort ();
+ }
if (strcmp (text1, text2) != 0)
{