-
Notifications
You must be signed in to change notification settings - Fork 129
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
corrupted octal value in tar header #475
Comments
I'm unable to reproduce the problem. This is with the latest busybox-w32 release on 64-bit Windows 10:
|
Thanks for the double check. I did some more tests and found the issue seems about the "tar" auto detection of compression type function. The first command is OK but the second one reports the error: Also if I compress it from a Ubuntu PC, busybox-w32's "tar xf" generate tar.bz2 file reports the same error. So it should be something in the decompression path. |
I'm still unable to reproduce the problem on my Windows system. However, I have been able to create tar files on Linux which display the issue. Both GNU tar and BusyBox tar generate files which fail to extract with BusyBox tar on both Windows and Linux. Now that I have a file that reliably reproduces the problem I'll be able to investigate. |
The code to autodetect compressed tar files failed to detect a bunzip2-compressed archive. When tar was invoked with the 'j' option it worked fine. The autodetection code looks for the magic string 'ustar' or a series of five NULs to determine that an archive is uncompressed. The failing archives had more than five NULs in the header and were taken to be uncompressed. Look for a longer run of NULs: 16 is certainly sufficient for the archives in question. Adds 8-16 bytes. (GitHub issue #475)
The code to autodetect compression was looking for the magic string 'ustar' or a run of five NULs to determine if an archive is uncompressed. In my sample file the bzip2 header had seven NULs, it was therefore considered to be uncompressed. Looking for a longer run of NULs should avoid the problem. Really old tar files can have 127 NULs, but checking for 16 should be plenty. New prerelease binaries have been issued with this fix (PRE-5531 or above). |
I was trying to make tarballs to the subdirectories of a rust vendor directory with this command:
tar jcf ../tarballs/$CRATE.tar.bz2 $CRATE
The command runs OK for all the crates (>200). But later when I tried decompress them, two of them failed:
tar xf tarballs/windows_x86_64_gnu-0.48.5.tar.bz2
tar xf tarballs/windows_x86_64_gnu.tar.bz2
with this error:
tar: corrupted octal value in tar header
The original crate file can be downloaded from:
curl -L https://crates.io/api/v1/crates/windows_x86_64_gnu/0.52.6/download | tar -zxf -
And I found the issue is caused by just one file, lib/libwindows.0.52.0.a
The text was updated successfully, but these errors were encountered: