[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: Alex Danilo <adanilo@chromium.org> Commit-Queue: François Degros <fdegros@chromium.org> Cr-Commit-Position: refs/heads/main@{#982048} NOKEYCHECK=True GitOrigin-RevId: 7ba6004ba3727e9f5339841cfe0f54e7e51dfbf2
Loading
Please register or sign in to comment