From dba464cc276a36d29ce2c84bdb527762462ffa20 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Sun, 28 Apr 2002 12:09:33 +0000 Subject: [PATCH] ANSIfy, VCS inclusions and some very minor style. --- usr.bin/newkey/generic.c | 22 ++++++++----------- usr.bin/newkey/newkey.c | 23 ++++++++++---------- usr.bin/newkey/update.c | 46 ++++++++++++++-------------------------- 3 files changed, 36 insertions(+), 55 deletions(-) diff --git a/usr.bin/newkey/generic.c b/usr.bin/newkey/generic.c index f4c8b92e607c..3572df92f727 100644 --- a/usr.bin/newkey/generic.c +++ b/usr.bin/newkey/generic.c @@ -27,21 +27,25 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ + #if !defined(lint) && defined(SCCSIDS) #if 0 static char sccsid[] = "@(#)generic.c 1.2 91/03/11 Copyr 1986 Sun Micro"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* * Copyright (C) 1986, Sun Microsystems, Inc. */ +#include +__FBSDID("$FreeBSD$"); + #include + #include #include + #include #include #include @@ -55,10 +59,7 @@ static void getseed(char *, int, unsigned char *); * Generate a seed */ static void -getseed(seed, seedsize, pass) - char *seed; - int seedsize; - unsigned char *pass; +getseed(char *seed, int seedsize, unsigned char *pass) { int i; @@ -71,10 +72,7 @@ getseed(seed, seedsize, pass) * Generate a random public/secret key pair */ void -genkeys(public, secret, pass) - char *public; - char *secret; - char *pass; +genkeys(char *public, char *secret, char *pass) { unsigned int i; @@ -118,9 +116,7 @@ genkeys(public, secret, pass) * Adjust the input key so that it is 0-filled on the left */ static void -adjust(keyout, keyin) - char keyout[HEXKEYBYTES+1]; - char *keyin; +adjust(char keyout[HEXKEYBYTES+1], char *keyin) { char *p; char *s; diff --git a/usr.bin/newkey/newkey.c b/usr.bin/newkey/newkey.c index 00af8892ab35..12dc639eb30f 100644 --- a/usr.bin/newkey/newkey.c +++ b/usr.bin/newkey/newkey.c @@ -27,12 +27,11 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ + #if !defined(lint) && defined(SCCSIDS) #if 0 static char sccsid[] = "@(#)newkey.c 1.8 91/03/11 Copyr 1986 Sun Micro"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* @@ -42,17 +41,23 @@ static const char rcsid[] = /* * Administrative tool to add a new user to the publickey database */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include + #include #include + #ifdef YP #include #include #include #include #endif /* YP */ + #include #include #include @@ -87,9 +92,7 @@ static char *err_string(); static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { char name[MAXNETNAMELEN + 1]; char public[HEXKEYBYTES + 1]; @@ -163,7 +166,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: newkey [-u username]", @@ -175,10 +178,7 @@ usage() * Set the entry in the public key file */ int -setpublicmap(name, public, secret) - char *name; - char *public; - char *secret; +setpublicmap(char *name, char *public, char *secret) { char pkent[1024]; @@ -199,8 +199,7 @@ setpublicmap(name, public, secret) * a success message. */ static char * -err_string(code) - int code; +err_string(int code) { char *pmesg; diff --git a/usr.bin/newkey/update.c b/usr.bin/newkey/update.c index af397a1ceed4..e10acd93a7e5 100644 --- a/usr.bin/newkey/update.c +++ b/usr.bin/newkey/update.c @@ -27,12 +27,11 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ + #ifndef lint #if 0 static char sccsid[] = "@(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* @@ -42,20 +41,26 @@ static const char rcsid[] = /* * Administrative tool to add a new user to the publickey database */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include + #include #include + #ifdef YP #include #include #include #include #endif /* YP */ + +#include #include #include -#include #include #include @@ -79,14 +84,8 @@ static char *basename(char *path); * if there is no access violation. */ int -mapupdate(requester, mapname, op, keylen, key, datalen, data) - char *requester; - char *mapname; - u_int op; - u_int keylen; - char *key; - u_int datalen; - char *data; +mapupdate(char *requester, char *mapname, u_int op, u_int keylen, + char *key, u_int datalen, char *data) { char updater[MAXMAPNAMELEN + 40]; FILE *childargs; @@ -144,10 +143,7 @@ mapupdate(requester, mapname, op, keylen, key, datalen, data) * returns pid, or -1 for failure */ static pid_t -_openchild(command, fto, ffrom) - char *command; - FILE **fto; - FILE **ffrom; +_openchild(char *command, FILE **fto, FILE **ffrom) { int i; pid_t pid; @@ -212,8 +208,7 @@ _openchild(command, fto, ffrom) } static char * -basename(path) - char *path; +basename(char *path) { char *p; @@ -234,7 +229,7 @@ basename(path) #define ERR_DBASE 5 #define ERR_KEY 6 -static int match( char * , char * ); +static int match(char *, char *); /* * Determine if requester is allowed to update the given map, @@ -242,14 +237,8 @@ static int match( char * , char * ); * if there is no access violation. This function updates * the local file and then shuts up. */ -localupdate(name, filename, op, keylen, key, datalen, data) - char *name; /* Name of the requestor */ - char *filename; - u_int op; - u_int keylen; /* Not used */ - char *key; - u_int datalen; /* Not used */ - char *data; +localupdate(char *name, char *filename, u_int op, u_int keylen, + char *key, u_int datalen, char *data) { char line[256]; FILE *rf; @@ -335,9 +324,7 @@ localupdate(name, filename, op, keylen, key, datalen, data) } static -match(line, name) - char *line; - char *name; +match(char *line, char *name) { int len; @@ -346,4 +333,3 @@ match(line, name) (line[len] == ' ' || line[len] == '\t')); } #endif /* !YP */ -