bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] extracting broken symlinks


From: Eric Blake
Subject: [Bug-tar] extracting broken symlinks
Date: Tue, 21 Aug 2007 13:51:46 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This bug was originally reported on the cygwin list.  It looks like a bug
when extracting broken symlinks that point to destinations outside the
tar'd directory:

$ tar --version | head -n1
tar (GNU tar) 1.18
$ mkdir /tmp/tar
$ cd /tmp/tar
$ ln -s ../nowhere broken
$ tar cf bad.tar broken
$ rm broken
$ ls ../nowhere *
ls: cannot access ../nowhere: No such file or directory
bad.tar
$ tar xvpf bad.tar
broken
$ ls ../nowhere *
ls: cannot access ../nowhere: No such file or directory
bad.tar  broken
$ tar xvpf bad.tar
broken
$ ls ../nowhere *
../nowhere  bad.tar  broken
$ ls -lF ../nowhere *
- ---------- 1 eblake None     0 Aug 21 13:47 ../nowhere
- -rw-r--r-- 1 eblake None 10240 Aug 21 13:46 bad.tar
lrwxrwxrwx 1 eblake None    10 Aug 21 13:47 broken -> ../nowhere


In other words, when expanding the tar file where the broken symlink does
not exist, only the broken symlink is created (as expected).  But when
expanding the tar file where the broken symlink already resides, a 0-byte
inaccessible file is mistakenly created at the location pointed to by the
broken symlink.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGy0JR84KuGfSFAYARAqNaAJ0bWUncmHMr2UKUGOH0SNKcA9ngYgCfWj8z
9IiOYjHiMhTIUvSJfmDjq40=
=RROp
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]