diff options
author | brian <brian@FreeBSD.org> | 1997-09-09 21:51:39 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-09-09 21:51:39 +0000 |
commit | 0791c3c050563d41ecbe2f1f3dbd97650078073e (patch) | |
tree | 3e5dfc8a61a8bcf3a14a246396d24730d53012df /usr.sbin | |
parent | 4939f4fc068fe39f1044cd1462eb87e57064ec20 (diff) | |
download | FreeBSD-src-0791c3c050563d41ecbe2f1f3dbd97650078073e.zip FreeBSD-src-0791c3c050563d41ecbe2f1f3dbd97650078073e.tar.gz |
Correct ppp authentication defaults in interactive
mode. We don't want to be forced to type a password
here :-(
Pointed out by: mouth@ibm.net (John Kelly)
While I'm there, don't allow a "set server" in
interactive mode.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/auth.c | 10 | ||||
-rw-r--r-- | usr.sbin/ppp/server.c | 12 |
2 files changed, 19 insertions, 3 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c index 1ea18c9..72197e6 100644 --- a/usr.sbin/ppp/auth.c +++ b/usr.sbin/ppp/auth.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: auth.c,v 1.15 1997/08/25 00:29:05 brian Exp $ + * $Id: auth.c,v 1.16 1997/09/04 00:38:17 brian Exp $ * * TODO: * o Implement check against with registered IP addresses. @@ -48,8 +48,12 @@ LocalAuthInit() if (p) *p = '\0'; - VarLocalAuth = LocalAuthValidate(SECRETFILE, VarShortHost, "") == NOT_FOUND ? - LOCAL_DENY : LOCAL_NO_AUTH; + if (!(mode&(MODE_AUTO|MODE_DEDICATED|MODE_DIRECT))) + /* We're allowed in interactive and direct */ + VarLocalAuth = LOCAL_AUTH; + else + VarLocalAuth = LocalAuthValidate(SECRETFILE, VarShortHost, "") + == NOT_FOUND ? LOCAL_DENY : LOCAL_NO_AUTH; } LOCAL_AUTH_VALID diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c index 7aab041..c756d77 100644 --- a/usr.sbin/ppp/server.c +++ b/usr.sbin/ppp/server.c @@ -15,6 +15,7 @@ #include "loadalias.h" #include "vars.h" #include "server.h" +#include "defs.h" int server = UNKNOWN_SERVER; static struct sockaddr_un ifsun; @@ -31,6 +32,11 @@ ServerLocalOpen(const char *name, mode_t mask) return 1; } + if (!(mode&(MODE_AUTO|MODE_DEDICATED|MODE_DIRECT))) { + LogPrintf(LogERROR, "Local: Can't open socket in interactive mode\n"); + return 1; + } + ifsun.sun_len = strlen(name); if (ifsun.sun_len > sizeof ifsun.sun_path - 1) { LogPrintf(LogERROR, "Local: %s: Path too long\n", name); @@ -80,6 +86,12 @@ ServerTcpOpen(int port) "in ppp.secret\n", port); return 6; } + + if (!(mode&(MODE_AUTO|MODE_DEDICATED|MODE_DIRECT))) { + LogPrintf(LogERROR, "Tcp: Can't open socket in interactive mode\n"); + return 6; + } + s = socket(PF_INET, SOCK_STREAM, 0); if (s < 0) { LogPrintf(LogERROR, "Tcp: socket: %s\n", strerror(errno)); |