summaryrefslogtreecommitdiff
path: root/usr.sbin/rpc.lockd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /usr.sbin/rpc.lockd
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> 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)
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r--usr.sbin/rpc.lockd/lockd.c3
-rw-r--r--usr.sbin/rpc.lockd/lockd_lock.c11
-rw-r--r--usr.sbin/rpc.lockd/procs.c6
3 files changed, 9 insertions, 11 deletions
diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c
index 0befb6d5d29..f0c8fbd943f 100644
--- a/usr.sbin/rpc.lockd/lockd.c
+++ b/usr.sbin/rpc.lockd/lockd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lockd.c,v 1.12 2009/11/15 09:07:56 chl Exp $ */
+/* $OpenBSD: lockd.c,v 1.13 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 1995
@@ -33,7 +33,6 @@
*
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <rpc/rpc.h>
diff --git a/usr.sbin/rpc.lockd/lockd_lock.c b/usr.sbin/rpc.lockd/lockd_lock.c
index c22fe6f68f6..bd687a7c803 100644
--- a/usr.sbin/rpc.lockd/lockd_lock.c
+++ b/usr.sbin/rpc.lockd/lockd_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lockd_lock.c,v 1.8 2013/04/23 18:17:22 deraadt Exp $ */
+/* $OpenBSD: lockd_lock.c,v 1.9 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2000 Manuel Bouyer.
@@ -26,6 +26,10 @@
*
*/
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/mount.h>
+#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -36,11 +40,6 @@
#include <string.h>
#include <signal.h>
#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
#include <rpcsvc/sm_inter.h>
#include <rpcsvc/nlm_prot.h>
#include "lockd_lock.h"
diff --git a/usr.sbin/rpc.lockd/procs.c b/usr.sbin/rpc.lockd/procs.c
index af8a71c5751..be4319c55e8 100644
--- a/usr.sbin/rpc.lockd/procs.c
+++ b/usr.sbin/rpc.lockd/procs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procs.c,v 1.14 2011/03/22 10:16:23 okan Exp $ */
+/* $OpenBSD: procs.c,v 1.15 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 1995
@@ -33,7 +33,6 @@
*
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <rpc/rpc.h>
@@ -46,6 +45,7 @@
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
+#include <limits.h>
#include "lockd.h"
#include "lockd_lock.h"
@@ -65,7 +65,7 @@ log_from_addr(char *fun_name, struct svc_req *req)
{
struct sockaddr_in *addr;
struct hostent *host;
- char hostname_buf[MAXHOSTNAMELEN];
+ char hostname_buf[HOST_NAME_MAX+1];
addr = svc_getcaller(req->rq_xprt);
host = gethostbyaddr((char *) &(addr->sin_addr), addr->sin_len, AF_INET);