Bug 10641

Summary: tar doesn't untar through symlinks, it overwrites them
Product: [Retired] Red Hat Linux Reporter: pebal
Component: tarAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: bruno
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-23 12:18:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description pebal 2000-04-07 17:16:09 UTC
tar currently doesn't seem to be following symlinks when extracting, but
overwriting them. For example:
cd /usr/src
mkdir temp
ln -s temp linux
tar xzf linux-2.3.99-pre3.tar.gz

...and you end up with linux as a real directory, instead of the files
being put in temp.

Am I on crack? - tested on a NetBSD box and this worked as expected.
- Andy

Comment 1 Tim Waugh 2000-04-14 14:24:59 UTC
I think the rationale is this:

If a file in a tar file is a symbolic link, it will be extracted as a symbolic
link.  Otherwise, it won't. ;-)

Comment 2 Bzizou 2000-04-28 10:23:59 UTC
I confirm.
If a file into a tar is in a directory, and that directory on the system is a
symlink, tar overwrites the link and changes it into a directory when you
extract the file. Tested on a RH 5.2, it doesn't do that and follows well the
symlink. It's probably a bug of gnu tar 1.13.17.

Comment 3 Bernhard Rosenkraenzer 2000-06-23 12:18:17 UTC
I suspect it's a posix compliacne fix actually... I'll check.

Comment 4 Bernhard Rosenkraenzer 2000-08-04 13:02:05 UTC
Yes, it's a POSIX feature, not a bug.