diff options
author | hrs <hrs@FreeBSD.org> | 2011-05-30 02:41:04 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-05-30 02:41:04 +0000 |
commit | 5ef8c93314d194035864dfc6849418d07c8356ae (patch) | |
tree | 43adb392749a8c64fcc366f1498a2ada8ac5ddf9 /usr.sbin | |
parent | acba2cf647d4b002035e6808c10ac4846a96d157 (diff) | |
download | FreeBSD-src-5ef8c93314d194035864dfc6849418d07c8356ae.zip FreeBSD-src-5ef8c93314d194035864dfc6849418d07c8356ae.tar.gz |
Various consistency and style fixes for WARNS=6.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rpc.yppasswdd/Makefile | 8 | ||||
-rw-r--r-- | usr.sbin/rpc.yppasswdd/yppasswdd_extern.h | 2 | ||||
-rw-r--r-- | usr.sbin/rpc.yppasswdd/yppasswdd_main.c | 6 | ||||
-rw-r--r-- | usr.sbin/rpc.ypupdated/ypupdated_main.c | 4 | ||||
-rw-r--r-- | usr.sbin/rpc.ypxfrd/Makefile | 14 | ||||
-rw-r--r-- | usr.sbin/rpc.ypxfrd/ypxfrd_extern.h | 5 | ||||
-rw-r--r-- | usr.sbin/rpc.ypxfrd/ypxfrd_main.c | 8 | ||||
-rw-r--r-- | usr.sbin/rpc.ypxfrd/ypxfrd_server.c | 1 | ||||
-rw-r--r-- | usr.sbin/yppush/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/yppush/yppush_main.c | 4 | ||||
-rw-r--r-- | usr.sbin/ypserv/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_access.c | 30 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_dblookup.c | 15 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_dnslookup.c | 6 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_error.c | 2 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_extern.h | 7 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_main.c | 28 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_server.c | 40 |
18 files changed, 105 insertions, 79 deletions
diff --git a/usr.sbin/rpc.yppasswdd/Makefile b/usr.sbin/rpc.yppasswdd/Makefile index b6a0a8c..2f01e28 100644 --- a/usr.sbin/rpc.yppasswdd/Makefile +++ b/usr.sbin/rpc.yppasswdd/Makefile @@ -5,12 +5,20 @@ RPCDIR= ${DESTDIR}/usr/include/rpcsvc .PATH: ${.CURDIR}/../../usr.sbin/ypserv ${.CURDIR}/../../usr.bin/chpass \ ${.CURDIR}/../../libexec/ypxfr ${RPCDIR} +.include <bsd.own.mk> + PROG= rpc.yppasswdd SCRIPTS=yppwupdate SCRIPTSDIR= /usr/libexec MAN= rpc.yppasswdd.8 SRCS= util.c yp_access.c yp_dblookup.c yp_dbwrite.c \ yp_error.c yppasswdd_main.c yppasswdd_server.c ypxfr_misc.c ${GENSRCS} +.if ${MK_INET_SUPPORT} != "no" +SRCS+= yp_access_inet.c +.endif +.if ${MK_INET6_SUPPORT} != "no" +SRCS+= yp_access_inet6.c +.endif GENSRCS=yp.h yp_clnt.c yppasswd.h yppasswd_private.h yppasswd_private_svc.c \ yppasswd_private_xdr.c yppasswd_svc.c diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h b/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h index db15be2..901b75f 100644 --- a/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h +++ b/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h @@ -46,8 +46,6 @@ #define MAP_UPDATE "yppwupdate" #define MAP_UPDATE_PATH YPLIBDIR "yppwupdate" -extern char *yp_dir; -extern char *progname; extern void do_master(void); extern void yppasswdprog_1(struct svc_req *, register SVCXPRT *); extern void master_yppasswdprog_1(struct svc_req *, register SVCXPRT *); diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c index 8c89691..2311384 100644 --- a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c +++ b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c @@ -86,10 +86,8 @@ static int _rpcfdtype; static char _localhost[] = "localhost"; static char _passwd_byname[] = "passwd.byname"; extern int _rpcsvcstate; /* Set when a request is serviced */ -static char _progname[] = "rpc.yppasswdd"; -char *progname = _progname; -static char _yp_dir[] = _PATH_YP; -char *yp_dir = _yp_dir; +const char *progname = "rpc.yppasswdd"; +const char *yp_dir = _PATH_YP; static char _passfile_default[] = _PATH_YP "master.passwd"; char *passfile_default = _passfile_default; char *passfile; diff --git a/usr.sbin/rpc.ypupdated/ypupdated_main.c b/usr.sbin/rpc.ypupdated/ypupdated_main.c index c13af7d..e8277bf 100644 --- a/usr.sbin/rpc.ypupdated/ypupdated_main.c +++ b/usr.sbin/rpc.ypupdated/ypupdated_main.c @@ -75,8 +75,8 @@ static int _rpcfdtype; extern int _rpcsvcstate; /* Set when a request is serviced */ -char *progname = "rpc.ypupdated"; -char *yp_dir = "/var/yp/"; +const char *progname = "rpc.ypupdated"; +const char *yp_dir = "/var/yp/"; static void _msgout(char* msg) diff --git a/usr.sbin/rpc.ypxfrd/Makefile b/usr.sbin/rpc.ypxfrd/Makefile index ee9e242..3b5478c 100644 --- a/usr.sbin/rpc.ypxfrd/Makefile +++ b/usr.sbin/rpc.ypxfrd/Makefile @@ -1,13 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../usr.sbin/ypserv +.PATH: ${.CURDIR}/../ypserv + +.include <bsd.own.mk> PROG= rpc.ypxfrd MAN= rpc.ypxfrd.8 SRCS= ypxfrd_svc.c ypxfrd.h ypxfrd_server.c yp_error.c \ yp_access.c ypxfrd_main.c - -CFLAGS+= -I. -DXFRBLOCKSIZE=65535 +.if ${MK_INET_SUPPORT} != "no" +SRCS+= yp_access_inet.c +.endif +.if ${MK_INET6_SUPPORT} != "no" +SRCS+= yp_access_inet6.c +.endif + +CFLAGS+= -I. -I${.CURDIR}/../ypserv -DXFRBLOCKSIZE=65535 WARNS?= 2 diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h b/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h index 5aba934..ba4259c 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h @@ -42,9 +42,4 @@ extern int forked; extern int children; -extern void load_securenets(void); -extern void yp_error(const char *, ...); -extern int yp_access(const char *, const struct svc_req *); -extern int yp_validdomain(const char *); -extern char *yp_dir; extern void ypxfrd_freebsd_prog_1(struct svc_req *, register SVCXPRT *); diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c index 8fa3e22..8970497 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c @@ -52,10 +52,12 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <netinet/in.h> #include <syslog.h> -#include "ypxfrd_extern.h" #include <sys/wait.h> #include <errno.h> +#include "ypxfrd_extern.h" +#include "yp_extern.h" + #ifndef SIG_PF #define SIG_PF void(*)(int) #endif @@ -76,8 +78,8 @@ static int _rpcfdtype; extern int _rpcsvcstate; /* Set when a request is serviced */ -char *progname = "rpc.ypxfrd"; -char *yp_dir = "/var/yp/"; +const char *progname = "rpc.ypxfrd"; +const char *yp_dir = _PATH_YP; static void _msgout(char *msg) diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c index 5f60712..401711e 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include <sys/fcntl.h> #include <machine/endian.h> #include "ypxfrd_extern.h" +#include "yp_extern.h" int forked = 0; int children = 0; diff --git a/usr.sbin/yppush/Makefile b/usr.sbin/yppush/Makefile index 887a80b..4ca3635 100644 --- a/usr.sbin/yppush/Makefile +++ b/usr.sbin/yppush/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ RPCDIR= ${.CURDIR}/../../include/rpcsvc -.PATH: ${RPCDIR} ${.CURDIR}/../../usr.sbin/ypserv \ +.PATH: ${RPCDIR} ${.CURDIR}/../ypserv \ ${.CURDIR}/../../libexec/ypxfr PROG= yppush diff --git a/usr.sbin/yppush/yppush_main.c b/usr.sbin/yppush/yppush_main.c index df1dbe4..3749d3e 100644 --- a/usr.sbin/yppush/yppush_main.c +++ b/usr.sbin/yppush/yppush_main.c @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); #include "ypxfr_extern.h" #include "yppush_extern.h" -char *progname = "yppush"; int debug = 1; int _rpcpmstart = 0; -char *yp_dir = _PATH_YP; +const char *progname = "yppush"; +const char *yp_dir = _PATH_YP; char *yppush_mapname = NULL; /* Map to transfer. */ char *yppush_domain = NULL; /* Domain in which map resides. */ diff --git a/usr.sbin/ypserv/Makefile b/usr.sbin/ypserv/Makefile index b184516..d3dd1fa 100644 --- a/usr.sbin/ypserv/Makefile +++ b/usr.sbin/ypserv/Makefile @@ -18,7 +18,7 @@ SRCS+= yp_access_inet6.c CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I. -WARNS?= 0 +WARNS?= 6 DPADD= ${LIBWRAP} LDADD= -lwrap diff --git a/usr.sbin/ypserv/yp_access.c b/usr.sbin/ypserv/yp_access.c index 599f431..5d754e0 100644 --- a/usr.sbin/ypserv/yp_access.c +++ b/usr.sbin/ypserv/yp_access.c @@ -56,10 +56,11 @@ __FBSDID("$FreeBSD$"); #include "yp_extern.h" #ifdef TCP_WRAPPER #include "tcpd.h" +extern int hosts_ctl(const char *, const char *, const char *, const char *); #endif -extern int hosts_ctl(char *, char *, char *, char *); -extern int debug; +char securenets_path[MAXPATHLEN]; +enum yp_snf_format securenets_format = YP_SNF_NATIVE; const char *yp_procs[] = { /* NIS v1 */ @@ -143,6 +144,7 @@ void yp_debug_sa(const struct sockaddr *sap) { int error; + int plen; char host[NI_MAXHOST + 1]; char serv[NI_MAXSERV + 1]; @@ -150,8 +152,9 @@ yp_debug_sa(const struct sockaddr *sap) sizeof(serv), NI_NUMERICHOST | NI_NUMERICSERV); if (error) yp_error("sockaddr: %s", gai_strerror(error)); - else - yp_error("sockaddr: %d/%s/%s", sap->sa_family, host, serv); + mask2prefixlen(sap, &plen); + yp_error("sockaddr: %d:[%s]:%s(/%d)", + sap->sa_family, host, serv, plen); } void @@ -224,8 +227,13 @@ load_securenets(void) return (1); } for (res = res0; res; res = res->ai_next) { - struct sockaddr *sap; snp = malloc(sizeof(*snp)); + if (snp == NULL) { + yp_error("malloc failed: %s", + strerror(errno)); + freeaddrinfo(res0); + return (1); + } memset(snp, 0, sizeof(*snp)); memcpy(&snp->sn_addr, res->ai_addr, sizeof(res->ai_addrlen)); @@ -247,8 +255,8 @@ load_securenets(void) line = 0; while (fgets(linebuf, sizeof(linebuf), fp)) { int nitems; - char *col_host; - char *col_mask; + const char *col_host; + const char *col_mask; char addr1[NI_MAXHOST + 1]; char addr2[NI_MAXHOST + 1]; int plen; @@ -300,7 +308,7 @@ load_securenets(void) if (error) { yp_error("line %d: " "badly formatted securenets entry: " - "%s: %s: %s", line, linebuf, + "%s: %s", line, linebuf, gai_strerror(error)); freeaddrinfo(res0); free(snp); @@ -339,7 +347,7 @@ load_securenets(void) if (error) { yp_error("line %d: " "badly formatted securenets entry: " - "%s: %s: %s", line, linebuf, + "%s: %s", line, linebuf, gai_strerror(error)); freeaddrinfo(res0); free(snp); @@ -448,7 +456,7 @@ compare_subnet(struct sockaddr *addr1, u_char a1[sizeof(struct sockaddr_storage)]; u_char a2[sizeof(struct sockaddr_storage)]; u_char m[sizeof(struct sockaddr_storage)]; - size_t len; + ssize_t len; int i; int samescope; @@ -602,7 +610,7 @@ yp_access(const char *map, const struct svc_req *rqstp) return (1); } #ifdef DB_CACHE - if ((yp_testflag((char *)map, (char *)domain, YP_SECURE) || + if ((yp_testflag((const char *)map, (const char *)domain, YP_SECURE) || #else if ((strstr(map, "master.passwd.") || strstr(map, "shadow.") || #endif diff --git a/usr.sbin/ypserv/yp_dblookup.c b/usr.sbin/ypserv/yp_dblookup.c index 61944dc..5dfc637 100644 --- a/usr.sbin/ypserv/yp_dblookup.c +++ b/usr.sbin/ypserv/yp_dblookup.c @@ -67,6 +67,7 @@ HASHINFO openinfo = { #define MAXDBS 20 #endif +static char nullbuf[] = ""; static int numdbs = 0; struct dbent { @@ -193,10 +194,8 @@ yp_flush_all(void) return; } -static char *inter_string = "YP_INTERDOMAIN"; -static char *secure_string = "YP_SECURE"; -static int inter_sz = sizeof("YP_INTERDOMAIN") - 1; -static int secure_sz = sizeof("YP_SECURE") - 1; +static char inter_string[] = "YP_INTERDOMAIN"; +static char secure_string[] = "YP_SECURE"; static int yp_setflags(DB *dbp) @@ -205,13 +204,13 @@ yp_setflags(DB *dbp) int flags = 0; key.data = inter_string; - key.size = inter_sz; + key.size = sizeof(inter_string) - 1; if (!(dbp->get)(dbp, &key, &data, 0)) flags |= YP_INTERDOMAIN; key.data = secure_string; - key.size = secure_sz; + key.size = sizeof(secure_string) - 1; if (!(dbp->get)(dbp, &key, &data, 0)) flags |= YP_SECURE; @@ -220,7 +219,7 @@ yp_setflags(DB *dbp) } int -yp_testflag(char *map, char *domain, int flag) +yp_testflag(const char *map, const char *domain, int flag) { char buf[MAXPATHLEN + 2]; register struct circleq_entry *qptr; @@ -501,7 +500,7 @@ yp_get_record(const char *domain, const char *map, #ifdef DB_CACHE if (TAILQ_FIRST(&qhead)->dbptr->size) { - TAILQ_FIRST(&qhead)->dbptr->key = ""; + TAILQ_FIRST(&qhead)->dbptr->key = nullbuf; TAILQ_FIRST(&qhead)->dbptr->size = 0; } #else diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c index 4ea6a13..c18e220 100644 --- a/usr.sbin/ypserv/yp_dnslookup.c +++ b/usr.sbin/ypserv/yp_dnslookup.c @@ -223,7 +223,7 @@ yp_send_dns_reply(struct circleq_dnsentry *q, char *buf) { ypresponse result_v1; ypresp_val result_v2; - unsigned long xid; + unsigned long xid = 0; struct sockaddr_in client_addr; xdrproc_t xdrfunc; char *result; @@ -456,7 +456,7 @@ yp_async_lookup_name(struct svc_req *rqstp, char *name, int af) pending++; if (debug) - yp_error("queueing async DNS name lookup (%d)", q->id); + yp_error("queueing async DNS name lookup (%lu)", q->id); yp_prune_dnsq(); return(YP_TRUE); @@ -544,7 +544,7 @@ yp_async_lookup_addr(struct svc_req *rqstp, char *addr, int af) pending++; if (debug) - yp_error("queueing async DNS address lookup (%d)", q->id); + yp_error("queueing async DNS address lookup (%lu)", q->id); yp_prune_dnsq(); return(YP_TRUE); diff --git a/usr.sbin/ypserv/yp_error.c b/usr.sbin/ypserv/yp_error.c index 8d488f3..d3589c7 100644 --- a/usr.sbin/ypserv/yp_error.c +++ b/usr.sbin/ypserv/yp_error.c @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); int debug; extern int _rpcpmstart; -extern char *progname; - static void __verr(const char *fmt, va_list ap) __printflike(1, 0); static void __verr(const char *fmt, va_list ap) diff --git a/usr.sbin/ypserv/yp_extern.h b/usr.sbin/ypserv/yp_extern.h index a187adf..bb7d8af 100644 --- a/usr.sbin/ypserv/yp_extern.h +++ b/usr.sbin/ypserv/yp_extern.h @@ -69,8 +69,8 @@ extern int ypdb_debug; extern int do_dns; extern int children; extern int resfd; -extern char *progname; -extern char *yp_dir; +extern const char *progname; +extern const char *yp_dir; extern pid_t yp_pid; extern char securenets_path[MAXPATHLEN]; extern enum yp_snf_format { @@ -111,8 +111,9 @@ extern DB *yp_open_db(const char *, const char *); extern DB *yp_open_db_cache(const char *, const char *, const char *, int); extern void yp_flush_all(void); extern void yp_init_dbs(void); -extern int yp_testflag(char *, char *, int); +extern int yp_testflag(const char *, const char *, int); extern int load_securenets(void); +extern void show_securenets(void); #ifdef DB_CACHE extern ypstat yp_select_map(char *, char *, keydat *, int); diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index a52e2e7..71bc905 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -84,15 +84,9 @@ static enum rpcsvcstate { _SERVING, } _rpcsvcstate; -extern void ypprog_1(struct svc_req *, SVCXPRT *); -extern void ypprog_2(struct svc_req *, SVCXPRT *); -extern int _rpc_dtablesize(void); - -char securenets_path[MAXPATHLEN]; -enum yp_snf_format securenets_format = YP_SNF_NATIVE; -char *progname = "ypserv"; -char *yp_dir = _PATH_YP; -static char *servname = "0"; +const char *progname = "ypserv"; +const char *yp_dir = _PATH_YP; +static char *servname = NULL; int do_dns = 0; int resfd; @@ -117,7 +111,7 @@ static SLIST_HEAD(, bindaddrlistent) ble_head = SLIST_HEAD_INITIALIZER(ble_head); static void -_msgout(char* msg, ...) +_msgout(const char* msg, ...) { va_list ap; @@ -226,8 +220,9 @@ usage(void) static void closedown(int sig) { + if (sig != SIGALRM) + return; if (_rpcsvcstate == _IDLE) { - extern fd_set svc_fdset; static int size; int i, openfd; @@ -264,10 +259,13 @@ create_service(const int sock, const struct netconfig *nconf, struct socklistent *slep; struct bindaddrlistent *blep; struct netbuf svcaddr; + char nullserv[] = "0"; SLIST_INIT(&sle_head); memset(&hints, 0, sizeof(hints)); memset(&svcaddr, 0, sizeof(svcaddr)); + if (servname == NULL) + servname = nullserv; hints.ai_family = si->si_af; hints.ai_socktype = si->si_socktype; @@ -285,8 +283,9 @@ create_service(const int sock, const struct netconfig *nconf, error = getaddrinfo(blep->ble_hostname, servname, &hints, &res0); if (error) { - _msgout("getaddrinfo(): %s", - gai_strerror(error)); + _msgout("%s: getaddrinfo(): %s", + __func__, + gai_strerror(error)); return (-1); } for (res = res0; res; res = res->ai_next) { @@ -341,7 +340,8 @@ create_service(const int sock, const struct netconfig *nconf, * If servname == "0", redefine it by using * the bound socket. */ - if (strncmp("0", servname, 1) == 0) { + if (servname == NULL || + strncmp("0", servname, 1) == 0) { struct sockaddr *sap; socklen_t slen; char *sname; diff --git a/usr.sbin/ypserv/yp_server.c b/usr.sbin/ypserv/yp_server.c index ba20c3cd..4526a4b 100644 --- a/usr.sbin/ypserv/yp_server.c +++ b/usr.sbin/ypserv/yp_server.c @@ -48,11 +48,10 @@ __FBSDID("$FreeBSD$"); #include <rpc/rpc.h> int children = 0; +static char nullbuf[] = ""; #define MASTER_STRING "YP_MASTER_NAME" -#define MASTER_SZ sizeof(MASTER_STRING) - 1 #define ORDER_STRING "YP_LAST_MODIFIED" -#define ORDER_SZ sizeof(ORDER_STRING) - 1 static pid_t yp_fork(void) @@ -76,6 +75,7 @@ ypproc_null_2_svc(void *argp, struct svc_req *rqstp) static char * result; static char rval = 0; + argp = NULL; #ifdef DB_CACHE if (yp_access(NULL, NULL, (struct svc_req *)rqstp)) #else @@ -135,7 +135,7 @@ ypproc_match_2_svc(ypreq_key *argp, struct svc_req *rqstp) { static ypresp_val result; - result.val.valdat_val = ""; + result.val.valdat_val = nullbuf; result.val.valdat_len = 0; #ifdef DB_CACHE @@ -205,7 +205,7 @@ ypproc_first_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) { static ypresp_key_val result; - result.val.valdat_val = result.key.keydat_val = ""; + result.val.valdat_val = result.key.keydat_val = nullbuf; result.val.valdat_len = result.key.keydat_len = 0; #ifdef DB_CACHE @@ -237,7 +237,7 @@ ypproc_next_2_svc(ypreq_key *argp, struct svc_req *rqstp) { static ypresp_key_val result; - result.val.valdat_val = result.key.keydat_val = ""; + result.val.valdat_val = result.key.keydat_val = nullbuf; result.val.valdat_len = result.key.keydat_len = 0; #ifdef DB_CACHE @@ -426,6 +426,7 @@ ypproc_clear_2_svc(void *argp, struct svc_req *rqstp) static char * result; static char rval = 0; + argp = NULL; #ifdef DB_CACHE if (yp_access(NULL, NULL, (struct svc_req *)rqstp)) #else @@ -494,7 +495,7 @@ ypproc_all_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) */ result.more = TRUE; result.ypresp_all_u.val.key.keydat_len = 0; - result.ypresp_all_u.val.key.keydat_val = ""; + result.ypresp_all_u.val.key.keydat_val = nullbuf; #ifdef DB_CACHE if (yp_access(argp->map, argp->domain, (struct svc_req *)rqstp)) { @@ -574,10 +575,11 @@ ypproc_master_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) { static ypresp_master result; static char ypvalbuf[YPMAXRECORD]; - keydat key = { MASTER_SZ, MASTER_STRING }; + char keybuf[] = MASTER_STRING; + keydat key = { sizeof(keybuf) - 1, keybuf }; valdat val; - result.peer = ""; + result.peer = nullbuf; #ifdef DB_CACHE if (yp_access(argp->map, argp->domain, (struct svc_req *)rqstp)) { @@ -612,7 +614,7 @@ ypproc_master_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) ypvalbuf[val.valdat_len] = '\0'; result.peer = ypvalbuf; } else - result.peer = ""; + result.peer = nullbuf; return (&result); } @@ -621,7 +623,8 @@ ypresp_order * ypproc_order_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) { static ypresp_order result; - keydat key = { ORDER_SZ, ORDER_STRING }; + char keybuf[] = ORDER_STRING; + keydat key = { sizeof(keybuf) - 1, keybuf }; valdat val; result.ordernum = 0; @@ -662,7 +665,8 @@ ypproc_order_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) return (&result); } -static void yp_maplist_free(struct ypmaplist *yp_maplist) +static void +yp_maplist_free(struct ypmaplist *yp_maplist) { register struct ypmaplist *next; @@ -815,7 +819,7 @@ ypoldproc_match_1_svc(yprequest *argp, struct svc_req *rqstp) ypresp_val *v2_result; result.yp_resptype = YPRESP_VAL; - result.ypresponse_u.yp_resp_valtype.val.valdat_val = ""; + result.ypresponse_u.yp_resp_valtype.val.valdat_val = nullbuf; result.ypresponse_u.yp_resp_valtype.val.valdat_len = 0; if (argp->yp_reqtype != YPREQ_KEY) { @@ -844,7 +848,7 @@ ypoldproc_first_1_svc(yprequest *argp, struct svc_req *rqstp) result.yp_resptype = YPRESP_KEY_VAL; result.ypresponse_u.yp_resp_key_valtype.val.valdat_val = - result.ypresponse_u.yp_resp_key_valtype.key.keydat_val = ""; + result.ypresponse_u.yp_resp_key_valtype.key.keydat_val = nullbuf; result.ypresponse_u.yp_resp_key_valtype.val.valdat_len = result.ypresponse_u.yp_resp_key_valtype.key.keydat_len = 0; @@ -875,7 +879,7 @@ ypoldproc_next_1_svc(yprequest *argp, struct svc_req *rqstp) result.yp_resptype = YPRESP_KEY_VAL; result.ypresponse_u.yp_resp_key_valtype.val.valdat_val = - result.ypresponse_u.yp_resp_key_valtype.key.keydat_val = ""; + result.ypresponse_u.yp_resp_key_valtype.key.keydat_val = nullbuf; result.ypresponse_u.yp_resp_key_valtype.val.valdat_len = result.ypresponse_u.yp_resp_key_valtype.key.keydat_len = 0; @@ -916,7 +920,7 @@ ypoldproc_poll_1_svc(yprequest *argp, struct svc_req *rqstp) * I hope this is right. */ result.ypresponse_u.yp_resp_map_parmstype.ordernum = 0; - result.ypresponse_u.yp_resp_map_parmstype.peer = ""; + result.ypresponse_u.yp_resp_map_parmstype.peer = nullbuf; if (argp->yp_reqtype != YPREQ_MAP_PARMS) { return(&result); @@ -956,6 +960,8 @@ ypoldproc_push_1_svc(yprequest *argp, struct svc_req *rqstp) /* * Not implemented. */ + argp = NULL; + rqstp = NULL; return (&result); } @@ -968,6 +974,8 @@ ypoldproc_pull_1_svc(yprequest *argp, struct svc_req *rqstp) /* * Not implemented. */ + argp = NULL; + rqstp = NULL; return (&result); } @@ -980,6 +988,8 @@ ypoldproc_get_1_svc(yprequest *argp, struct svc_req *rqstp) /* * Not implemented. */ + argp = NULL; + rqstp = NULL; return (&result); } |