From 315054f4737a39489e0a14f3a92bff61f1592832 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 16 Jan 2015 06:40:24 +0000 Subject: Replace with and other less dirty headers where possible. Annotate lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol) --- usr.sbin/ypbind/ypbind.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'usr.sbin/ypbind') diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 439daa2cc9b..fb06598411b 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypbind.c,v 1.62 2014/01/21 23:05:09 jsg Exp $ */ +/* $OpenBSD: ypbind.c,v 1.63 2015/01/16 06:40:22 deraadt Exp $ */ /* * Copyright (c) 1992, 1993, 1996, 1997, 1998 Theo de Raadt @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,7 @@ struct _dom_binding { int dom_lockfd; int dom_alive; u_int32_t dom_xid; - char dom_servlist[MAXPATHLEN]; + char dom_servlist[PATH_MAX]; FILE *dom_servlistfp; }; @@ -132,7 +133,7 @@ ypbindproc_domain_2x(SVCXPRT *transp, domainname *argp, CLIENT *clnt) { static struct ypbind_resp res; struct _dom_binding *ypdb; - char path[MAXPATHLEN]; + char path[PATH_MAX]; time_t now; int count = 0; @@ -333,7 +334,7 @@ usage(void) int main(int argc, char *argv[]) { - char path[MAXPATHLEN]; + char path[PATH_MAX]; struct sockaddr_in sin; struct timeval tv; fd_set *fdsrp = NULL; @@ -679,7 +680,7 @@ pings(struct _dom_binding *ypdb) struct rpc_msg msg; struct sockaddr_in bindsin; char buf[1400]; - char path[MAXPATHLEN]; + char path[PATH_MAX]; enum clnt_stat st; int outlen; AUTH *rpcua; @@ -969,7 +970,7 @@ rpc_received(char *dom, struct sockaddr_in *raddrp, int force) struct _dom_binding *ypdb; struct iovec iov[2]; struct ypbind_resp ybr; - char path[MAXPATHLEN]; + char path[PATH_MAX]; int fd; if (strchr(dom, '/')) -- cgit v1.2.3