diff options
author | brian <brian@FreeBSD.org> | 1997-10-26 01:04:02 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-10-26 01:04:02 +0000 |
commit | 486b8925ecb0d408e403474828e20c1cce8aaec8 (patch) | |
tree | cca66974908224bf517868aaafb2e4acd1abe88d /usr.sbin/ppp/auth.c | |
parent | 1d2927c9fac7bcfe68bf6ab502c716adc91d6f09 (diff) | |
download | FreeBSD-src-486b8925ecb0d408e403474828e20c1cce8aaec8.zip FreeBSD-src-486b8925ecb0d408e403474828e20c1cce8aaec8.tar.gz |
Cosmetic (no functional changes):
o Add missing $Id$s
o Move extern decls from .c -> .h files
o Staticize
o Remove #includes from .h files
o style(9)ify includes
o bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
index -> strchr
rindex -> strrchr
o Move timeout.h -> timer.h (making it consistent w/ timer.c)
o Add -Wmissing-prototypes
Diffstat (limited to 'usr.sbin/ppp/auth.c')
-rw-r--r-- | usr.sbin/ppp/auth.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c index 72197e6..048ad84 100644 --- a/usr.sbin/ppp/auth.c +++ b/usr.sbin/ppp/auth.c @@ -17,22 +17,32 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: auth.c,v 1.16 1997/09/04 00:38:17 brian Exp $ + * $Id: auth.c,v 1.17 1997/09/09 21:51:38 brian Exp $ * * TODO: * o Implement check against with registered IP addresses. */ +#include <sys/param.h> +#include <netinet/in.h> + +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include "mbuf.h" +#include "log.h" +#include "defs.h" +#include "timer.h" #include "fsm.h" #include "lcpproto.h" #include "ipcp.h" #include "loadalias.h" +#include "command.h" #include "vars.h" #include "filter.h" #include "auth.h" #include "chat.h" - -extern FILE *OpenSecret(); -extern void CloseSecret(); +#include "systems.h" void LocalAuthInit() @@ -73,7 +83,7 @@ LocalAuthValidate(char *fname, char *system, char *key) if (buff[0] == '#') continue; buff[strlen(buff) - 1] = 0; - bzero(vector, sizeof(vector)); + memset(vector, '\0', sizeof(vector)); n = MakeArgs(buff, vector, VECSIZE(vector)); if (n < 1) continue; @@ -107,7 +117,7 @@ AuthValidate(char *fname, char *system, char *key) if (buff[0] == '#') continue; buff[strlen(buff) - 1] = 0; - bzero(vector, sizeof(vector)); + memset(vector, '\0', sizeof(vector)); n = MakeArgs(buff, vector, VECSIZE(vector)); if (n < 2) continue; @@ -115,7 +125,7 @@ AuthValidate(char *fname, char *system, char *key) ExpandString(vector[1], passwd, sizeof(passwd), 0); if (strcmp(passwd, key) == 0) { CloseSecret(fp); - bzero(&DefHisAddress, sizeof(DefHisAddress)); + memset(&DefHisAddress, '\0', sizeof(DefHisAddress)); n -= 2; if (n > 0) { if (ParseAddr(n--, &vector[2], @@ -150,14 +160,14 @@ AuthGetSecret(char *fname, char *system, int len, int setaddr) if (buff[0] == '#') continue; buff[strlen(buff) - 1] = 0; - bzero(vector, sizeof(vector)); + memset(vector, '\0', sizeof(vector)); n = MakeArgs(buff, vector, VECSIZE(vector)); if (n < 2) continue; if (strlen(vector[0]) == len && strncmp(vector[0], system, len) == 0) { ExpandString(vector[1], passwd, sizeof(passwd), 0); if (setaddr) { - bzero(&DefHisAddress, sizeof(DefHisAddress)); + memset(&DefHisAddress, '\0', sizeof(DefHisAddress)); } n -= 2; if (n > 0 && setaddr) { @@ -176,7 +186,7 @@ AuthGetSecret(char *fname, char *system, int len, int setaddr) } static void -AuthTimeout(struct authinfo * authp) +AuthTimeout(struct authinfo *authp) { struct pppTimer *tp; @@ -189,7 +199,7 @@ AuthTimeout(struct authinfo * authp) } void -StartAuthChallenge(struct authinfo * authp) +StartAuthChallenge(struct authinfo *authp) { struct pppTimer *tp; @@ -206,7 +216,7 @@ StartAuthChallenge(struct authinfo * authp) } void -StopAuthTimer(struct authinfo * authp) +StopAuthTimer(struct authinfo *authp) { StopTimer(&authp->authtimer); } |