- int type = types[t];
- acl_t acl1;
- char *text1;
- int errno1;
- acl_t acl2;
- char *text2;
- int errno2;
-
- acl1 = acl_get_file (file1, type);
- if (acl1 == (acl_t)NULL)
- {
- text1 = NULL;
- errno1 = errno;
- }
- else
- {
- text1 = acl_to_text (acl1, NULL);
- if (text1 == NULL)
- errno1 = errno;
- else
- errno1 = 0;
- }
- acl2 = acl_get_file (file2, type);
- if (acl2 == (acl_t)NULL)
- {
- text2 = NULL;
- errno2 = errno;
- }
- else
- {
- text2 = acl_to_text (acl2, NULL);
- if (text2 == NULL)
- errno2 = errno;
- else
- errno2 = 0;
- }
-
- if (acl1 != (acl_t)NULL)
- {
- if (acl2 != (acl_t)NULL)
- {
- if (text1 != NULL)
- {
- if (text2 != NULL)
- {
- if (strcmp (text1, text2) != 0)
- {
- fprintf (stderr, "files %s and %s have different ACLs:\n%s\n%s\n",
- file1, file2, text1, text2);
- return 1;
- }
- }
- else
- {
- fprintf (stderr, "file %s has a valid ACL, but file %s has an invalid ACL\n",
- file1, file2);
- return 1;
- }
- }
- else
- {
- if (text2 != NULL)
- {
- fprintf (stderr, "file %s has an invalid ACL, but file %s has a valid ACL\n",
- file1, file2);
- return 1;
- }
- else
- {
- if (errno1 != errno2)
- {
- fprintf (stderr, "files %s and %s have differently invalid ACLs, errno = %d vs. %d\n",
- file1, file2, errno1, errno2);
- return 1;
- }
- }
- }
- }
- else
- {
- fprintf (stderr, "file %s has an ACL, but file %s has no ACL\n",
- file1, file2);
- return 1;
- }
- }
- else
- {
- if (acl2 != (acl_t)NULL)
- {
- fprintf (stderr, "file %s has no ACL, but file %s has an ACL\n",
- file1, file2);
- return 1;
- }
- }
+ int type = types[t];
+ acl_t acl1;
+ char *text1;
+ int errno1;
+ acl_t acl2;
+ char *text2;
+ int errno2;
+
+ acl1 = acl_get_file (file1, type);
+ if (acl1 == (acl_t)NULL)
+ {
+ text1 = NULL;
+ errno1 = errno;
+ }
+ else
+ {
+ text1 = acl_to_text (acl1, NULL);
+ if (text1 == NULL)
+ errno1 = errno;
+ else
+ errno1 = 0;
+ }
+ acl2 = acl_get_file (file2, type);
+ if (acl2 == (acl_t)NULL)
+ {
+ text2 = NULL;
+ errno2 = errno;
+ }
+ else
+ {
+ text2 = acl_to_text (acl2, NULL);
+ if (text2 == NULL)
+ errno2 = errno;
+ else
+ errno2 = 0;
+ }
+
+ if (acl1 != (acl_t)NULL)
+ {
+ if (acl2 != (acl_t)NULL)
+ {
+ if (text1 != NULL)
+ {
+ if (text2 != NULL)
+ {
+ if (strcmp (text1, text2) != 0)
+ {
+ fprintf (stderr, "files %s and %s have different ACLs:\n%s\n%s\n",
+ file1, file2, text1, text2);
+ return 1;
+ }
+ }
+ else
+ {
+ fprintf (stderr, "file %s has a valid ACL, but file %s has an invalid ACL\n",
+ file1, file2);
+ return 1;
+ }
+ }
+ else
+ {
+ if (text2 != NULL)
+ {
+ fprintf (stderr, "file %s has an invalid ACL, but file %s has a valid ACL\n",
+ file1, file2);
+ return 1;
+ }
+ else
+ {
+ if (errno1 != errno2)
+ {
+ fprintf (stderr, "files %s and %s have differently invalid ACLs, errno = %d vs. %d\n",
+ file1, file2, errno1, errno2);
+ return 1;
+ }
+ }
+ }
+ }
+ else
+ {
+ fprintf (stderr, "file %s has an ACL, but file %s has no ACL\n",
+ file1, file2);
+ return 1;
+ }
+ }
+ else
+ {
+ if (acl2 != (acl_t)NULL)
+ {
+ fprintf (stderr, "file %s has no ACL, but file %s has an ACL\n",
+ file1, file2);
+ return 1;
+ }
+ }