issue with busybox tar

Denys Vlasenko vda.linux at googlemail.com
Thu Feb 23 10:33:03 UTC 2012


On Thu, Feb 23, 2012 at 8:55 AM, Natanael Copa <natanael.copa at gmail.com> wrote:
> Hi,
>
> I have an issue with busybox tar that does not happen with gnu tar:
>
> $ wget http://downloads.sourceforge.net/sourceforge/inkscape/inkscape-0.48.3.1.tar.gz
> ...
> $ md5sum inkscape-0.48.3.1.tar.gz
> ccf8ccd9e66199badb8c35ea3851a888  inkscape-0.48.3.1.tar.gz
> $ tar -ztf inkscape-0.48.3.1.tar.gz
> ...
> tar: warning: skipping header 'x'
> inkscape-0.48.3.1/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/
> tar: warning: skipping header 'x'
> inkscape-0.48.3.1/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/
> tar: invalid tar magic
> $ echo $?
> 1
>
> with gnu tar I get:
> ...
> inkscape-0.48.3.1/README.sk.txt
> inkscape-0.48.3.1/INSTALL
> inkscape-0.48.3.1/inkscape.spec
> $ echo $?
> 0

Looks like we don't support PAX headers which specify
the long name (we support a different (GNU, not PAX) extension for that):

0497b600  69 6e 6b 73 63 61 70 65  2d 30 2e 34 38 2e 33 2e  |inkscape-0.48.3.|
0497b610  31 2f 70 61 63 6b 61 67  69 6e 67 2f 6d 61 63 6f  |1/packaging/maco|
0497b620  73 78 2f 52 65 73 6f 75  72 63 65 73 2f 74 68 65  |sx/Resources/the|
0497b630  6d 65 73 2f 43 6c 65 61  72 6c 6f 6f 6b 73 2d 51  |mes/Clearlooks-Q|
0497b640  75 69 63 6b 73 69 6c 76  65 72 2d 4f 53 58 2f 67  |uicksilver-OSX/g|
0497b650  74 6b 2d 32 2e 30 2f 53  63 72 6f 6c 6c 62 61 72  |tk-2.0/Scrollbar|
0497b660  73 5f 31 2f 30 30 30 30  36 34 34 00 30 30 30 31  |s_1/0000644.0001|
0497b670  37 35 30 00 30 30 30 31  37 35 30 00 30 30 30 30  |750.0001750.0000|
0497b680  30 30 30 30 33 32 34 00  31 31 36 30 35 36 34 35  |0000324.11605645|
0497b690  36 30 35 00 30 33 31 32  33 34 00 20 78 00 00 00  |605.031234. x...|
0497b6a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0497b700  00 75 73 74 61 72 00 30  30 00 00 00 00 00 00 00  |.ustar.00.......|
0497b710  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0497b740  00 00 00 00 00 00 00 00  00 30 30 30 30 30 30 30  |.........0000000|
0497b750  00 30 30 30 30 30 30 30  00 00 00 00 00 00 00 00  |.0000000........|
0497b760  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0497b800  31 32 36 20 70 61 74 68  3d 69 6e 6b 73 63 61 70  |126 path=inkscap|
0497b810  65 2d 30 2e 34 38 2e 33  2e 31 2f 70 61 63 6b 61  |e-0.48.3.1/packa|
0497b820  67 69 6e 67 2f 6d 61 63  6f 73 78 2f 52 65 73 6f  |ging/macosx/Reso|
0497b830  75 72 63 65 73 2f 74 68  65 6d 65 73 2f 43 6c 65  |urces/themes/Cle|
0497b840  61 72 6c 6f 6f 6b 73 2d  51 75 69 63 6b 73 69 6c  |arlooks-Quicksil|
0497b850  76 65 72 2d 4f 53 58 2f  67 74 6b 2d 32 2e 30 2f  |ver-OSX/gtk-2.0/|
0497b860  53 63 72 6f 6c 6c 62 61  72 73 5f 31 2f 73 6c 69  |Scrollbars_1/sli|
0497b870  64 65 72 2d 68 6f 72 69  7a 2e 70 6e 67 0a 32 36  |der-horiz.png.26|
0497b880  20 6d 74 69 6d 65 3d 31  33 31 30 31 34 39 35 30  | mtime=131014950|
0497b890  39 2e 34 36 38 37 39 0a  33 30 20 61 74 69 6d 65  |9.46879.30 atime|
0497b8a0  3d 31 33 32 39 36 31 35  37 39 39 2e 31 33 33 35  |=1329615799.1335|
0497b8b0  37 34 35 39 39 0a 33 30  20 63 74 69 6d 65 3d 31  |74599.30 ctime=1|
0497b8c0  33 32 39 36 31 35 38 34  35 2e 36 31 30 37 30 38  |329615845.610708|
0497b8d0  38 32 39 0a 00 00 00 00  00 00 00 00 00 00 00 00  |829.............|
0497b8e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0497ba00  69 6e 6b 73 63 61 70 65  2d 30 2e 34 38 2e 33 2e  |inkscape-0.48.3.|
0497ba10  31 2f 70 61 63 6b 61 67  69 6e 67 2f 6d 61 63 6f  |1/packaging/maco|
0497ba20  73 78 2f 52 65 73 6f 75  72 63 65 73 2f 74 68 65  |sx/Resources/the|
0497ba30  6d 65 73 2f 43 6c 65 61  72 6c 6f 6f 6b 73 2d 51  |mes/Clearlooks-Q|
0497ba40  75 69 63 6b 73 69 6c 76  65 72 2d 4f 53 58 2f 67  |uicksilver-OSX/g|
0497ba50  74 6b 2d 32 2e 30 2f 53  63 72 6f 6c 6c 62 61 72  |tk-2.0/Scrollbar|
0497ba60  73 5f 31 2f 30 30 30 30  36 36 34 00 30 30 30 31  |s_1/0000664.0001|
0497ba70  37 35 30 00 30 30 30 31  37 35 30 00 30 30 30 30  |750.0001750.0000|
0497ba80  30 30 31 33 34 36 34 00  31 31 36 30 35 36 34 35  |0013464.11605645|
0497ba90  36 30 35 00 30 33 32 33  33 31 00 20 30 00 00 00  |605.032331. 0...|
0497baa0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0497bb00  00 75 73 74 61 72 00 30  30 74 65 64 00 00 00 00  |.ustar.00ted....|
0497bb10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0497bb20  00 00 00 00 00 00 00 00  00 74 65 64 00 00 00 00  |.........ted....|
0497bb30  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0497bb40  00 00 00 00 00 00 00 00  00 30 30 30 30 30 30 30  |.........0000000|
0497bb50  00 30 30 30 30 30 30 30  00 00 00 00 00 00 00 00  |.0000000........|
0497bb60  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0497bc00  89 50 4e 47 0d 0a 1a 0a  00 00 00 0d 49 48 44 52  |.PNG........IHDR|
0497bc10  00 00 00 26 00 00 00 0f  10 06 00 00 00 d8 0e 61  |...&...........a|
0497bc20  13 00 00 0f 4d 69 43 43  50 69 63 63 00 00 78 da  |....MiCCPicc..x.|
...

strace shows that tar reads the first 512 blocks of png file
and tries to interpret it as tar header.

Apparently, it is tricked by the coincidence that truncated name ends in '/':
"...Scrollbars_1/" which triggers a old-gnu heuristic that its a directory,
which in turn makes tar ignore the size field (0013464), which in turn
makes it interpret next block as a tar block, not data block.

We need to teach tar to understand PAX 'x' block with "path=PATH" to fix this.

-- 
vda


More information about the busybox mailing list