[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] segfault on solaris 11.1 with --remove-files in current di
From: |
Paul Eggert |
Subject: |
Re: [Bug-tar] segfault on solaris 11.1 with --remove-files in current directory |
Date: |
Tue, 29 Apr 2014 14:30:23 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
Thanks for reporting that. It's a bug on GNU/Linux too. I installed
the attached patch; please give it a try if you have the time.
I should mention that older versions of GNU tar did not try to remove
directories in this case, which explains why you didn't see a problem
with tar trying to remove ".". With the fix, tar will complain that it
can't remove ".", which is arguably the correct behavior. To have the
fixed tar remove "." without complaining, please use the -C option,
e.g., something like this:
$ mkdir test
$ touch test/foo
$ tar --remove-files -cf test.tar -C test .
$ ls -al test
ls: cannot access test: No such file or directory
$ tar -tvf test.tar
drwxr-xr-x eggert/eggert 0 2014-04-29 14:26 ./
-rw-r--r-- eggert/eggert 0 2014-04-29 14:26 ./foo
0001-tar-do-not-dereference-NULL-pointer-with-remove-file.patch
Description: Text Data