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
This commit is contained in:
Tim Kientzle 2004-06-17 03:09:06 +00:00
parent 9896c5f11a
commit 9ad66a1eed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130623

View File

@ -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);