Subject: bin/36275: tar -s modifies symlink targets
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <john@iastate.edu>
List: netbsd-bugs
Date: 05/04/2007 13:40:00
>Number: 36275
>Category: bin
>Synopsis: tar -s modifies symlink targets
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 04 13:40:00 +0000 2007
>Originator: john@iastate.edu
>Release: NetBSD 4.0_BETA2
>Organization:
Iowa Staye University
>Environment:
System: NetBSD new-netreg-1.its.iastate.edu 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC.MP) #2: Mon Apr 2 17:21:48 CDT 2007 root@draal.ait.iastate.edu:/usr/obj/4.0/kern/i386/GENERIC.MP i386
Architecture: i386
Machine: i386
>Description:
Using the '-s replstr' option not only modifies the
archive member names as documented, but if any of
those members are symlinks it also modifies the
target of the symlink. This behavior is surprising,
undocumented, and not shown when the 'p' modifier
is added to the 'replstr'.
>How-To-Repeat:
given:
ls -l /etc/rmt
lrwxr-xr-x 1 root wheel 13 Mar 29 19:41 /etc/rmt -> /usr/sbin/rmt
then:
tar cCP /etc -s ',^,/etc/,p' --file - rmt | tar tvPf -
produces:
rmt >> /etc/rmt
lrwxr-xr-x 1 root wheel 0 Mar 29 19:41 /etc/rmt -> /etc//usr/sbin/rmt
>Fix:
Unknown