Subject: Re: tar: NetBSD 1.6.2 vs NetBSD 2.x
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Roland Illig <roland.illig@gmx.de>
List: tech-pkg
Date: 02/23/2005 18:01:16
Martti Kuparinen wrote:
> So, two hosts running NetBSD: one running 2.99.16 and the other 1.6.2.
> The distribution file is identical according to SHA1 checksum but the
> tar shows different result (note the *.svg and *.sv files).

The CVS ChangeLog for src/bin/pax/tar.c says:

> 2004-09-22 15:03  christos
>
>         * extern.h (1.45), file_subs.c (1.52), tar.c (1.58):
>
>         Keep track of the length of the gnu long name/link hack, so that
>         we can append to it. Modify the code so that file_write is 
re-entrant,
>         even in the gnu long name/link hack.
>
>         The old code assumed that the buffer already contained the 
necessary
>         blocks to satisfy the read file request that contained the long
>         filename. This is not always the case, specially when we are 
dealing
>         with pipes which do shorter reads, thus having more probability
>         that a long file name will fall across a buffer boundary.
>
>         To reproduce, create a tar archive with a lot of gnu-long-names
>         (pkgsrc/devel/libsigc++2 is a good example), do a tar -tf to get
>         a list of filenames, compress it and do a tar -tzf to get another
>         list of the filenames. Notice that the two lists differ.

Roland