-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes https everywhere not working with existing database. #13143
Conversation
We use third_party/zlib to unzip HTTPS Everywhere database from a zip file. Chromium recently changed unzip behavior to error out if the target file already exists (previously it happily overrode existing files). This caused our code that unzips the file to error out and not load the db. Changed our code to delete existing unzipped directory before unzipping. Chromium change: https://chromium.googlesource.com/chromium/src/+/7ba6004ba3727e9f5339841cfe0f54e7e51dfbf2 commit 7ba6004ba3727e9f5339841cfe0f54e7e51dfbf2 Author: François Degros <fdegros@chromium.org> Date: Thu Mar 17 05:46:45 2022 +0000 [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
Verified
|
Verification PASSED on
Using the STR/Cases outlined via brave/brave-browser#22503 (comment), ensured that:
Reproduced the original issue while running
|
Fixes brave/brave-browser#22503
We use third_party/zlib to unzip HTTPS Everywhere database from a zip
file. Chromium recently changed unzip behavior to error out if the
target file already exists (previously it happily overrode existing
files). This caused our code that unzips the file to error out and not
load the db.
Changed our code to delete existing unzipped directory before unzipping.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/7ba6004ba3727e9f5339841cfe0f54e7e51dfbf2
commit 7ba6004ba3727e9f5339841cfe0f54e7e51dfbf2
Author: François Degros fdegros@chromium.org
Date: Thu Mar 17 05:46:45 2022 +0000
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: