i think the proper behavior is to always use /tmp, provided it exists and is
world-writable; only fall back on environment variables otherwise. the reason
for this is precisely to avoid problems like this -- we want a "well-defined
location".
but it may be more pragmatic to just change the docs.
Valdis.Kletnieks(a)vt.edu wrote:
OK.. This may or may not be a bug, but it certainly needs to at least
be documented..
Scenario:
Launch 'xemacs' and load gnuserv-start from .xession, with no TMPDIR
environment variable set. So gnuserv opens /tmp/gsrvdir967/gsrv as the
socket to use.
Another program (exmh) then tries to launch 'gnuclient' - but exmh
has set TMPDIR to /tmp/valdis. So it tries to open /tmp/valdis/gsrvdir/gsrv
and promptly loses.
I had to read the source for lib-src/gnuslib.c (in connect_to_unix_server()
to figure out what was going on. 'info gnuclient' says this:
UNIX-DOMAIN SOCKETS
A Unix-domain socket is used to communicate between gnu
client and gnuserv if the symbol UNIX_DOMAIN_SOCKETS is
defined at the top of gnuserv.h. A file called
/tmp/gsrvdir????/gsrv is created for communication and if
deleted will cause communication between server and client
to fail. Only the user running gnuserv will be able to
connect to the socket.
Hm.. No mention of TMPDIR as an environment variable there...
So - who wants to make the call? Fix the docs to match the code, or
fix the code to match the docs? I'll accept either one, as long as
they agree ;)
--
Valdis Kletnieks
Operating Systems Analyst
Virginia Tech
--------------------------------------------------------------------------------
Part 1.2Type: application/pgp-signature
--
ben
I'm sometimes slow in getting around to reading my mail, so if you
want to reach me faster, call 520-661-6661.
See
http://www.666.com/ben/chronic-pain/ for the hell I've been
through.