From 47faf123809e72c5334b0e499b37719d8c927952 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Sun, 2 Dec 2001 23:12:33 +0000 Subject: [PATCH] WARNS=2 fixes. Also, use __FBSDID(), and sort includes. --- usr.bin/chkey/Makefile | 3 ++- usr.bin/chkey/chkey.c | 27 ++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/usr.bin/chkey/Makefile b/usr.bin/chkey/Makefile index 435a6420541e..8c20ac08239f 100644 --- a/usr.bin/chkey/Makefile +++ b/usr.bin/chkey/Makefile @@ -4,7 +4,8 @@ PROG= chkey SRCS= chkey.c generic.c update.c -CFLAGS+=-DYP +CFLAGS+=-DYP -I${.CURDIR}/../newkey +WARNS?= 2 DPADD= ${LIBRPCSVC} ${LIBMP} ${LIBCRYPTO} LDADD= -lrpcsvc -lmp -lcrypto diff --git a/usr.bin/chkey/chkey.c b/usr.bin/chkey/chkey.c index b7690540825e..68d3ae840eac 100644 --- a/usr.bin/chkey/chkey.c +++ b/usr.bin/chkey/chkey.c @@ -27,9 +27,15 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ + +#include + +__FBSDID("$FreeBSD$"); + #ifndef lint -static char sccsid[] = "@(#)chkey.c 1.7 91/03/11 Copyr 1986 Sun Micro"; +static const char sccsid[] = "@(#)chkey.c 1.7 91/03/11 Copyr 1986 Sun Micro"; #endif + /* * Copyright (C) 1986, Sun Microsystems, Inc. */ @@ -37,7 +43,6 @@ static char sccsid[] = "@(#)chkey.c 1.7 91/03/11 Copyr 1986 Sun Micro"; /* * Command to change one's public key in the public key database */ -#include #include #include #ifdef YP @@ -46,15 +51,17 @@ static char sccsid[] = "@(#)chkey.c 1.7 91/03/11 Copyr 1986 Sun Micro"; #else #define YPOP_STORE 4 #endif -#include -#include #include +#include +#include +#include +#include + +#include "extern.h" -extern char *getpass(); #define index strchr -extern char *crypt(); #ifdef YPPASSWD -struct passwd *ypgetpwuid(); +struct passwd *ypgetpwuid(uid_t); #endif #ifdef YP @@ -65,6 +72,10 @@ static char PKFILE[] = "/etc/publickey"; #endif /* YP */ static char ROOTKEY[] = "/etc/.rootkey"; +static void usage(char *); +extern int yp_update(char *, char *, int, char *, size_t, char *, size_t); + +int main(argc, argv) int argc; char **argv; @@ -228,6 +239,7 @@ main(argc, argv) /* NOTREACHED */ } +static void usage(name) char *name; { @@ -240,6 +252,7 @@ usage(name) /* * Set the entry in the public key file */ +int setpublicmap(name, public, secret) char *name; char *public;