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

Re: tar directory extraction fix

Scott James Remnant <scott@netsplit.com> wrote:

> On Wed, 2004-05-12 at 21:24 +0200, Gunnar Ritter wrote:
> > /*
> >  * POSIX tar archives are not required to have a '/'
> >  * as last character for a directory entry.
> > */
> > 
> Really?  Can you point me at some relevant documentation for this --


Also have a look at the output of 'find . -depth | cpio -oHustar';
neither GNU cpio nor System V cpio nor my implementation append
slashes to directory archive entries when creating ustar (POSIX)

Note that while GNU tar itself does create a trailing slash for
directory archive entries in both ustar and GNU tar format, it
does not require it to be present on extraction for any of them.

There's also a more serious issue with dpkg reading archives created
with 'find -depth' as it seems unable to handle the situation when the
archive entry for a directory follows the archive entries for files
below it (or is not present at all); dpkg requires the entry for a
directory before one of its members appears.

Even with the fix posted three weeks ago, dpkg's understanding of
POSIX tar archives is incomplete as it lacks support for the prefix
header field and names with exactly 100 characters (bytes).

As it is planned for GNU tar to use the POSIX.1-2001 pax format as
default output format in future releases (see the documentation for
v. 1.14), it might be a good idea to support this format in dpkg too.
This is not urgent but should nevertheless be known to you.

> this certainly isn't the case for traditional tar.

No, but 'traditional' (4BSD-style) tar has been obsoleted years ago.
Pre-POSIX System V tar archives (which are equally obsolete) do not
contain entries for directories at all and thus probably cannot be
handled by dpkg because of the problem described above. This should
not be of much concern for you by itself but shows how much dpkg
relies on implicit assumptions when reading tar archives.


Coreworks Systementwicklung GbR
Burkheimer Str. 3
79111 Freiburg
Tel. 0049 761 4568 401

Reply to: