ANSIfy, VCS inclusions and some very minor style.

This commit is contained in:
Mark Murray 2002-04-28 12:09:33 +00:00
parent f099c6c361
commit dba464cc27
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95633
3 changed files with 36 additions and 55 deletions

View File

@ -27,21 +27,25 @@
* 2550 Garcia Avenue * 2550 Garcia Avenue
* Mountain View, California 94043 * Mountain View, California 94043
*/ */
#if !defined(lint) && defined(SCCSIDS) #if !defined(lint) && defined(SCCSIDS)
#if 0 #if 0
static char sccsid[] = "@(#)generic.c 1.2 91/03/11 Copyr 1986 Sun Micro"; static char sccsid[] = "@(#)generic.c 1.2 91/03/11 Copyr 1986 Sun Micro";
#endif #endif
static const char rcsid[] =
"$FreeBSD$";
#endif #endif
/* /*
* Copyright (C) 1986, Sun Microsystems, Inc. * Copyright (C) 1986, Sun Microsystems, Inc.
*/ */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/file.h> #include <sys/file.h>
#include <rpc/rpc.h> #include <rpc/rpc.h>
#include <rpc/key_prot.h> #include <rpc/key_prot.h>
#include <mp.h> #include <mp.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -55,10 +59,7 @@ static void getseed(char *, int, unsigned char *);
* Generate a seed * Generate a seed
*/ */
static void static void
getseed(seed, seedsize, pass) getseed(char *seed, int seedsize, unsigned char *pass)
char *seed;
int seedsize;
unsigned char *pass;
{ {
int i; int i;
@ -71,10 +72,7 @@ getseed(seed, seedsize, pass)
* Generate a random public/secret key pair * Generate a random public/secret key pair
*/ */
void void
genkeys(public, secret, pass) genkeys(char *public, char *secret, char *pass)
char *public;
char *secret;
char *pass;
{ {
unsigned int i; unsigned int i;
@ -118,9 +116,7 @@ genkeys(public, secret, pass)
* Adjust the input key so that it is 0-filled on the left * Adjust the input key so that it is 0-filled on the left
*/ */
static void static void
adjust(keyout, keyin) adjust(char keyout[HEXKEYBYTES+1], char *keyin)
char keyout[HEXKEYBYTES+1];
char *keyin;
{ {
char *p; char *p;
char *s; char *s;

View File

@ -27,12 +27,11 @@
* 2550 Garcia Avenue * 2550 Garcia Avenue
* Mountain View, California 94043 * Mountain View, California 94043
*/ */
#if !defined(lint) && defined(SCCSIDS) #if !defined(lint) && defined(SCCSIDS)
#if 0 #if 0
static char sccsid[] = "@(#)newkey.c 1.8 91/03/11 Copyr 1986 Sun Micro"; static char sccsid[] = "@(#)newkey.c 1.8 91/03/11 Copyr 1986 Sun Micro";
#endif #endif
static const char rcsid[] =
"$FreeBSD$";
#endif #endif
/* /*
@ -42,17 +41,23 @@ static const char rcsid[] =
/* /*
* Administrative tool to add a new user to the publickey database * Administrative tool to add a new user to the publickey database
*/ */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <rpc/rpc.h> #include <rpc/rpc.h>
#include <rpc/key_prot.h> #include <rpc/key_prot.h>
#ifdef YP #ifdef YP
#include <sys/wait.h> #include <sys/wait.h>
#include <rpcsvc/yp_prot.h> #include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h> #include <rpcsvc/ypclnt.h>
#include <netdb.h> #include <netdb.h>
#endif /* YP */ #endif /* YP */
#include <err.h> #include <err.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h> #include <stdio.h>
@ -87,9 +92,7 @@ static char *err_string();
static void usage(void); static void usage(void);
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
char name[MAXNETNAMELEN + 1]; char name[MAXNETNAMELEN + 1];
char public[HEXKEYBYTES + 1]; char public[HEXKEYBYTES + 1];
@ -163,7 +166,7 @@ main(argc, argv)
} }
static void static void
usage() usage(void)
{ {
(void)fprintf(stderr, "%s\n%s\n", (void)fprintf(stderr, "%s\n%s\n",
"usage: newkey [-u username]", "usage: newkey [-u username]",
@ -175,10 +178,7 @@ usage()
* Set the entry in the public key file * Set the entry in the public key file
*/ */
int int
setpublicmap(name, public, secret) setpublicmap(char *name, char *public, char *secret)
char *name;
char *public;
char *secret;
{ {
char pkent[1024]; char pkent[1024];
@ -199,8 +199,7 @@ setpublicmap(name, public, secret)
* a success message. * a success message.
*/ */
static char * static char *
err_string(code) err_string(int code)
int code;
{ {
char *pmesg; char *pmesg;

View File

@ -27,12 +27,11 @@
* 2550 Garcia Avenue * 2550 Garcia Avenue
* Mountain View, California 94043 * Mountain View, California 94043
*/ */
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro"; static char sccsid[] = "@(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro";
#endif #endif
static const char rcsid[] =
"$FreeBSD$";
#endif #endif
/* /*
@ -42,20 +41,26 @@ static const char rcsid[] =
/* /*
* Administrative tool to add a new user to the publickey database * Administrative tool to add a new user to the publickey database
*/ */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <rpc/rpc.h> #include <rpc/rpc.h>
#include <rpc/key_prot.h> #include <rpc/key_prot.h>
#ifdef YP #ifdef YP
#include <sys/wait.h> #include <sys/wait.h>
#include <rpcsvc/yp_prot.h> #include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h> #include <rpcsvc/ypclnt.h>
#include <netdb.h> #include <netdb.h>
#endif /* YP */ #endif /* YP */
#include <pwd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <pwd.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
@ -79,14 +84,8 @@ static char *basename(char *path);
* if there is no access violation. * if there is no access violation.
*/ */
int int
mapupdate(requester, mapname, op, keylen, key, datalen, data) mapupdate(char *requester, char *mapname, u_int op, u_int keylen,
char *requester; char *key, u_int datalen, char *data)
char *mapname;
u_int op;
u_int keylen;
char *key;
u_int datalen;
char *data;
{ {
char updater[MAXMAPNAMELEN + 40]; char updater[MAXMAPNAMELEN + 40];
FILE *childargs; FILE *childargs;
@ -144,10 +143,7 @@ mapupdate(requester, mapname, op, keylen, key, datalen, data)
* returns pid, or -1 for failure * returns pid, or -1 for failure
*/ */
static pid_t static pid_t
_openchild(command, fto, ffrom) _openchild(char *command, FILE **fto, FILE **ffrom)
char *command;
FILE **fto;
FILE **ffrom;
{ {
int i; int i;
pid_t pid; pid_t pid;
@ -212,8 +208,7 @@ _openchild(command, fto, ffrom)
} }
static char * static char *
basename(path) basename(char *path)
char *path;
{ {
char *p; char *p;
@ -234,7 +229,7 @@ basename(path)
#define ERR_DBASE 5 #define ERR_DBASE 5
#define ERR_KEY 6 #define ERR_KEY 6
static int match( char * , char * ); static int match(char *, char *);
/* /*
* Determine if requester is allowed to update the given map, * 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 * if there is no access violation. This function updates
* the local file and then shuts up. * the local file and then shuts up.
*/ */
localupdate(name, filename, op, keylen, key, datalen, data) localupdate(char *name, char *filename, u_int op, u_int keylen,
char *name; /* Name of the requestor */ char *key, u_int datalen, char *data)
char *filename;
u_int op;
u_int keylen; /* Not used */
char *key;
u_int datalen; /* Not used */
char *data;
{ {
char line[256]; char line[256];
FILE *rf; FILE *rf;
@ -335,9 +324,7 @@ localupdate(name, filename, op, keylen, key, datalen, data)
} }
static static
match(line, name) match(char *line, char *name)
char *line;
char *name;
{ {
int len; int len;
@ -346,4 +333,3 @@ match(line, name)
(line[len] == ' ' || line[len] == '\t')); (line[len] == ' ' || line[len] == '\t'));
} }
#endif /* !YP */ #endif /* !YP */