From doconnor@cain.gsoft.com.au  Thu Nov  8 04:31:05 2007
Return-Path: <doconnor@cain.gsoft.com.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32C2716A46D
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Nov 2007 04:31:05 +0000 (UTC)
	(envelope-from doconnor@cain.gsoft.com.au)
Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10])
	by mx1.freebsd.org (Postfix) with ESMTP id B960613C4B2
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Nov 2007 04:31:04 +0000 (UTC)
	(envelope-from doconnor@cain.gsoft.com.au)
Received: from cain.gsoft.com.au (localhost [127.0.0.1])
	by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id lA83nDmY084744
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 8 Nov 2007 14:19:13 +1030 (CST)
	(envelope-from doconnor@cain.gsoft.com.au)
Received: (from doconnor@localhost)
	by cain.gsoft.com.au (8.13.8/8.13.8/Submit) id lA83nDAm084743;
	Thu, 8 Nov 2007 14:19:13 +1030 (CST)
	(envelope-from doconnor)
Message-Id: <200711080349.lA83nDAm084743@cain.gsoft.com.au>
Date: Thu, 8 Nov 2007 14:19:13 +1030 (CST)
From: "Daniel O'Connor" <doconnor@gsoft.com.au>
Reply-To: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: BSDtar doesn't match files in a tar that gtar does
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         117909
>Category:       bin
>Synopsis:       bsdtar(1) doesn't match files in a tar that gtar does
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kientzle
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 08 04:40:02 UTC 2007
>Closed-Date:    Tue Sep 02 06:55:20 UTC 2008
>Last-Modified:  Tue Sep 02 06:55:20 UTC 2008
>Originator:     Daniel O'Connor
>Release:        FreeBSD 6.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD cain.gsoft.com.au 6.2-STABLE FreeBSD 6.2-STABLE #0: Fri Feb 2 17:35:07 CST 2007 root@new-cain.gsoft.com.au:/usr/obj/usr/src/sys/GENERIC amd64


>Description:
BSDtar doesn't seem to match files that GNUtar does. I have a tape containing
gzip'd tar files from which
I am trying to recover a directory tree.

This works..
gtar -b 128 -zxvf /dev/nsa0 /foo/bar
Whereas using bsdtar does not - it matches no files.

>How-To-Repeat:
I can't repeat this for small test archives but I have seen it happen twice
with large (multi gigabyte) archives.

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->tkientzle 
Responsible-Changed-By: kris 
Responsible-Changed-When: Tue Dec 25 13:53:37 UTC 2007 
Responsible-Changed-Why:  
Assign to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117909 
Responsible-Changed-From-To: tkientzle->kientzle 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Feb 25 18:53:06 UTC 2008 
Responsible-Changed-Why:  
Reassign to proper user, Tim can you have a look at this please? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117909 

From: Tim Kientzle <kientzle@freebsd.org>
To: bug-followup@freebsd.org, doconnor@gsoft.com.au
Cc:  
Subject: Re: bin/117909: BSDtar doesn't match files in a tar that gtar does
Date: Mon, 25 Feb 2008 22:03:36 -0800

 Can you reproduce it with the very first files in a large
 archive?
 
 If so, could you possibly send me the first portion
 of such an archive so that I could reproduce it here?
 
 > gtar -b 128 -zxvf /dev/nsa0 /foo/bar
 > Whereas using bsdtar does not - it matches no files.
 
 What files did gtar match?  Could you please send
 me the output of
 
    gtar -b 128 -ztvf /dev/nsa0 /foo/bar
 
 Any additional information would help.
 
 Tim Kientzle

