summaryrefslogtreecommitdiffstats
path: root/usr.bin/chkey
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-12-02 23:12:33 +0000
committermarkm <markm@FreeBSD.org>2001-12-02 23:12:33 +0000
commitfc2e4b54ecdf167db87f8a8a882f7c1350c1c304 (patch)
tree2edf6d9145cc6c0e6668c5b46c6c38307778df74 /usr.bin/chkey
parentf817012db64be7bf9a6273547ccf34a6e6822a76 (diff)
downloadFreeBSD-src-fc2e4b54ecdf167db87f8a8a882f7c1350c1c304.zip
FreeBSD-src-fc2e4b54ecdf167db87f8a8a882f7c1350c1c304.tar.gz
WARNS=2 fixes. Also, use __FBSDID(), and sort includes.
Diffstat (limited to 'usr.bin/chkey')
-rw-r--r--usr.bin/chkey/Makefile3
-rw-r--r--usr.bin/chkey/chkey.c25
2 files changed, 21 insertions, 7 deletions
diff --git a/usr.bin/chkey/Makefile b/usr.bin/chkey/Makefile
index 435a642..8c20ac0 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 b769054..68d3ae8 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 <sys/cdefs.h>
+
+__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 <stdio.h>
#include <rpc/rpc.h>
#include <rpc/key_prot.h>
#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 <sys/fcntl.h>
#include <pwd.h>
+#include <stdio.h>
#include <string.h>
-#include <sys/fcntl.h>
+#include <unistd.h>
+
+#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;
OpenPOWER on IntegriCloud