Bug 10641 - tar doesn't untar through symlinks, it overwrites them
tar doesn't untar through symlinks, it overwrites them
Product: Red Hat Linux
Classification: Retired
Component: tar (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Depends On:
  Show dependency treegraph
Reported: 2000-04-07 13:16 EDT by pebal
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-06-23 08:18:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description pebal 2000-04-07 13:16:09 EDT
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 10:24:59 EDT
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 06:23:59 EDT
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 08:18:17 EDT
I suspect it's a posix compliacne fix actually... I'll check.
Comment 4 Bernhard Rosenkraenzer 2000-08-04 09:02:05 EDT
Yes, it's a POSIX feature, not a bug.

Note You need to log in before you can comment on or make changes to this bug.