diff options
author | Brian Somers <brian@FreeBSD.org> | 1997-09-09 21:51:39 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1997-09-09 21:51:39 +0000 |
commit | d40f8a5a61defc1e0aca287dc618eff3f78c6e89 (patch) | |
tree | c6f9149a9a766cbb9ec3cb2bde004a5ef397c27c /usr.sbin/ppp/server.c | |
parent | 506474c87a06bbd41e8b99287ba925ad83576992 (diff) | |
download | src-test2-d40f8a5a61defc1e0aca287dc618eff3f78c6e89.tar.gz src-test2-d40f8a5a61defc1e0aca287dc618eff3f78c6e89.zip |
Notes
Diffstat (limited to 'usr.sbin/ppp/server.c')
-rw-r--r-- | usr.sbin/ppp/server.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c index 7aab041688cc..c756d77ebe9d 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)); |