Bug 25012

Summary: tar(1) as root does not preserve ownership of symlinks
Product: Base System Reporter: Martin Kammerhofer <mkamm>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Martin Kammerhofer 2001-02-11 22:50:01 UTC
Tar is supposed to preserve owner/group when invoked as root.
This does not work for extracted symlinks.

Note: FreeBSD's cpio(1) from the base system and gtar from the ports
collection can do that.

How-To-Repeat: 
As root do:
# ln -sf /1/2/3 slink
# chown -h nobody:nogroup slink
# ls -l slink
lrwxr-xr-x   1 nobody  nogroup  -      6 11 Feb 23:35 slink@ -> /1/2/3
# tar cf slink.tar slink
# rm -f slink
# tar xf slink.tar
# ls -l slink
lrwxr-xr-x   1 root    wheel    -      6 11 Feb 23:35 slink@ -> /1/2/3
Comment 1 Maxim Sobolev freebsd_committer freebsd_triage 2002-06-04 18:41:31 UTC
State Changed
From-To: open->patched

More modern tar which was just imported into the 5.0-CURRENT doen't have this 
problem. The problem will be fully resolved when tar upgrade is MFCed in 
about 1 month.
Comment 2 Johan Karlsson freebsd_committer freebsd_triage 2002-08-22 18:19:21 UTC
State Changed
From-To: patched->closed

GNU tar 1.13.25 has been MFCed.