Subject: bin/24611: tar -C fails for extraction with file patterns
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kristerw@netbsd.org>
List: netbsd-bugs
Date: 03/01/2004 00:43:18
>Number:         24611
>Category:       bin
>Synopsis:       tar -C fails for extraction with file patterns
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 01 00:44:02 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Krister Walfridsson
>Release:        NetBSD 1.6ZK
>Organization:
	
>Environment:
	
	
NetBSD 1.6ZK (KWA) #0: Mon Feb 23 23:05:34 CET 2004  cato@pc2:/usr/local/tmp/nbsd040223/src/sys/arch/amd64/compile/KWA
>Description:
tar extraction fails for invocations like:

   tar xf foo.tar -C /some/dir dirname

What happens is that tar chdir into the /some/dir when the files and
directories are created.   The directory names are stored in a list,
so that the flags etc. can be fixed up after the extraction.
The names in the list are however not adjusted to /some/dir, so this
fix-up fails, as it is done in the current dir.
>How-To-Repeat:
$ cd /tmp
$ mkdir a
$ touch a/1
$ tar cf a.tar a
$ rm -rf a
$ mkdir b
$ tar xf a.tar -C /tmp/b a
tar: Access/modification time set failed on: a (No such file or directory)
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: