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

Re: OT: the rm bug hit me again

On Mon, 2006-10-30 at 09:52 +0000, Nigel Wade wrote:
> Jeff Vian wrote:
> > On Fri, 2006-10-27 at 14:41 +0100, Nigel Wade wrote:
> >> Mike McCarty wrote:
> >>> Arthur Pemberton wrote:
> >>>> On 10/25/06, Robin Laing <Robin Laing drdc-rddc gc ca> wrote:
> >>>>
> >>>>> Graphical file manager?  That isn't the *nix way of doing things.  :)
> >>>>>
> >>>>> And the -f in the rm command it to stop the "Confirm delete?" questions.
> >>>>>    My rm is set to confirm all deletes using alias.
> >>>>>
> >>>>> -- 
> >>>>
> >>>> How exactly did you do this? I got bit by this bug once in my Linux
> >>>> life, would prefer it never happens again.
> >>>>
> >>> alias rm='rm -i'
> >>>
> >> That's not a good idea as it teaches you to expect to be prompted, and you'll be 
> >> bitten badly some time when the alias isn't present.
> >>
> > Strange that you feel this is wrong.
> I just think it's dangerous to become reliant on that non-standard behaviour of 
> a potentially very dangerous command. If you expect the prompt when you wildcard 
That command has been there, with the same dangers since the beginning
of *nix.  I guess most users can do what they want without trashing
systems so please stifle the moans and groans about danger.

> rm, then you'll suffer when it isn't there. At first it might start out as a 
> useful safeguard, but over time you will become subconsciously trained to expect 
> it. You get used to typing 'rm *' and answering 'y' to those files you want to 
> be deleted, until you do that on a system where the alias isn't present, or you 
> are logged on as a user who doesn't have the alias.
> >   
> > Fedora has from the beginning done exactly that for the root user, and
> > the reason is to help prevent those type human errors when you are root
> > and have the power of god to destroy your system.
> I don't only use Linux/Fedora... Getting used to a "feature" of one system, and 
> then expecting it on another, is a route to disaster with a command like rm.
> > 
> > For me, I never run as root unless absolutely necessary, and I always
> > preview my commands before I hit enter.
> It's not a root issue, it's a global issue. Any user can delete files by mistake 
> if they expect to be prompted when they wildcard rm.
As I said, I preview the commands.

So get the whole world using *nix to change the default behavior of
rm. ;-))  I doubt that will happen so your paranoia does not need to
infect the rest of us.

> > 
> > I personally like the prompt because it reminds me that I am running as
> > root.
> That's the worst of all positions to have the alias. A user who expects rm to 
> prompt will only delete their own files if it doesn't, a root user who expects 
> rm to prompt can delete the entire system if it doesn't. I would never, ever, 
> want to rely on non-standard behaviour of such a dangerous command. What will 
> you do if your root .bash_profile, or whatever script sets the alias for root, 
> gets deleted, modified or in some other way not executed? Or if you administer a 
> system which isn't running Fedora?
> It's better to train yourself to review any rm command with a wildcard in it, 
> than it is to get used to being prompted by rm.
You obviously did not note my earlier comment about my habits.
1. Only root has that alias (by default, and by design)
2. I only run as a normal user except when no other option exists

Since both conditions lead to not using that alias under normal
circumstances it would be difficult to become reliant on that behavior.

 Additionally, I would never want the alias if I were deleting a lot of
files, and if it _were_ set I would call rm as "\rm" so it used the
built in behavior when deleting a lot of files.  Living is dangerous, as
is running a computer when ill trained/ill experienced.

Please stifle the paranoia, accept what you are told, and allow others
to use the systems as they choose.  How you act is your choice, how
others act is also their choice. Caution is good, paranoia stifles

> -- 
> Nigel Wade, System Administrator, Space Plasma Physics Group,
>              University of Leicester, Leicester, LE1 7RH, UK
> E-mail :    nmw ion le ac uk
> Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

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