diff options
-rw-r--r-- | lib/libskey/Makefile | 1 | ||||
-rw-r--r-- | lib/libskey/put.c | 3 | ||||
-rw-r--r-- | lib/libskey/skey.h | 2 | ||||
-rw-r--r-- | lib/libskey/skeyaccess.c | 8 | ||||
-rw-r--r-- | lib/libskey/skeylogin.c | 4 | ||||
-rw-r--r-- | lib/libskey/skeysubr.c | 7 |
6 files changed, 14 insertions, 11 deletions
diff --git a/lib/libskey/Makefile b/lib/libskey/Makefile index 63df390..e8b03ca 100644 --- a/lib/libskey/Makefile +++ b/lib/libskey/Makefile @@ -10,6 +10,7 @@ MLINKS= skey.3 skeylookup.3 skey.3 skeyverify.3 skey.3 skeychallenge.3 \ MAN5= skey.access.5 CFLAGS+=-DPERMIT_CONSOLE -D_SKEY_INTERNAL -I${.CURDIR} +CFLAGS+=-W -Wall -Werror .if ${BINFORMAT} == elf DPADD+= ${LIBCRYPT} ${LIBMD} diff --git a/lib/libskey/put.c b/lib/libskey/put.c index 5c9eaea..fd262a4 100644 --- a/lib/libskey/put.c +++ b/lib/libskey/put.c @@ -2107,7 +2107,8 @@ char *out; char *e; { char *word, *cp; - int i, p, v,l, low,high; + int i, v,l, low,high; + unsigned int p; char b[9]; char input[36]; diff --git a/lib/libskey/skey.h b/lib/libskey/skey.h index 10cbebc..6dc564b 100644 --- a/lib/libskey/skey.h +++ b/lib/libskey/skey.h @@ -35,7 +35,7 @@ struct mc { #define sevenbit _sk_sevenbit void f __P((char *x)); -int keycrunch __P((char *result,char *seed,char *passwd)); +int keycrunch __P((char *result,const char *seed,const char *passwd)); char *btoe __P((char *engout,char *c)); char *put8 __P((char *out,char *s)); int atob8 __P((char *out, char *in)); diff --git a/lib/libskey/skeyaccess.c b/lib/libskey/skeyaccess.c index 0d52caf..5a6e2d3 100644 --- a/lib/libskey/skeyaccess.c +++ b/lib/libskey/skeyaccess.c @@ -229,9 +229,9 @@ struct login_info *login_info; static int match_internet_addr(login_info) struct login_info *login_info; { - char *tok; - long pattern; - long mask; + char * tok; + u_int32_t pattern; + u_int32_t mask; struct in_addr *addrp; if (login_info->internet_addr == 0) @@ -249,7 +249,7 @@ struct login_info *login_info; */ for (addrp = login_info->internet_addr; addrp->s_addr; addrp++) - if (addrp->s_addr != -1 && (addrp->s_addr & mask) == pattern) + if (addrp->s_addr != INADDR_NONE && (addrp->s_addr & mask) == pattern) return (1); return (0); } diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index 10af30b..96de96f 100644 --- a/lib/libskey/skeylogin.c +++ b/lib/libskey/skeylogin.c @@ -104,8 +104,8 @@ struct skey *mp; const char *name; { int found; - int len; - long recstart; + size_t len; + long recstart = 0; char *cp, *p; struct stat statbuf; mode_t oldmask; diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c index 2bd344f..ba88d8c 100644 --- a/lib/libskey/skeysubr.c +++ b/lib/libskey/skeysubr.c @@ -1,3 +1,4 @@ +#include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -15,8 +16,8 @@ int keycrunch(result,seed,passwd) char *result; /* 8-byte result */ -char *seed; /* Seed, any length */ -char *passwd; /* Password, any length */ +const char *seed; /* Seed, any length */ +const char *passwd; /* Password, any length */ { char *buf; MDX_CTX md; @@ -76,7 +77,7 @@ static void interrupt(sig) int sig; { tcsetattr(0, TCSANOW, &saved_ttymode); - exit(1); + err(1, "interrupted by signal %s", sys_siglist[sig]); } char * |