]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Test default ACLs against a nested directory. This verifies path handling.
authorMartin Matuska <martin@matuska.org>
Sat, 18 Feb 2017 16:06:24 +0000 (17:06 +0100)
committerMartin Matuska <martin@matuska.org>
Sat, 18 Feb 2017 16:06:24 +0000 (17:06 +0100)
libarchive/test/test_acl_platform_posix1e.c

index 1d55a33eb9519624e62c0cb8628ed288f997f546..5d1732a510f7050cd8e30f4a9357c2efb2ea2829 100644 (file)
@@ -571,8 +571,8 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
        assertEqualInt(0, n);
        close(fd);
 
-       /* Create directory d2 with default ACLs */
-       assertMakeDir("d2", 0755);
+       /* Create nested directory d2 with default ACLs */
+       assertMakeDir("d/d2", 0755);
 
 #if HAVE_SUN_ACL
        acl3_text = "user::rwx,"
@@ -604,10 +604,10 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
 
 #if HAVE_SUN_ACL
        func = "acl_set()";
-       n = acl_set("d2", acl3);
+       n = acl_set("d/d2", acl3);
 #else
        func = "acl_set_file()";
-       n = acl_set_file("d2", ACL_TYPE_DEFAULT, acl3);
+       n = acl_set_file("d/d2", ACL_TYPE_DEFAULT, acl3);
 #endif
        acl_free(acl3);
 
@@ -640,7 +640,7 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
                        acl_text = archive_entry_acl_to_text(ae, NULL, flags);
                        assertEqualString(acl_text, acl2_text);
                        free(acl_text);
-               } else if (strcmp(archive_entry_pathname(ae), "./d2") == 0) {
+               } else if (strcmp(archive_entry_pathname(ae), "./d/d2") == 0) {
                        acl_text = archive_entry_acl_to_text(ae, NULL, dflags);
                        assertEqualString(acl_text, acl3_text);
                        free(acl_text);