From 9ad66a1eed010e86f57f1178be6b5af22389e466 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 17 Jun 2004 03:09:06 +0000 Subject: [PATCH] Always restore permissions for regular files, even if the file already exists on disk. Pointed out by: www/resin3 port (whose distfile contains the same file twice with different permissions and relies on the permissions associated with the second instance) Thanks again to: Kris Kennaway --- lib/libarchive/archive_read_extract.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index d313105ade80..8bb75a60fcb2 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);