bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Re: AMTAR brokenness


From: Gunnar Ritter
Subject: Re: [Bug-tar] Re: AMTAR brokenness
Date: Mon, 19 Apr 2004 21:03:33 +0200
User-agent: nail 10.8pre 4/14/04

I've read the rest of the thread in the meantime. Concerning

| Alexandre Duret-Lutz:
|
| >>> "Sergey" == Sergey Poznyakoff <address@hidden> writes:
|
| [...]
|
| Sergey> Returning to the question which format should be chosen for
| Sergey> distribution tarballs: I would recommend the 'ustar' format.
| Sergey> It also has a limitation on the maximum length of stored pathnames,
| Sergey> but the limitation is 256 characters, which is reasonably large.
| Sergey> Besides, ustar archives can be read by any existing implementation
| Sergey> of tar.
|
| By the way, the pax manpage from the Heirloom Toolchest
| (http://heirloom.berlios.de/man/pax.1.html) mentions that "due
| to implementation errors, file names longer than 99 characters
| can not considered to be generally portable" when taking about
| the ustar format.
|
| I think it's the only place where I've read this.  Has anybody
| seen such implementation?  I'm tempted to think we shouldn't
| care.

If one creates a ustar archive entry with a file name of exactly
100 bytes, there is no terminating NUL according to POSIX:

0000    61 61 61 61 61 61 61 61  61 61 61 61 61 61 61 61   aaaaaaaaaaaaaaaa
*
0060    61 61 61 61 30 30 30 30  36 34 34 00 30 30 30 31   aaaa0000644.0001
0070    31 30 30 00 30 30 30 30  30 30 31 00 30 30 30 30   100.0000001.0000
0080    30 30 30 30 30 30 30 00  31 30 30 34 31 30 31 36   0000000.10041016
0090    34 35 37 00 30 30 33 34  34 35 36 00 30 00 00 00   457.0034456.0...
00a0    00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
*
0100    00 75 73 74 61 72 00 30  30 67 75 6e 6e 61 72 00   .ustar.00gunnar.
0110    00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
0120    00 00 00 00 00 00 00 00  00 6f 74 68 65 72 00 00   .........other..
0130    00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
0140    00 00 00 00 00 00 00 00  00 30 30 30 30 30 30 30   .........0000000
0150    00 30 30 30 30 30 30 30  00 00 00 00 00 00 00 00   .0000000........
0160    00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
*

Some implementations cannot handle this and will append the mode
characters to the file name when reading such an archive:

-rw-r--r--576/1        0 Apr 19 20:40 2004 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0000644

This occurs e. g. with Solaris tar (at least up to SunOS 5.4),
and Solaris cpio (at least up to SunOS 5.10 Beta 1, i. e. today).

I'm not sure if it's relevant enough to prevent automake from
creating ustar archives. Portability of other formats which
support more than 99 bytes is probably even worse, and it's
not too difficult to just use another implementation for the
few people which are affected by this.

        Gunnar

-- 
http://omnibus.ruf.uni-freiburg.de/~gritter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]