Subject: bin/25200: "pax -a" creates archives that "tar" cannot read
To: None <>
From: None <>
List: netbsd-bugs
Date: 04/16/2004 17:06:59
>Number:         25200
>Category:       bin
>Synopsis:       "pax -a" creates archives that "tar" cannot read
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 16 15:08:00 UTC 2004
>Originator:     Alan Barrett
>Release:        NetBSD 1.6ZK
Not much
System: NetBSD 1.6ZK
Architecture: i386
Machine: i386
The format of ustar archives created by "pax -a" seems to have changed
recently, and tar is no longer able to read the archives.

$ uname -rs
NetBSD 1.6ZK
$ ls -l /bin/pax /bin/tar
-r-xr-xr-x  3 root  wheel  124762 Mar  3 17:56 /bin/pax
-r-xr-xr-x  3 root  wheel  124762 Mar  3 17:56 /bin/tar
$ touch foo bar
$ # store both foo and bar into file1.tar
$ pax -w -b 512 -x ustar -f file1.tar foo bar
$ # store foo into file2.tar, then append bar to file2.tar
$ pax -w -b 512 -x ustar -f file2.tar foo
$ pax -w -b 512 -x ustar -f file2.tar -a bar
$ # note that file1.tar and file2.tar are different
$ wc -c file1.tar file2.tar
    2048 file1.tar
    2560 file2.tar
    4608 total
$ cmp file1.tar file2.tar
file1.tar file2.tar differ: char 513, line 1
$ # note that pax and tar agree that file1.tar contains both foo and bar
$ pax -f file1.tar
$ tar -t -f file1.tar
$ # note that pax thinks file2.tar contains both foo and bar,
$ # while pax-as-tar thinks file2.tar contains only foo
$ pax -f file2.tar
$ tar -t -f file2.tar

unknown.  Note that this problem did not exist in NetBSD-current a
few months ago.  I don't know the date when things stopped working.