GNU bug report logs -
#15926
RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Tue, 19 Nov 2013 11:58:02 UTC
Severity: normal
Tags: notabug, patch
Merged with 15943
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 11/25/2013 08:31 AM, Bernhard Voelker wrote:
> On 11/25/2013 02:10 AM, Pádraig Brady wrote:
>> So this might race with rm being preempted between the touch() and the exit(),
>> causing a false failure? It's probably best to not kill if the 'x' file exists,
>> as it's very unlikely that rm will run as normal in that case.
>
> outch, the race is even more likely for the newly added "rm -r file1 / file2"
> case where unlinkat() is called twice without the immediate _exit() due to
> CU_TEST_SKIP_EXIT=1.
>
> I have to reconsider, but won't have time for that today.
Hi Padraig,
I simplified it by using timeout(1), as you already suggested:
if [ "$CU_TEST_SKIP_EXIT" = 1 ]; then
# Pass on this variable into 'rm's environment.
skip_exit='CU_TEST_SKIP_EXIT=1'
fi
timeout --signal=KILL 2 \
env LD_PRELOAD=./k.so $skip_exit \
rm -rv --one-file-system "$@" > out 2> err
I also changed the other things you mentioned.
Finally, I had to pass --interactive=never to the last test to
avoid the "descend into write-protected directory?" prompt.
This is since rm has been executed in the background.
Next try attached.
Have a nice day,
Berny
[tests-add-a-test-for-rm-r-root-v3.patch (text/x-patch, attachment)]
This bug report was last modified 6 years and 225 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.