Subject: bin/30168: NetBSD tar does not match filenames containing glob characters
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: J.T. Conklin <jtc@acorntoolworks.com>
List: netbsd-bugs
Date: 05/07/2005 21:06:01
>Number:         30168
>Category:       bin
>Synopsis:       NetBSD tar does not match filenames containing glob characters
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 07 21:06:00 +0000 2005
>Originator:     J.T. Conklin
>Release:        NetBSD 3.0_BETA
>Organization:
J.T. Conklin
>Environment:
	
	
System: NetBSD k8 3.0_BETA NetBSD 3.0_BETA (GENERIC) #0: Mon May  2 02:38:27 PDT 2005  jtc@k8:/home/jtc/netbsd/NetBSD-3/obj-amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
NetBSD tar's pattern matching doesn't seem to match filenames containing 
shell glob characters like '['.

>How-To-Repeat:
Suppose you wanted to extract only /bin/[ from base.tgz.  You might try:

    $ tar -zxvf base.tgz ./bin/\\[

(one \ is for the shell, the other to quote the [ for tar) which works
fine with GNU tar.  But NetBSD tar returns:

    tar: ustar vol 1, 3706 files, 68044800 bytes read, 0 bytes written in 1 secs (68044800 bytes/sec)
    tar: WARNING! These patterns were not matched:
    ./bin/\[

(Actually, it doesn't work 100% with GNU tar, nor will it with NetBSD
tar once this problem is resolved.  This is because ./bin/[ is a hard
link to ./bin/test which occurs first in the archive; when it gets to
./bin/[ there it's already skipped the contents.  Nothing can be done
about that...)

>Fix:
	

>Unformatted: