Subject: bin/24611: tar -C fails for extraction with file patterns
To: None <>
From: None <>
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
>Originator:     Krister Walfridsson
>Release:        NetBSD 1.6ZK
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
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.
$ 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)