Skip to content
Commit 923f5eb4 authored by François Degros's avatar François Degros Committed by Copybara-Service
Browse files

[zip] Unzip() does not overwrite files anymore

Changed the way FilePathWriterDelegate creates a new file, by using
FLAG_CREATE instead of FLAG_CREATE_ALWAYS.

This prevents FilePathWriterDelegate and zip::Unzip() from overwriting
any existing file. This allows the detection of duplicated or
conflicting file names when extracting a ZIP archive. See
ZipTest.UnzipRepeatedFileName.

This fixes a confusing corner case on case-insensitive file systems,
which could result in file contents not matching file names as stored in
the ZIP archive. See ZipTest.UnzipDifferentCases.

BUG=chromium:953256
TEST=autoninja -C out/Default zlib_unittests && out/Default/zlib_unittests

Change-Id: I6cf80e6d8b9e39ffc76739c00cb6f2ecf57da88f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3529591


Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982048}
NOKEYCHECK=True
GitOrigin-RevId: 7ba6004ba3727e9f5339841cfe0f54e7e51dfbf2
parent fbff51a8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment