Re: tar: symlinks unpacked to empty files (tar security problem?)

2010-07-09 Thread Christopher Faylor
On Fri, Jul 09, 2010 at 06:26:18PM -0600, Eric Blake wrote: >On 07/04/2010 11:17 AM, Christopher Faylor wrote: >> On Sun, Jul 04, 2010 at 04:50:41AM -0500, Yaakov (Cygwin/X) wrote: >>> With tar-1.23-1 and recent snapshot: >>> >>> echo foo > foo >>> ln -s $PWD/foo bar >>> tar cf test.tar bar foo >>>

Re: tar: symlinks unpacked to empty files (tar security problem?)

2010-07-09 Thread Eric Blake
On 07/04/2010 11:17 AM, Christopher Faylor wrote: > On Sun, Jul 04, 2010 at 04:50:41AM -0500, Yaakov (Cygwin/X) wrote: >> With tar-1.23-1 and recent snapshot: >> >> echo foo > foo >> ln -s $PWD/foo bar >> tar cf test.tar bar foo >> rm -f bar foo >> tar xf test.tar >> ls -l bar foo >> >> You will se

Re: tar: symlinks unpacked to empty files (tar security problem?)

2010-07-04 Thread Yaakov (Cygwin/X)
On Sun, 2010-07-04 at 13:17 -0400, Christopher Faylor wrote: > That's because of the way that tar handles symlinks. If you have a > reference to an absolute path, tar makes a zero-length regular file > placeholder. Then when it is done extracting, tar is supposed to remove > this file and create

Re: tar: symlinks unpacked to empty files (tar security problem?)

2010-07-04 Thread Christopher Faylor
On Sun, Jul 04, 2010 at 04:50:41AM -0500, Yaakov (Cygwin/X) wrote: >With tar-1.23-1 and recent snapshot: > >echo foo > foo >ln -s $PWD/foo bar >tar cf test.tar bar foo >rm -f bar foo >tar xf test.tar >ls -l bar foo > >You will see that 'bar' is a 0-byte file with permissions instead >of a syml

tar: symlinks unpacked to empty files

2010-07-04 Thread Yaakov (Cygwin/X)
With tar-1.23-1 and recent snapshot: echo foo > foo ln -s $PWD/foo bar tar cf test.tar bar foo rm -f bar foo tar xf test.tar ls -l bar foo You will see that 'bar' is a 0-byte file with permissions instead of a symlink. The symlink reference need not be absolute; it also happens with relativ