[Top][All Lists]

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

Re: Dangerous: delete-file deletes current directory as root!!

From: Francesco Potorti`
Subject: Re: Dangerous: delete-file deletes current directory as root!!
Date: Sun, 13 Oct 2002 19:20:38 +0200

> > > Now, I'm not sure what `delete-file' should do.  Should it mimic `unlink'
> > > or should it first check that it is not called on a directory ?
> > Definitely the second one.
> Do you mean it for all cases, or only for interactive use ?

I mean for all cases.  If we ever want to provide unlink(2) complete
functionality from inside Emacs (which I am not sure it is wise), we
should use a different function for that purpose.

> You say "I really mean it" but obviously you're not aware of the dangers
> since you think it's no more dangerous than running a shell.  You don't
> realize the amount of code Emacs uses for the simplest operations
> and how many hooks and tricks it provides, all of them designed for
> the user's convenience but with very little thought given to the
> security implications ot to the case when the user is root (and
> can thus do things that would normally fail, as in your case).

I agree with what you say (also in the following, that I cut), but my
conclusions are different, based on experience.  For many years I have
run Emacs as root in a dedicated text console and in a dedicated X
frame, as I often do system management.  While I do not do almost
anything as root that I could do as a normal user, I happen to use Emacs
as root daily on GNU/Linux, and this is the first time I have used it on
Sun.  The only difference between the two environments should be the
kernel and library.

In practice, I found that Emacs on GNU/Linux protects me better than the
shell does, when I am acting as root.

reply via email to

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