diff options
author | Paul Spangler <paul.spangler@ni.com> | 2017-10-19 14:33:12 -0500 |
---|---|---|
committer | Paul Spangler <paul.spangler@ni.com> | 2017-10-20 12:34:58 -0500 |
commit | 6674b4aa0f47ce6a98d24cfc949a2e4a3ffd254c (patch) | |
tree | 28a007e4de784168b3c024a268a986def936d2a5 /libarchive/archive_write_disk_windows.c | |
parent | f5e11acaa8779738ce166b266d1cd3ad1e666a37 (diff) | |
download | libarchive-6674b4aa0f47ce6a98d24cfc949a2e4a3ffd254c.tar.gz |
archive_write_disk_{posix,windows}.c: Don't modify attributes for existing directories when ARCHIVE_EXTRACT_NO_OVERWRITE is set
Enables unpacking multiple archives into a single directory whose permissions,
owner, and other attributes are pre-configured or otherwise determined ahead
of time by a single archive without the need to repeat the same attributes in
every archive, such as in package installation scenarios.
Signed-off-by: Paul Spangler <paul.spangler@ni.com>
Diffstat (limited to 'libarchive/archive_write_disk_windows.c')
-rw-r--r-- | libarchive/archive_write_disk_windows.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c index 8fe99a07..b09c2712 100644 --- a/libarchive/archive_write_disk_windows.c +++ b/libarchive/archive_write_disk_windows.c @@ -1325,6 +1325,10 @@ restore_entry(struct archive_write_disk *a) if ((en == EISDIR || en == EEXIST) && (a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) { /* If we're not overwriting, we're done. */ + if (S_ISDIR(a->mode)) { + /* Don't overwrite any settings on existing directories. */ + a->todo = 0; + } archive_entry_unset_size(a->entry); return (ARCHIVE_OK); } |