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
* 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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/file.h>
#include <rpc/rpc.h>
#include <rpc/key_prot.h>
#include <mp.h>
#include <stdio.h>
#include <stdlib.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <rpc/rpc.h>
#include <rpc/key_prot.h>
#ifdef YP
#include <sys/wait.h>
#include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h>
#include <netdb.h>
#endif /* YP */
#include <err.h>
#include <pwd.h>
#include <stdio.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <rpc/rpc.h>
#include <rpc/key_prot.h>
#ifdef YP
#include <sys/wait.h>
#include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h>
#include <netdb.h>
#endif /* YP */
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
#include <string.h>
#include <unistd.h>
@ -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 */