Valdis.Kletnieks(a)vt.edu wrote:
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 ;)
If we fix the docs to match the code, the '#ifdef USE_TMPDIR' stuff
may as well go (the definition is currently hardcoded at the top of
gnuserv.h), unless we're planning on preprocessing the manpages.
I made this change a couple of years back as part of a general
campaign against /tmp; in retrospect, it would probably have been
better to have changed it to "~/.gsrvdir". NB: by "~", I mean
"getpwuid(geteuid())->pw_dir"; gnuclient already relies upon the euids
matching. Actually, it's the euid for Unix sockets but the (real) uid
for TCP sockets.
So, my suggestion would be to fix both code and docs to match
something sane ;)
And to add a switch to gnuclient to allow an explicit pathname; it
already has -h/-p for TCP sockets (and $GNU_HOST/$GNU_PORT, although
they could presumably suffer from the problem which you describe).
--
Glynn Clements <glynn(a)sensei.co.uk>