Invalid tar magic when streaming download

Eli Schwartz eschwartz at archlinux.org
Thu Dec 5 22:36:43 UTC 2019


On 12/5/19 5:25 PM, Jeffrey Fetterman wrote:
> This does not work:
> curl -sL https://api.github.com/repos/mirror/busybox/tarball/master |
> busybox64 gzip | busybox64 tar -xf -
> 
> But this does (note the lack of using busybox64 on the last part):
> curl -sL https://api.github.com/repos/mirror/busybox/tarball/master |
> busybox64 gzip | tar -xf -
> 
> Tried using it with a non-busybox version of gzip, had the same
> result, busybox64 tar couldn't handle it but every other version of
> tar I have could.

$ curl -sL https://api.github.com/repos/mirror/busybox/tarball/master |
busybox gzip | tar -xf - -C /tmp/foo
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now

$ curl -sL https://api.github.com/repos/mirror/busybox/tarball/master |
busybox gzip | tar -xzf - -C /tmp/foo
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

This is with GNU tar, how many different versions of tar did you try,
anyway???

libarchive bsdtar works, which I guess means that libarchive permits you
to wrap a tarball in *two* layers of gzip compression, then extract the
contents. Personally, I would claim this is a buggy design goal, because
you'd have to be nuts to create tarballs with multiple layers of
recursive compression.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1601 bytes
Desc: OpenPGP digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20191205/5a995a73/attachment.asc>


More information about the busybox mailing list