bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] Unable to remove directory with listed-incremental


From: Alex Adriaanse
Subject: [Bug-tar] Unable to remove directory with listed-incremental
Date: Tue, 11 Nov 2003 22:27:20 -0600

Hi,

Consider this scenario in GNU tar 1.13.25 (also happens in 1.13.90), under
Linux 2.4.22:

$ mkdir test
$ mkdir test/dir
$ tar cvfg test-1.tar list test
tar: test/dir: Directory is new
test/
test/dir/
$ rmdir test/dir
$ tar cvfg test-2.tar list test
test/
$ rmdir test
$ tar xvfG test-1.tar
test/
test/dir/
$ tar xvfG test-2.tar
test/
tar: Deleting `test/dir'
tar: test/dir: Cannot remove: Is a directory
tar: Error exit delayed from previous errors

Since it looked like it'd be pretty easy to fix, I decided to go in and see
if I could quickly fix this.  The following changes (patch against 1.13.25)
seem to get rid of this problem:

diff -urN tar-1.13.25/src/misc.c tar-1.13.25.new/src/misc.c
--- tar-1.13.25/src/misc.c      Sun Aug 26 18:14:26 2001
+++ tar-1.13.25.new/src/misc.c  Tue Nov 11 22:18:03 2003
@@ -259,7 +259,11 @@
     {
       if (unlink (path) == 0)
        return 1;
+#if defined EISDIR
+      if (errno != EPERM && errno != EISDIR)
+#else
       if (errno != EPERM)
+#endif
        return 0;
     }

Alex





reply via email to

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