Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#95395: additions to the rm 10 second pause

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   

Messages sorted by: Reverse Date, Date, Thread, Author