summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_extract.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libarchive/archive_read_extract.c')
-rw-r--r--lib/libarchive/archive_read_extract.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c
index d313105..8bb75a6 100644
--- a/lib/libarchive/archive_read_extract.c
+++ b/lib/libarchive/archive_read_extract.c
@@ -336,7 +336,9 @@ archive_read_extract_regular(struct archive *a, struct archive_entry *entry,
}
set_ownership(a, entry, flags);
set_time(a, entry, flags);
- set_perm(a, entry, archive_entry_mode(entry), flags);
+ /* Always restore permissions for regular files. */
+ set_perm(a, entry, archive_entry_mode(entry),
+ flags | ARCHIVE_EXTRACT_PERM);
set_extended_perm(a, entry, flags);
close(fd);
return (r);
OpenPOWER on IntegriCloud