[comp.emacs] Socket created by emacsclient server

thakur%cfa201@HARVARD.HARVARD.EDU (Manavendra K. Thakur) (11/09/88)

By loading and running the emacsclient server, you create a socket in
your home directory which is used for the interaction between emacs
and the calling process.

Unfortunately, if you exit emacs, this socket, which in my case has
777 permission, still sits around.  There's nothing to delete it.

Is there anyone who can shed some light on how to delete this socket
automatically (is there an equivalent of the .logout file for emacs)?
It would be best to only create the socket as it was needed (i.e.
only when emacs was called by the client), and then delete it as the
when the client exits, but this may not be possible.

With the recent virus attacks in mind, it seems that leaving this
socket open could present a potential problem.  Much as I dislike the
notion of clamping down on security, I have to admit that I didn't
like running around all day trying to eliminate the effects of the
virus (we did get hit).  It seems to me that we can still preserve an
open computing environment in the Richard Stallman tradition but still
take minimal precautions (like deleting unused sockets lying around)
to prevent such attacks in the future.

Thoughts, comments, suggestions, anyone?

                                Manavendra K. Thakur
                                thakur@cfa200.harvard.edu
                                thakur%cfa@harvard.harvard.edu

barmar@think.COM (Barry Margolin) (11/09/88)

In article <8811081614.AA18577@EDDIE.MIT.EDU> thakur%cfa201@HARVARD.HARVARD.EDU (Manavendra K. Thakur) writes:
>Is there anyone who can shed some light on how to delete this socket
>automatically (is there an equivalent of the .logout file for emacs)?
>It would be best to only create the socket as it was needed (i.e.
>only when emacs was called by the client), and then delete it as the
>when the client exits, but this may not be possible.

It's definitely not possible.  This socket is the mechanism by which
emacsclient invokes the emacs server.  The emacs server is constantly
waiting in the background for a message to come over the socket.

>With the recent virus attacks in mind, it seems that leaving this
>socket open could present a potential problem.

Leaving the socket open after emacs exits is not a problem, because
there's nobody listening to what anyone sends.  However, you did point
out that the access on the socket is 777, which is a security problem
while emacs IS running.  It means that anyone can cause your emacs
server to start editing a file; if emacsclient accepts -f and -l
arguments (I don't know offhand whether it does), it means that anyone
can cause your emacs process to execute arbitrary code.  I can't
imagine any reason why the access on the socket should be anything but
700.

Barry Margolin
Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar