bug#52206: Bug: rm -rf /*/*

2021-12-01 Thread Paul Eggert

Thanks for explaining. As this is not an rm bug, I'm closing the bug report.





bug#52206: Bug: rm -rf /*/*

2021-11-30 Thread Bob Proulx
Bob Proulx wrote:
> Paul Eggert wrote:
> > Robert Swinford wrote:
> > > BTW, zsh globbing doesn’t exhibit this behavior!  It seems it is only a 
> > > problem in bash.
> >
> > In that case, the bug (whatever it is) wouldn't be a coreutils bug.
>
> I don't understand the comment that zsh doesn't expand the glob /*/*
> and I tried it and verified that it does indeed expand that glob
> sequence.

Lawrence Velazquez made sense of this on the bug-bash list.

https://lists.gnu.org/archive/html/bug-bash/2021-11/msg00193.html

Bob





bug#52206: Bug: rm -rf /*/*

2021-11-30 Thread Bob Proulx
Paul Eggert wrote:
> Robert Swinford wrote:
> > This seems like a bug: 
> > https://twitter.com/nixcraft/status/1465599844299411458
> 
> I don't see a coreutils bug there: rm operated as specified.

Agreed.  It's not an rm bug.  It's definitely unfortunate.  It's
similarly unfortunate to riding a bicycle into a lake.  But it isn't a
defect in the bicycle that it could not prevent someone from riding it
into a lake.

> > Interestingly, however, rm -rf // only does the following:
> 
> Yes, that's a special feature of GNU rm.

And apparently Bryan Cantrill reports that Solaris has the same
feature as GNU rm does for "rm -rf /" protection.

> > I believe illumos has already solved this problem in a POSIX compliant 
> > fashion
> 
> Not sure what you're talking about here. Could you be specific? Don't have
> time to watch videos.

I watched the cited video.  It features an interview with Bryan
Cantrill who very dynamically and entertainingly tells a story about a
scripted "rm -rf $1/$2" without checking if $1 and $2 were set or
unset resulting in "rm -rf /" being run by accident.  And therefore he
reports that Solaris implemented the prevention of running "rm -rf /".
This is said at time 1:27:00 in the video.  Which I note is the same
protection as GNU rm does.  So there isn't anything for GNU rm to
implement in order to match Solaris as it appears to be the same by
this report.

However $var1/$var2 expanding to / when those variables are not set is
a different case than /*/* expansion which has no variables and is
simply an error of usage.

> > BTW, zsh globbing doesn’t exhibit this behavior!  It seems it is only a 
> > problem in bash.
> 
> In that case, the bug (whatever it is) wouldn't be a coreutils bug.

I don't understand the comment that zsh doesn't expand the glob /*/*
and I tried it and verified that it does indeed expand that glob
sequence.

Bob





bug#52206: Bug: rm -rf /*/*

2021-11-30 Thread Paul Eggert

On 11/30/21 11:58, Robert Swinford wrote:


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


I don't see a coreutils bug there: rm operated as specified.


Interestingly, however, rm -rf // only does the following:


Yes, that's a special feature of GNU rm.


I believe illumos has already solved this problem in a POSIX compliant fashion


Not sure what you're talking about here. Could you be specific? Don't 
have time to watch videos.



BTW, zsh globbing doesn’t exhibit this behavior!  It seems it is only a problem 
in bash.


In that case, the bug (whatever it is) wouldn't be a coreutils bug.





bug#52206: Bug: rm -rf /*/*

2021-11-30 Thread Robert Swinford
BTW, zsh globbing doesn’t exhibit this behavior!  It seems it is only a problem 
in bash.

--
--
ROBERT SWINFORD
--
robert.swinf...@gmail.com
m: (405) 209-2339
--

> On Nov 30, 2021, at 1:58 PM, Robert Swinford  
> 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=4903s
> 
> Appreciate your attention to this bug!
> 
> --
> --
> ROBERT SWINFORD
> --
> robert.swinf...@gmail.com
> m: (405) 209-2339
> --
> 






bug#52206: Bug: rm -rf /*/*

2021-11-30 Thread Robert Swinford
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=4903s

Appreciate your attention to this bug!

--
--
ROBERT SWINFORD
--
robert.swinf...@gmail.com
m: (405) 209-2339
--