Skip to content
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

fix bugs handling unusual tarballs with directory after contents #105

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

StefanKarpinski
Copy link
Member

This fixes three related bugs when processing tarballs where a directory entry appears after some contents of that directory. This is unusual since neither command-line tar nor Tar.create will produce tarballs like this, and I only dicovered the bug when I accidentally modified Tar.create to emit directory entries after emiting everything inside of the directory. Each of extract, tree_hash and rewrite did this wrong in slightly different ways previously. Now they all (hopefully) do the right thing, and we test that they each handle a manually generated tarball with this kind of unusual ordering.

@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #105 (37c8e83) into master (008a3f2) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 37c8e83 differs from pull request most recent head d0e2838. Consider uploading reports for the commit d0e2838 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   96.26%   96.29%   +0.02%     
==========================================
  Files           4        4              
  Lines         643      648       +5     
==========================================
+ Hits          619      624       +5     
  Misses         24       24              
Impacted Files Coverage Δ
src/create.jl 97.07% <100.00%> (+0.01%) ⬆️
src/extract.jl 96.37% <100.00%> (+0.03%) ⬆️
src/Tar.jl 96.10% <0.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 008a3f2...d0e2838. Read the comment docs.

This fixes three related bugs when processing tarballs where a directory
entry appears *after* some contents of that directory. This is unusual
since neither command-line `tar` nor `Tar.create` will produce tarballs
like this, and I only dicovered the bug when I accidentally modified
`Tar.create` to emit directory entries after emiting everything inside
of the directory. Each of `extract`, `tree_hash` and `rewrite` did this
wrong in slightly different ways previously. Now they all (hopefully) do
the right thing, and we test that they each handle a manually generated
tarball with this kind of unusual ordering.
@StefanKarpinski StefanKarpinski merged commit 9316af8 into master Apr 22, 2021
@StefanKarpinski StefanKarpinski deleted the sk/fix-directory-after-content branch April 22, 2021 01:48
StefanKarpinski added a commit that referenced this pull request May 4, 2021
This fixes three related bugs when processing tarballs where a directory
entry appears *after* some contents of that directory. This is unusual
since neither command-line `tar` nor `Tar.create` will produce tarballs
like this, and I only dicovered the bug when I accidentally modified
`Tar.create` to emit directory entries after emiting everything inside
of the directory. Each of `extract`, `tree_hash` and `rewrite` did this
wrong in slightly different ways previously. Now they all (hopefully) do
the right thing, and we test that they each handle a manually generated
tarball with this kind of unusual ordering.

(cherry picked from commit 9316af8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant