zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#95395: additions to the rm 10 second pause
       [not found] <200104270259.f3R2xrax021179@photino.sid.rice.edu>
@ 2001-04-27 14:42 ` Clint Adams
  2001-04-27 15:59   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Clint Adams @ 2001-04-27 14:42 UTC (permalink / raw)
  To: Rahul Jain, 95395; +Cc: zsh-workers

> 'rm /' and 'rm -d' should also fall under the same category as 'rm *' with the
> 10 second pause feature.

Maybe this can be better solved by a mechanism that lets one define
a pattern to trigger a generic form of RM_STAR_WAIT or such.

e.g.
alias rm="panic-on --pattern '*-d*' -- rm"

Or is there value in adding these to execcmd?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug#95395: additions to the rm 10 second pause
  2001-04-27 14:42 ` Bug#95395: additions to the rm 10 second pause Clint Adams
@ 2001-04-27 15:59   ` Bart Schaefer
  2001-04-27 18:56     ` Rahul Jain
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2001-04-27 15:59 UTC (permalink / raw)
  To: Clint Adams, Rahul Jain, 95395; +Cc: zsh-workers

On Apr 27, 10:42am, Clint Adams wrote:
} Subject: Re: Bug#95395: additions to the rm 10 second pause
}
} > 'rm /' and 'rm -d' should also fall under the same category as 'rm *'
} > with the 10 second pause feature.
} 
} Maybe this can be better solved by a mechanism that lets one define
} a pattern to trigger a generic form of RM_STAR_WAIT or such.

Sigh.  This could be best solved by throwing out RM_STAR_xxx entirely, as
there's no way to make everybody happy about it and we shouldn't mislead
them into thinking we'll try.

For example, `/bin/rm *' doesn't warn or wait either.  Are we also going
to pattern-match on the command name?

What about `find pat -exec rm -r {} \;' ?

} e.g.
} alias rm="panic-on --pattern '*-d*' -- rm"

In that case you might as well just write your own `rm' function to handle
the behavior, as `command rm' or `\rm' will bypass the alias anyway.  The
main reason to have it in execcmd is to reduce the number of ways you can
accidentally disable the check.

} Or is there value in adding these to execcmd?

I'd be willing to add '/', but I don't believe we should be checking any
sort of option strings.  If you're already super-user and doing `rm -d'
where you shouldn't be, you're in deeper trouble than zsh can possibly dig
you out of.  RM_STAR_xxx was added because zsh was originally deployed at
Princeton and used by students who often didn't know what they were doing;
people with root privileges better not be in that category, nor should
they rely on their shell to prevent them from doing something stupid.

My vote is to leave this unchanged and possibly add a FAQ entry about it,
as this is not the first time it's come up.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug#95395: additions to the rm 10 second pause
  2001-04-27 15:59   ` Bart Schaefer
@ 2001-04-27 18:56     ` Rahul Jain
  0 siblings, 0 replies; 3+ messages in thread
From: Rahul Jain @ 2001-04-27 18:56 UTC (permalink / raw)
  To: Bart Schaefer, Clint Adams, 95395, zsh-workers

On Fri, Apr 27, 2001 at 03:59:02PM +0000, Bart Schaefer wrote:
> On Apr 27, 10:42am, Clint Adams wrote:
> } Or is there value in adding these to execcmd?
> 
> I'd be willing to add '/', but I don't believe we should be checking any
> sort of option strings.  If you're already super-user and doing `rm -d'
> where you shouldn't be, you're in deeper trouble than zsh can possibly dig
> you out of.  RM_STAR_xxx was added because zsh was originally deployed at
> Princeton and used by students who often didn't know what they were doing;
> people with root privileges better not be in that category, nor should
> they rely on their shell to prevent them from doing something stupid.
> 
> My vote is to leave this unchanged and possibly add a FAQ entry about it,
> as this is not the first time it's come up.

Upon further consideration, I agree that only '/' really needs to be added. The
only need of this feature is to prevent accidents, and if you are using -d,
it's probably not by accident, and if IS an accident, you're root, so that's
your own problem. So, in short, yeah. :)

-- 
-> -/-                       - Rahul Jain -                       -\- <-
-> -\- http://linux.rice.edu/~rahul -=- mailto:rahul-jain@usa.net -/- <-
-> -/- "I never could get the hang of Thursdays." - HHGTTG by DNA -\- <-
|--|--------|--------------|----|-------------|------|---------|-----|-|
   Version 11.423.999.220020101.23.50110101.042
   (c)1996-2000, All rights reserved. Disclaimer available upon request.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-04-27 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200104270259.f3R2xrax021179@photino.sid.rice.edu>
2001-04-27 14:42 ` Bug#95395: additions to the rm 10 second pause Clint Adams
2001-04-27 15:59   ` Bart Schaefer
2001-04-27 18:56     ` Rahul Jain

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).