Bug 10641 - tar doesn't untar through symlinks, it overwrites them
Summary: tar doesn't untar through symlinks, it overwrites them
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tar
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-04-07 17:16 UTC by pebal
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-06-23 12:18:19 UTC
Embargoed:


Attachments (Terms of Use)

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.


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