Repository navigation
match ./-prefixed archive entries in extract_file - #211
Merged
Merged
Conversation
`tar -czf app.tar.gz -C dir .` stores every entry as `./name`, while `tar -czf app.tar.gz *` stores it as `name`. The lookup in `extract_file` was an exact path match on both the tar and zip arms, so the first archive failed with "Could not find the required path in the archive" even though the file was there, and the caller has no way to know which invocation produced the release artifact. Both arms now compare through `archive_path_matches`, which ignores a leading `./` on either side, so a `./`-prefixed request also matches a plainly-named entry. Interior components are compared exactly, so a same-named file in a subdirectory cannot be selected by accident. Reported in #27. Also pins two contracts that had no coverage: the github asset download URL comes from the API `url` field (not `browser_download_url`), and the download request carries `Accept: application/octet-stream`. Together those are what make a private release asset reachable, and a flip between the two URL fields has broken downloads before (#77).
jaemk
force-pushed
the
260901.archive-dot-slash
branch
from
September 2, 2026 00:46
9a18f30 to
c2fa13e
Compare
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
./-prefixed archive entry lookup reported in #27, and pins the github asset-URLcontract #77 was about.
./-prefixed entries inExtract::extract_fileon both the tar and zip arms, through ashared
archive_path_matches.tar -czf app.tar.gz -C dir .stores every entry as./name, sosuch an archive failed with "Could not find the required path in the archive" even though the
file was present. A
./-prefixedbin_path_in_archivenow also matches a plainly-named entry.by accident (
archive_path_matching_ignores_only_a_leading_dot_slash)../prefix (append_datanormalizes it away, so the raw GNU header name is set directly).urlfield, notbrowser_download_url, and thedownload request's
Accept: application/octet-stream. Together those are what make a privaterelease asset reachable, and neither had coverage (Parse Github Asset Based on Accessibility #77).
make ciis green.