bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] tar 1.14 Deletes symlink, 1.15.1 Fails to.


From: Ralph Corderoy
Subject: [Bug-tar] tar 1.14 Deletes symlink, 1.15.1 Fails to.
Date: Sun, 21 Aug 2005 17:35:00 +0100

Hi,

I think 1.15.1's broken where 1.14 wasn't.

    #! /bin/bash

    set -ex

    $TAR --version

    rm -rf d d.orig db
    mkdir d
    >d/foo
    ln -s 1.2.3.4:80 d/lock
    find d -ls

    $TAR -cvf d.l0.tar -g db d
    rm d/lock
    $TAR -cvf d.l1.tar -g db d

    mv d d.orig

    $TAR -xvf d.l0.tar -g /dev/null
    $TAR -xvf d.l1.tar -g /dev/null || :

    diff -r d.orig d || :

Here's the output of running the above script on the two versions of tar
I have to hand.

    $ TAR=/bin/tar ./bug
    + /bin/tar --version
    tar (GNU tar) 1.14
    Copyright (C) 2004 Free Software Foundation, Inc.
    This program comes with NO WARRANTY, to the extent permitted by law.
    You may redistribute it under the terms of the GNU General Public License;
    see the file named COPYING for details.
    Written by John Gilmore and Jay Fenlason.
    + rm -rf d d.orig db
    + mkdir d
    + ln -s 1.2.3.4:80 d/lock
    + find d -ls
    1291938    4 drwxr-xr-x   2 ralph    ralph        4096 Aug 21 17:29 d
    1291939    0 -rw-r--r--   1 ralph    ralph           0 Aug 21 17:29 d/foo
    1291944    0 lrwxrwxrwx   1 ralph    ralph          10 Aug 21 17:29 d/lock 
-> 1.2.3.4:80
    + /bin/tar -cvf d.l0.tar -g db d
    d/
    d/foo
    d/lock
    + rm d/lock
    + /bin/tar -cvf d.l1.tar -g db d
    d/
    d/foo
    + mv d d.orig
    + /bin/tar -xvf d.l0.tar -g /dev/null
    d/
    d/foo
    d/lock
    + /bin/tar -xvf d.l1.tar -g /dev/null
    d/
    /bin/tar: Deleting `d/lock'
    d/foo
    + diff -r d.orig d
    $

All OK.

    $ TAR=~/src/tar/tar-1.15.1/src/tar ./bug
    + /home/ralph/src/tar/tar-1.15.1/src/tar --version
    tar (GNU tar) 1.15.1
    + rm -rf d d.orig db
    + mkdir d
    + ln -s 1.2.3.4:80 d/lock
    + find d -ls
    1291938    4 drwxr-xr-x   2 ralph    ralph        4096 Aug 21 17:29 d
    1291939    0 -rw-r--r--   1 ralph    ralph           0 Aug 21 17:29 d/foo
    1291944    0 lrwxrwxrwx   1 ralph    ralph          10 Aug 21 17:29 d/lock 
-> 1.2.3.4:80
    + /home/ralph/src/tar/tar-1.15.1/src/tar -cvf d.l0.tar -g db d
    d/
    d/foo
    d/lock
    + rm d/lock
    + /home/ralph/src/tar/tar-1.15.1/src/tar -cvf d.l1.tar -g db d
    d/
    d/foo
    + mv d d.orig
    + /home/ralph/src/tar/tar-1.15.1/src/tar -xvf d.l0.tar -g /dev/null
    d/
    d/foo
    d/lock
    + /home/ralph/src/tar/tar-1.15.1/src/tar -xvf d.l1.tar -g /dev/null
    d/
    /home/ralph/src/tar/tar-1.15.1/src/tar: d/lock: Cannot stat: No such file 
or directory
    /home/ralph/src/tar/tar-1.15.1/src/tar: d/lock: Not purging directory: 
unable to stat
    d/foo
    /home/ralph/src/tar/tar-1.15.1/src/tar: Error exit delayed from previous 
errors
    + :
    + diff -r d.orig d
    Only in d: lock
    + :
    $

1.15.1 is trying to stat d/lock when it knows it's a symlink and there's
no reason why the symlink's destination should exist.  diff shows that
d/lock has been left behind so my restore of my incremental backups is
incorrect.

Cheers,


Ralph.






reply via email to

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