From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: Tim Kientzle <kientzle@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: bin/117909: BSDtar doesn't match files in a tar that gtar does
Date: Tue, 26 Feb 2008 22:47:39 +1030

 --nextPart1466487.044miphxKr
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Tue, 26 Feb 2008, Tim Kientzle wrote:
 > Can you reproduce it with the very first files in a large
 > archive?
 >
 > If so, could you possibly send me the first portion
 > of such an archive so that I could reproduce it here?
 
 OK, I will send it to you separately. It has some marginally sensitive
 information but in any case stuffing the PR DB full of crap is
 impolite ;)
 
 > > gtar -b 128 -zxvf /dev/nsa0 /foo/bar
 > > Whereas using bsdtar does not - it matches no files.
 >
 > What files did gtar match?  Could you please send
 > me the output of
 
 [cain 22:40] ~ >gtar -b 128 -ztvf /dev/nsa0 /usr/local/Genesis/Admin/.glimp=
 se_statistics
 gtar: Removing leading `/' from member names
 =2Drw-r--r-- doconnor/users 187163 2008-02-19 08:25 /usr/local/Genesis/Admi=
 n/.glimpse_statistics
 gtar: Ignoring unknown extended header keyword `SCHILY.dev'
 gtar: Ignoring unknown extended header keyword `SCHILY.ino'
 gtar: Ignoring unknown extended header keyword `SCHILY.nlink'
 
 gzip: stdin: decompression OK, trailing garbage ignored
 gtar: Child returned status 2
 gtar: Error exit delayed from previous errors
 
 Whereas tar returns nothing
 [cain 22:42] ~ >tar -b 128 -ztvf /dev/nsa0 /usr/local/Genesis/Admin/.glimps=
 e_statistics
 [cain 22:42] ~ >echo $?
 0
 
 [cain 22:43] ~ >tar -b 128 -ztvf /dev/nsa0 | less
 tar: Removing leading '/' from member names
 drwxrwxr-x  0 root   users       0 Feb 19 08:25 usr/local/Genesis/Admin
 drwxrwxr-x  0 bfuller users       0 Feb  5 16:52 usr/local/Genesis/Admin/GS=
  Admin
 drwxrwxr-x  0 doconnor users       0 Feb 19 18:42 usr/local/Genesis/Admin/T=
 emplates
 drwxrwxr-x  0 mhampton users       0 Dec 29  2004 usr/local/Genesis/Admin/B=
 MF
 drwxrwxr-x  0 amurphy  users       0 Sep 10 16:28 usr/local/Genesis/Admin/G=
 S Radar
 =2Drw-r--r--  0 doconnor users  187163 Feb 19 08:25 usr/local/Genesis/Admin=
 /.glimpse_statistics
 =2Drw-r--r--  0 doconnor users  262144 Feb 19 08:25 usr/local/Genesis/Admin=
 /.glimpse_turbo
 <snip>
 
 >    gtar -b 128 -ztvf /dev/nsa0 /foo/bar
 
 See above.
 
 > Any additional information would help.
 
 I snipped 250k off the beginning of the archive with..
 [cain 22:44] ~ >dd if=3D/dev/nsa0 of=3Dtest.dat bs=3D64k count=3D4
 4+0 records in
 4+0 records out
 262144 bytes transferred in 0.041679 secs (6289609 bytes/sec)
 
 and now I get..
 [cain 22:45] ~ >tar ztvf test.dat
 tar: Removing leading '/' from member names
 drwxrwxr-x  0 root   users       0 Feb 19 08:25 usr/local/Genesis/Admin
 drwxrwxr-x  0 bfuller users       0 Feb  5 16:52 usr/local/Genesis/Admin/GS=
  Admin
 drwxrwxr-x  0 doconnor users       0 Feb 19 18:42 usr/local/Genesis/Admin/T=
 emplates
 drwxrwxr-x  0 mhampton users       0 Dec 29  2004 usr/local/Genesis/Admin/B=
 MF
 drwxrwxr-x  0 amurphy  users       0 Sep 10 16:28 usr/local/Genesis/Admin/G=
 S Radar
 =2Drw-r--r--  0 doconnor users  187163 Feb 19 08:25 usr/local/Genesis/Admin=
 /.glimpse_statistics
 =2Drw-r--r--  0 doconnor users  262144 Feb 19 08:25 usr/local/Genesis/Admin=
 /.glimpse_turbo
 =2Drw-r--r--  0 doconnor users 1052558 Feb 19 08:25 usr/local/Genesis/Admin=
 /.glimpse_filenames
 tar: Premature end of gzip compressed data: Input/output error
 [cain 22:45] ~ >tar -b 128 -ztvf test.dat /usr/local/Genesis/Admin/.glimpse=
 _statistics
 tar: Premature end of gzip compressed data: Input/output error
 [cain 22:45] ~ >gtar -b 128 -ztvf test.dat /usr/local/Genesis/Admin/.glimps=
 e_statistics
 gtar: Removing leading `/' from member names
 =2Drw-r--r-- doconnor/users 187163 2008-02-19 08:25 /usr/local/Genesis/Admi=
 n/.glimpse_statistics
 
 gzip: stdin: unexpected end of file
 gtar: Unexpected EOF in archive
 gtar: Error is not recoverable: exiting now
 
 Thanks for looking into it.
 
 =2D-=20
 Daniel O'Connor software and network engineer
 for Genesis Software - http://www.gsoft.com.au
 "The nice thing about standards is that there
 are so many of them to choose from."
   -- Andrew Tanenbaum
 GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
 
 --nextPart1466487.044miphxKr
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.4 (FreeBSD)
 
 iD8DBQBHxANq5ZPcIHs/zowRAqtUAJ91GkpLS8kElmCA/rx/ed5/TTi+7QCfcDJh
 gUQJSAOvn7XlEAoLeoCnU44=
 =lefG
 -----END PGP SIGNATURE-----
 
 --nextPart1466487.044miphxKr--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/117909: commit references a PR
Date: Sun, 17 Aug 2008 19:44:16 +0000 (UTC)

 kientzle    2008-08-17 19:43:45 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/tar          matching.c 
   Log:
   SVN rev 181801 on 2008-08-17 19:43:45Z by kientzle
   
   Don't strip a leading '/' from a pattern to be matched.
   This aligns the pattern-matching behavior with GNU tar
   and restores the behavior of bsdtar prior to FreeBSD 6.3.
   
   PR:             bin/117909
   MFC after:      3 days
   
   Revision  Changes    Path
   1.14      +0 -2      src/usr.bin/tar/matching.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/117909: commit references a PR
Date: Wed, 27 Aug 2008 04:59:22 +0000 (UTC)

 kientzle    2008-08-27 04:59:00 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     usr.bin/tar          matching.c read.c 
     usr.bin/tar/test     main.c test.h test_patterns.c 
   Added files:           (Branch: RELENG_7)
     usr.bin/tar/test     test_patterns_2.tgz.uu 
                          test_patterns_3.tgz.uu 
   Removed files:         (Branch: RELENG_7)
     usr.bin/tar/test     test_patterns.tgz.err.uu 
                          test_patterns.tgz.out.uu 
                          test_patterns.tgz.uu 
   Log:
   SVN rev 182239 on 2008-08-27 04:59:00Z by kientzle
   
   MFC r181801,181904,181958,181959,181971:  Many improvements to
   pattern-matching tests.  Two bug fixes:
    * Don't remove leading '/' from patterns to be matched.
      This aligns the pattern-matching with GNU tar and with earlier
      versions of bsdtar.
    * Write unedited paths for -t.  This makes the pattern-matching
      behavior, in particular, a lot more transparent.  The cost is
      that you have no good way to preview the effects of pathname
      substitutions.
   
   PR:             bin/117909
   
   Revision  Changes    Path
   1.11.2.4  +0 -2      src/usr.bin/tar/matching.c
   1.34.2.5  +10 -11    src/usr.bin/tar/read.c
   1.3.2.3   +31 -0     src/usr.bin/tar/test/main.c
   1.3.2.3   +4 -0      src/usr.bin/tar/test/test.h
   1.1.2.3   +49 -9     src/usr.bin/tar/test/test_patterns.c
   1.2.2.2   +0 -6      src/usr.bin/tar/test/test_patterns.tgz.err.uu (dead)
   1.2.2.2   +0 -5      src/usr.bin/tar/test/test_patterns.tgz.out.uu (dead)
   1.2.2.2   +0 -9      src/usr.bin/tar/test/test_patterns.tgz.uu (dead)
   1.1.2.1   +9 -0      src/usr.bin/tar/test/test_patterns_2.tgz.uu (new)
   1.1.2.1   +8 -0      src/usr.bin/tar/test/test_patterns_3.tgz.uu (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/117909: commit references a PR
Date: Thu, 28 Aug 2008 06:16:07 +0000 (UTC)

 kientzle    2008-08-28 06:15:29 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     usr.bin/tar          matching.c read.c 
     usr.bin/tar/test     main.c test.h test_copy.c test_option_T.c 
                          test_patterns.c 
   Added files:           (Branch: RELENG_6)
     usr.bin/tar/test     test_patterns_2.tgz.uu 
                          test_patterns_3.tgz.uu 
   Log:
   SVN rev 182353 on 2008-08-28 06:15:29Z by kientzle
   
   MFC r181750,181801,181821,181845,181904,181958,181959,181971:  Pattern-matching
   fixes.
     * Many tests.
   
     * No longer strip leading '/' from pattern, so that /foo once again
   matches /foo.  (This was correct in FreeBSD 6.2, broken in 6.3, and
   will now be fixed in 6.4.)
   
     * Strip leading "./" or ".//" from both filenames and patterns so
   that "./foo" matches "foo", etc.
   
   PR:             bin/117909
   
   Revision   Changes    Path
   1.9.2.6    +39 -5     src/usr.bin/tar/matching.c
   1.23.2.15  +10 -11    src/usr.bin/tar/read.c
   1.4.2.3    +31 -0     src/usr.bin/tar/test/main.c
   1.4.2.3    +4 -0      src/usr.bin/tar/test/test.h
   1.3.2.3    +3 -0      src/usr.bin/tar/test/test_copy.c
   1.3.2.3    +4 -1      src/usr.bin/tar/test/test_option_T.c
   1.6.2.2    +53 -0     src/usr.bin/tar/test/test_patterns.c
   1.1.4.1    +9 -0      src/usr.bin/tar/test/test_patterns_2.tgz.uu (new)
   1.1.4.1    +8 -0      src/usr.bin/tar/test/test_patterns_3.tgz.uu (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: kientzle 
State-Changed-When: Tue Sep 2 06:54:03 UTC 2008 
State-Changed-Why:  
This has been fixed in -CURRENT, 7-STABLE, and 6-STABLE. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=117909 
>Unformatted:
