Subject: bin/36275: tar -s modifies symlink targets
To: None <,>
From: None <>
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
>Release:        NetBSD 4.0_BETA2
	Iowa Staye University
System: NetBSD 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC.MP) #2: Mon Apr 2 17:21:48 CDT 2007 i386
Architecture: i386
Machine: i386
	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'.


	ls -l /etc/rmt
	lrwxr-xr-x 1 root wheel 13 Mar 29 19:41 /etc/rmt -> /usr/sbin/rmt


	tar cCP /etc -s ',^,/etc/,p' --file - rmt | tar tvPf -


	rmt >> /etc/rmt
        lrwxr-xr-x 1 root wheel 0 Mar 29 19:41 /etc/rmt -> /etc//usr/sbin/rmt