]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
If possible read default ACLs with acl_get_fd_np()
authorMartin Matuska <martin@matuska.org>
Wed, 4 Jan 2017 13:07:50 +0000 (14:07 +0100)
committerMartin Matuska <martin@matuska.org>
Wed, 4 Jan 2017 13:07:50 +0000 (14:07 +0100)
libarchive/archive_read_disk_entry_from_file.c

index 0a5453c640ba32b2c328f22eb058af08edda7a24..da28046a96e83d17544c9045c7bd01d4e4b17cef 100644 (file)
@@ -526,6 +526,11 @@ setup_acls(struct archive_read_disk *a,
 
        /* Only directories can have default ACLs. */
        if (S_ISDIR(archive_entry_mode(entry))) {
+#if HAVE_ACL_GET_FD_NP
+               if (*fd >= 0)
+                       acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT);
+               else
+#endif
                acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
                if (acl != NULL) {
                        r = translate_acl(a, entry, acl,