From 8e33fb69fc45f4bb7cc91a88fc201e074c9eeaf9 Mon Sep 17 00:00:00 2001 From: markm Date: Sun, 2 Dec 2001 12:17:20 +0000 Subject: WARNS=2 fixup. Turn on YP (NIS) while I'm about it. --- usr.bin/newkey/update.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'usr.bin/newkey/update.c') 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 -#include +#include +#include +#include #include #include #ifdef YP +#include #include #include -#include #include #endif /* YP */ +#include +#include #include #include #include -#include -#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; -- cgit v1.1