diff options
author | brian <brian@FreeBSD.org> | 1997-11-09 22:07:29 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-09 22:07:29 +0000 |
commit | 2b9bf8e847ee672175481e6ae9672a8fb77c6cbe (patch) | |
tree | bf499910d5419dd8e66dc668c6dc489fbf4e7fef /usr.sbin/ppp/server.c | |
parent | 1fb35097709343deb39e78c2a838bf9a64df4996 (diff) | |
download | FreeBSD-src-2b9bf8e847ee672175481e6ae9672a8fb77c6cbe.zip FreeBSD-src-2b9bf8e847ee672175481e6ae9672a8fb77c6cbe.tar.gz |
Don't create a diagnostic socket by default.
Allow a password spec on the "set server" command line.
Use SIGUSR2 to close the diagnostic socket.
Some man page corrections.
Diffstat (limited to 'usr.sbin/ppp/server.c')
-rw-r--r-- | usr.sbin/ppp/server.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c index abd8ba9..b6869b8 100644 --- a/usr.sbin/ppp/server.c +++ b/usr.sbin/ppp/server.c @@ -1,5 +1,5 @@ /* - * $Id: server.c,v 1.7 1997/11/09 06:22:47 brian Exp $ + * $Id: server.c,v 1.8 1997/11/09 14:18:51 brian Exp $ */ #include <sys/param.h> @@ -26,7 +26,7 @@ #include "log.h" #include "id.h" -int server = -2; +int server = -1; static struct sockaddr_un ifsun; static char *rm; @@ -61,9 +61,11 @@ ServerLocalOpen(const char *name, mode_t mask) return 3; } setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &s, sizeof s); - mask = umask(mask); + if (mask != (mode_t)-1) + mask = umask(mask); if (bind(s, (struct sockaddr *) & ifsun, sizeof(ifsun)) < 0) { - umask(mask); + if (mask != (mode_t)-1) + umask(mask); LogPrintf(LogERROR, "Local: bind: %s\n", strerror(errno)); if (errno == EADDRINUSE && VarTerm) fprintf(VarTerm, "Wait for a while, then try again.\n"); @@ -71,7 +73,8 @@ ServerLocalOpen(const char *name, mode_t mask) ID0unlink(name); return 4; } - umask(mask); + if (mask != (mode_t)-1) + umask(mask); if (listen(s, 5) != 0) { LogPrintf(LogERROR, "Local: Unable to listen to socket - OS overload?\n"); close(s); |