bug in busybox v1.18.4 tar?

Denys Vlasenko vda.linux at googlemail.com
Tue May 24 12:37:05 UTC 2011


On Tue, May 24, 2011 at 11:08 AM, Natanael Copa <natanael.copa at gmail.com> wrote:
> Hi,
>
> I think i have a bug in busybox v1.18.4 tar.
>
> The problem seems to be that a file ends up as .f instead of .filters.
> There are lots of  "tar: warning: skipping header 'x'" but i'm not
> sure those are related.

Yes, they are related.

> The archive is:
> http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.9.tar.bz2
>
> With busybox tar:
> $ wget -q -O - http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.9.tar.bz2
> | busybox tar -jt 2>/dev/null | grep emit.vcxproj.f
> libsigc++-2.2.9/MSVC_Net2010/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcxproj.f
>
> (note the .f at end)
>
> With GNU tar:
>
> $ wget -q -O - http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.9.tar.bz2
> | tar -jt 2>/dev/null | grep emit.vcxproj.f
> libsigc++-2.2.9/MSVC_Net2010/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcxproj.filters
>
> (note the .filters at end)

This tarball is created using pax headers. Pax headers precede the file itself
and usually contain data which is non-representable in standard tar header -
such as long names. Here we have:

(1) pax extended header's header (denoted by type 'x'):

00b95800  6c 69 62 73 69 67 63 2b  2b 2d 32 2e 32 2e 39 2f  |libsigc++-2.2.9/|
00b95810  4d 53 56 43 5f 4e 65 74  32 30 31 30 2f 74 65 73  |MSVC_Net2010/tes|
00b95820  74 73 2f 74 65 73 74 5f  64 69 73 63 6f 6e 6e 65  |ts/test_disconne|
00b95830  63 74 5f 64 75 72 69 6e  67 5f 65 6d 69 74 2f 50  |ct_during_emit/P|
00b95840  61 78 48 65 61 64 65 72  73 2e 36 35 37 37 2f 74  |axHeaders.6577/t|
00b95850  65 73 74 5f 64 69 73 63  6f 6e 6e 65 63 74 5f 64  |est_disconnect_d|
00b95860  75 72 69 6e 30 30 30 30  36 34 34 00 30 30 30 31  |urin0000644.0001|
00b95870  37 35 30 00 30 30 30 31  37 35 30 00 30 30 30 30  |750.0001750.0000|
00b95880  30 30 30 30 32 33 34 00  31 31 35 30 32 31 31 31  |0000234.11502111|
00b95890  31 33 33 00 30 33 31 33  35 31 00 20 78 00 00 00  |133.031351. x...|
00b958a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00b95900  00 75 73 74 61 72 00 30  30 00 00 00 00 00 00 00  |.ustar.00.......|
00b95910  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00b95940  00 00 00 00 00 00 00 00  00 30 30 30 30 30 30 30  |.........0000000|
00b95950  00 30 30 30 30 30 30 30  00 00 00 00 00 00 00 00  |.0000000........|
00b95960  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*

Then pax header itself. It contains full name, among other things:

00b95a00  31 31 36 20 70 61 74 68  3d 6c 69 62 73 69 67 63  |116 path=libsigc|
00b95a10  2b 2b 2d 32 2e 32 2e 39  2f 4d 53 56 43 5f 4e 65  |++-2.2.9/MSVC_Ne|
00b95a20  74 32 30 31 30 2f 74 65  73 74 73 2f 74 65 73 74  |t2010/tests/test|
00b95a30  5f 64 69 73 63 6f 6e 6e  65 63 74 5f 64 75 72 69  |_disconnect_duri|
00b95a40  6e 67 5f 65 6d 69 74 2f  74 65 73 74 5f 64 69 73  |ng_emit/test_dis|
00b95a50  63 6f 6e 6e 65 63 74 5f  64 75 72 69 6e 67 5f 65  |connect_during_e|
00b95a60  6d 69 74 2e 76 63 78 70  72 6f 6a 2e 66 69 6c 74  |mit.vcxproj.filt|
00b95a70  65 72 73 0a 32 30 20 61  74 69 6d 65 3d 31 32 39  |ers.20 atime=129|
00b95a80  37 34 32 37 37 34 35 0a  32 30 20 63 74 69 6d 65  |7427745.20 ctime|
00b95a90  3d 31 32 39 39 35 38 31  30 39 35 0a 00 00 00 00  |=1299581095.....|
00b95aa0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*

Then normal file header, with truncated name:

00b95c00  6c 69 62 73 69 67 63 2b  2b 2d 32 2e 32 2e 39 2f  |libsigc++-2.2.9/|
00b95c10  4d 53 56 43 5f 4e 65 74  32 30 31 30 2f 74 65 73  |MSVC_Net2010/tes|
00b95c20  74 73 2f 74 65 73 74 5f  64 69 73 63 6f 6e 6e 65  |ts/test_disconne|
00b95c30  63 74 5f 64 75 72 69 6e  67 5f 65 6d 69 74 2f 74  |ct_during_emit/t|
00b95c40  65 73 74 5f 64 69 73 63  6f 6e 6e 65 63 74 5f 64  |est_disconnect_d|
00b95c50  75 72 69 6e 67 5f 65 6d  69 74 2e 76 63 78 70 72  |uring_emit.vcxpr|
00b95c60  6f 6a 2e 66 30 30 30 30  36 34 34 00 30 30 30 31  |oj.f0000644.0001|
00b95c70  37 35 30 00 30 30 30 31  37 35 30 00 30 30 30 30  |750.0001750.0000|
00b95c80  30 30 30 31 36 35 30 00  31 31 35 30 32 31 31 31  |0001650.11502111|
00b95c90  31 33 33 00 30 33 34 37  32 32 00 20 30 00 00 00  |133.034722. 0...|
00b95ca0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00b95d00  00 75 73 74 61 72 00 30  30 6d 75 72 72 61 79 63  |.ustar.00murrayc|
00b95d10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00b95d20  00 00 00 00 00 00 00 00  00 6d 75 72 72 61 79 63  |.........murrayc|
00b95d30  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00b95d40  00 00 00 00 00 00 00 00  00 30 30 30 30 30 30 30  |.........0000000|
00b95d50  00 30 30 30 30 30 30 30  00 00 00 00 00 00 00 00  |.0000000........|
00b95d60  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*

The file data follows:

00b95e00 .........................

bbox tar does not have support for retrieving names from pax 'x' headers.

-- 
vda


More information about the busybox mailing list