summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-09 22:07:29 +0000
committerbrian <brian@FreeBSD.org>1997-11-09 22:07:29 +0000
commit2b9bf8e847ee672175481e6ae9672a8fb77c6cbe (patch)
treebf499910d5419dd8e66dc668c6dc489fbf4e7fef /usr.sbin/ppp/main.c
parent1fb35097709343deb39e78c2a838bf9a64df4996 (diff)
downloadFreeBSD-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/main.c')
-rw-r--r--usr.sbin/ppp/main.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 3e80471..7224eb0 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.90 1997/11/09 14:18:45 brian Exp $
+ * $Id: main.c,v 1.91 1997/11/09 18:51:23 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -173,6 +173,7 @@ TtyOldMode()
void
Cleanup(int excode)
{
+ ServerClose();
OsInterfaceDown(1);
HangupModem(1);
nointr_sleep(1);
@@ -189,7 +190,6 @@ Cleanup(int excode)
close(BGFiledes[1]);
}
LogPrintf(LogPHASE, "PPP Terminated (%s).\n", ex_desc(excode));
- ServerClose();
TtyOldMode();
LogClose();
@@ -242,11 +242,21 @@ SetUpServer(int signo)
{
int res;
+ VarHaveLocalAuthKey = 0;
+ LocalAuthInit();
if ((res = ServerTcpOpen(SERVER_PORT + tunno)) != 0)
LogPrintf(LogERROR, "SIGUSR1: Failed %d to open port %d\n",
res, SERVER_PORT + tunno);
}
+static void
+BringDownServer(int signo)
+{
+ VarHaveLocalAuthKey = 0;
+ LocalAuthInit();
+ ServerClose();
+}
+
static char *
ex_desc(int ex)
{
@@ -396,6 +406,10 @@ main(int argc, char **argv)
if (mode != MODE_INTER)
pending_signal(SIGUSR1, SetUpServer);
#endif
+#ifdef SIGUSR2
+ if (mode != MODE_INTER)
+ pending_signal(SIGUSR2, BringDownServer);
+#endif
if (dstsystem) {
if (SelectSystem(dstsystem, CONFFILE) < 0) {
@@ -416,9 +430,6 @@ main(int argc, char **argv)
Cleanup(EX_SOCK);
}
}
- /* Create server socket and listen (initial value is -2) */
- if (server == -2)
- ServerTcpOpen(SERVER_PORT + tunno);
if (!(mode & MODE_DIRECT)) {
pid_t bgpid;
@@ -560,7 +571,6 @@ ReadTty()
Prompt();
} else {
LogPrintf(LogPHASE, "client connection closed.\n");
- LocalAuthInit();
mode &= ~MODE_INTER;
oVarTerm = VarTerm;
VarTerm = 0;
@@ -922,6 +932,7 @@ DoLoop()
} else
netfd = wfd;
VarTerm = fdopen(netfd, "a+");
+ LocalAuthInit();
mode |= MODE_INTER;
Greetings();
IsInteractive(1);
OpenPOWER on IntegriCloud