shouldn't tar quit at end of archive?

Rob Landley rob at landley.net
Sat Apr 8 01:49:17 UTC 2006


On Thursday 06 April 2006 11:58 am, Rich Felker wrote:
> On Thu, Apr 06, 2006 at 08:22:57AM -0400, Paul Fox wrote:
> >  > > From: Paul Fox [mailto:pgf at brightstareng.com]=20
> >  >
> >  > <snip>
> >  >
> >  > > second, it causes tar to exit when it detects the first occurence
> >  > > of a null header in the archive, rather than waiting for the
> >  > > second such header.  not all tar archives are terminated with two
> >  > > null headers.
> >  >
> >  > Look at this:
> >  > http://www.busybox.net/lists/busybox/2001-May/003341.html Maybe this
> >  > is the original reason why it tried to read everything past the first
> >  > empty block.
> >
> > i don't think that's the whole story, but it's certainly worth keeping
> > in mind that the filename can legitimately be all-null.
>
> Would you care to explain how a null filename can be valid?
>
> Rich

According to the link, a tar archive that included "/" as an entry had leading 
slashes stripped, thus it had an entry with nothing in it because gnu tar is 
stupid.  The entry for "/" itself became a null entry, but was not dropped.

However, you shouldn't be able to have two of those in a row, so reading two 
consecutive empty entries should be sufficient to detect EOF.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list