bug-bash
[Top][All Lists]
Advanced

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

Fwd: Bug: rm -rf /*/*


From: Robert Swinford
Subject: Fwd: Bug: rm -rf /*/*
Date: Tue, 30 Nov 2021 14:53:12 -0600

TWIMC:

This seems like a bug: https://twitter.com/nixcraft/status/1465599844299411458

I was able to replicate the behavior in a container with coreutils version 8.30 
and bash 5.0.

Interestingly, however, rm -rf // only does the following (and globbing in zsh 
evals /*/* to //):

"root@test:~# rm -rf //
rm: it is dangerous to operate recursively on '//' (same as '/')
rm: use --no-preserve-root to override this failsafe”
 
I don’t think anything in POSIX demands bash's behavior, and I believe illumos 
has already solved this problem in a POSIX compliant fashion, by failing when 
the user tries to remove the current working directory, see: 
https://www.youtube.com/watch?v=l6XQUciI-Sc&t=4903s

I also submitted this report to GNU coreutils.

Appreciate your attention to this bug!

--
----------------------------------------------
ROBERT SWINFORD
----------------------------------------------
robert.swinford@gmail.com <mailto:robert.swinford@gmail.com>
m: (405) 209-2339
----------------------------------------------

> Begin forwarded message:
> 
> From: Robert Swinford <robert.swinford@gmail.com>
> Subject: Re: Bug: rm -rf /*/*
> Date: November 30, 2021 at 2:08:35 PM CST
> To: bug-coreutils@gnu.org
> 
> BTW, zsh globbing doesn’t exhibit this behavior!  It seems it is only a 
> problem in bash.
> 
> --
> ----------------------------------------------
> ROBERT SWINFORD
> ----------------------------------------------
> robert.swinford@gmail.com
> m: (405) 209-2339
> ----------------------------------------------
> 
>> On Nov 30, 2021, at 1:58 PM, Robert Swinford <robert.swinford@gmail.com> 
>> wrote:
>> 
>> TWIMC:
>> 
>> This seems like a bug: 
>> https://twitter.com/nixcraft/status/1465599844299411458
>> 
>> I was able to replicate the behavior in a container with coreutils version 
>> 8.30.
>> 
>> Interestingly, however, rm -rf // only does the following:
>> 
>> "root@test:~# rm -rf //
>> rm: it is dangerous to operate recursively on '//' (same as '/')
>> rm: use --no-preserve-root to override this failsafe"
>> 
>> I believe illumos has already solved this problem in a POSIX compliant 
>> fashion, see: https://www.youtube.com/watch?v=l6XQUciI-Sc&t=4903s
>> 
>> Appreciate your attention to this bug!
>> 
>> --
>> ----------------------------------------------
>> ROBERT SWINFORD
>> ----------------------------------------------
>> robert.swinford@gmail.com
>> m: (405) 209-2339
>> ----------------------------------------------
>> 
> 



reply via email to

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