-
Notifications
You must be signed in to change notification settings - Fork 44
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
Corruption of members using bzip compression #26
Comments
Ping on this? It would be great to fix this bug in Debian and the Reproducible Builds project. :) |
Another gentle ping? :) |
Can you submit a GitHub PR? I unfortunately don't have the tuits to fix
this right now.
…On Wed, Aug 14, 2019, 1:26 PM Chris Lamb ***@***.***> wrote:
Another gentle ping? :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26?email_source=notifications&email_token=AAAXRZI2AZHB7NYMLOH6OSTQERTAZA5CNFSM4B56WO7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4KAG6Q#issuecomment-521405306>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAXRZLN3SFK4AUJY3WHN63QERTAZANCNFSM4B56WO7A>
.
|
Unfortunately the fix is not certain (see @AGWA's original comment) and thus I'm not sure we would be ready to merge this. |
Ok. I'm happy to merge and release a fix that has some level of confidence, with that reflected in the changelog. |
Getcha, but alas, do note "Unfortunately I have no idea what the right solution is here." :) |
I took a quick look at the two zip files (bzip.zip and bzip-out.zip) that @AGWA included at the start of this thread. Quick reminder - the zip files contain a single member, hello.txt
The only difference between bzip.zip and bzip-out.zip is one field in the local header. Below is a dump of the local header from bzip.zip. The field that differs with bzip-out.zip is the Compressed Length, where it has the value 0, rather than the expected value 0000003E.
|
What's the goal here, to detect bzip and skip them? I'm afraid I'm entirely lost here. :) |
@lamby strip-nondeterminism just needs the ability to read a bzip'd member from the archive, normalize the metadata, and then write the member back out with the same bzip'd data, the same compressed length, and the new metadata. It doesn't need to look at the uncompressed data. As @pmqs's helpful analysis shows, this is working except for the compressed length, which gets changed to 0. It makes sense that changing the argument to perl-Archive-Zip/lib/Archive/Zip/Member.pm Lines 695 to 697 in 8a5657f
Maybe @redhotpenguin, does this sound like a plausible fix? |
I did a very quick walk through with a Perl debugger, using the bzip.zip file, and the change from Only problem is that it breaks these tests. These failing tests are all concerned with the zero length zip member edge-conditions.
@AGWA - your suggestion about getting That appears to work. I'll send a pull request shortly. |
PR #46 created to address the issue. I'm relatively happy with the change, but would appreciate another set of eyes on the change. |
I've merged #46. Will release soonish. |
With #46 merged, can this issue be closed? |
Yep, I think so. @redhotpenguin, fancy making a release? :) |
Ugh, looks like we are missing a test file:
|
It's a typo in the manifest. It should be |
Ok, 1.65 is away. Happy to make additional releases if needed, but my review tuits are a bit limited with little kids here. |
I'm unable to install 1.67 on Amazon Linux because of this change:
|
I know that Archive::Zip doesn't support bzip compression, but it would be nice if Archive::Zip could pass through bzip members unmodified.
A simple test case:
The output (bzip-out.zip) differs from the input (bzip.zip) and can't be uncompressed with unzip:
This used to work, but was broken by ecf3d5e, specifically this change to
lib/Archive/Zip/Member.pm
:Changing the
1
back to a0
makes my test case work again, but breaks other test cases. Unfortunately I have no idea what the right solution is here.The text was updated successfully, but these errors were encountered: