diff options
author | markm <markm@FreeBSD.org> | 2001-12-02 12:17:20 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-12-02 12:17:20 +0000 |
commit | 8e33fb69fc45f4bb7cc91a88fc201e074c9eeaf9 (patch) | |
tree | 0594b64fc835c9a5bbf6575836f47c0ac1a1051c /usr.bin/newkey/update.c | |
parent | a59a3a99ce709ed0944f5b38c6fc98d2be49eb9c (diff) | |
download | FreeBSD-src-8e33fb69fc45f4bb7cc91a88fc201e074c9eeaf9.zip FreeBSD-src-8e33fb69fc45f4bb7cc91a88fc201e074c9eeaf9.tar.gz |
WARNS=2 fixup.
Turn on YP (NIS) while I'm about it.
Diffstat (limited to 'usr.bin/newkey/update.c')
-rw-r--r-- | usr.bin/newkey/update.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/usr.bin/newkey/update.c b/usr.bin/newkey/update.c index 23248ef..972c0e3 100644 --- a/usr.bin/newkey/update.c +++ b/usr.bin/newkey/update.c @@ -42,48 +42,43 @@ static const char rcsid[] = /* * Administrative tool to add a new user to the publickey database */ -#include <stdio.h> -#include <stdlib.h> +#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 <sys/wait.h> #include <netdb.h> #endif /* YP */ +#include <stdio.h> +#include <stdlib.h> #include <pwd.h> #include <string.h> #include <unistd.h> -#include <sys/resource.h> -#ifdef YP -#define MAXMAPNAMELEN 256 -#else -#define YPOP_CHANGE 1 /* change, do not add */ -#define YPOP_INSERT 2 /* add, do not change */ -#define YPOP_DELETE 3 /* delete this entry */ -#define YPOP_STORE 4 /* add, or change */ -#endif +#include "extern.h" #ifdef YP -static char *basename(); static char SHELL[] = "/bin/sh"; static char YPDBPATH[]="/var/yp"; /* This is defined but not used! */ -static char PKMAP[] = "publickey.byname"; static char UPDATEFILE[] = "updaters"; #else static char PKFILE[] = "/etc/publickey"; #endif /* YP */ #ifdef YP -static int _openchild __P(( char *, FILE **, FILE ** )); +static int _openchild __P((char *, FILE **, FILE **)); +static char *basename __P((char *path)); /* * Determine if requester is allowed to update the given map, * and update it if so. Returns the yp status, which is zero * if there is no access violation. */ +int mapupdate(requester, mapname, op, keylen, key, datalen, data) char *requester; char *mapname; @@ -148,7 +143,7 @@ mapupdate(requester, mapname, op, keylen, key, datalen, data) /* * returns pid, or -1 for failure */ -static +static pid_t _openchild(command, fto, ffrom) char *command; FILE **fto; |