p-linnane's Description of Work
unzip and zipinfo read *, ? and [ in an archive name as a pattern and fall back to <name>.zip or <name>.ZIP, so they could list or extract a neighbouring file instead of the requested one, and 7zr also expands archive names. Run the ZIP tools on a fixed-name symlink in an otherwise empty temporary directory and pass -spd to 7zr, keeping the original archive in errors.
- [x] Have you followed our Contributing guidelines?
- [x] Have you checked for other open Pull Requests for the same change?
- [x] Have you explained what your changes do? Performance claims (e.g. "this is faster") must include
brew benchmarkresults. - [x] Have you explained why you'd like these changes included, not just what they do?
- [ ] For bug fixes, have you given step-by-step
brewcommands to reproduce the bug? - [x] Have you written new tests (excluding integration tests)? Here's an example.
- [ ] Have you successfully run
brew lgtm(style, typechecking and tests) locally?
- [x] I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.
Codex (GPT-6 Astra) wrote the change and tests, checked that the new examples fail without the change and ran brew lgtm --online and macOS extraction checks with real unzip and 7zr. Claude Code (Opus 5.5) reviewed three revisions and their callers, suggested the error context and the worker and recovery examples, reproduced the unzip, 7zr and re-raise behaviour with scratch fixtures and ran brew lgtm --online, which fails only on two volume-label examples that fail the same way on main locally.
Summary by CodeRabbit
-
Bug Fixes- Improved ZIP and P7Zip extraction for archive filenames containing special characters or wildcard symbols.
- Ensured extraction targets the selected archive without incorrectly matching neighbouring
.zipor.ZIPfiles. - Improved handling of truncated archives, insufficient disk space, and extraction failures.
- Temporary extraction resources are now cleaned up reliably, including after errors.