diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-06-17 03:09:06 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-06-17 03:09:06 +0000 |
commit | a6a34c96e8d80cdec307c59c8346716e40ff1314 (patch) | |
tree | 4e2d4e89de49d5e9e06912a4bc954fd4492a2d76 | |
parent | 0ac1bd72be1bdd51dba7df09e98e81a0b7ce4bfb (diff) | |
download | FreeBSD-src-a6a34c96e8d80cdec307c59c8346716e40ff1314.zip FreeBSD-src-a6a34c96e8d80cdec307c59c8346716e40ff1314.tar.gz |
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
-rw-r--r-- | lib/libarchive/archive_read_extract.c | 4 |
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); |