summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/apm/apm.c4
-rw-r--r--usr.sbin/apmd/apmd.c7
-rw-r--r--usr.sbin/arp/arp.c6
-rw-r--r--usr.sbin/bgpctl/irr_asset.c3
-rw-r--r--usr.sbin/bgpctl/irr_output.c3
-rw-r--r--usr.sbin/bgpctl/irr_parser.c4
-rw-r--r--usr.sbin/bgpctl/irr_prefix.c3
-rw-r--r--usr.sbin/bgpctl/irrfilter.c3
-rw-r--r--usr.sbin/bgpd/timer.c7
-rw-r--r--usr.sbin/config/config.h6
-rw-r--r--usr.sbin/config/files.c4
-rw-r--r--usr.sbin/config/gram.y7
-rw-r--r--usr.sbin/config/main.c6
-rw-r--r--usr.sbin/config/mkheaders.c4
-rw-r--r--usr.sbin/config/mkioconf.c4
-rw-r--r--usr.sbin/config/mkmakefile.c4
-rw-r--r--usr.sbin/config/mkswap.c4
-rw-r--r--usr.sbin/config/pack.c4
-rw-r--r--usr.sbin/config/scan.l3
-rw-r--r--usr.sbin/config/sem.c4
-rw-r--r--usr.sbin/crunchgen/crunchgen.c35
-rw-r--r--usr.sbin/dev_mkdb/dev_mkdb.c5
-rw-r--r--usr.sbin/dhcpd/dhcpd.c8
-rw-r--r--usr.sbin/dhcpd/pfutils.c3
-rw-r--r--usr.sbin/dhcpd/sync.c3
-rw-r--r--usr.sbin/dhcpd/udpsock.c4
-rw-r--r--usr.sbin/dvmrpd/dvmrpd.c3
-rw-r--r--usr.sbin/dvmrpd/kroute.c3
-rw-r--r--usr.sbin/edquota/edquota.c5
-rw-r--r--usr.sbin/eeprom/main.c3
-rw-r--r--usr.sbin/hostapd/apme.c6
-rw-r--r--usr.sbin/hostapd/handle.c4
-rw-r--r--usr.sbin/hostapd/hostapd.c5
-rw-r--r--usr.sbin/hostapd/hostapd.h5
-rw-r--r--usr.sbin/hostapd/iapp.c4
-rw-r--r--usr.sbin/hostapd/llc.c4
-rw-r--r--usr.sbin/hostapd/parse.y4
-rw-r--r--usr.sbin/hostapd/print-802_11.c4
-rw-r--r--usr.sbin/hostapd/privsep.c4
-rw-r--r--usr.sbin/hostapd/roaming.c4
-rw-r--r--usr.sbin/httpd/httpd.c8
-rw-r--r--usr.sbin/httpd/httpd.h9
-rw-r--r--usr.sbin/httpd/logger.c5
-rw-r--r--usr.sbin/httpd/parse.y4
-rw-r--r--usr.sbin/httpd/server.c9
-rw-r--r--usr.sbin/httpd/server_fcgi.c4
-rw-r--r--usr.sbin/httpd/server_file.c17
-rw-r--r--usr.sbin/httpd/server_http.c9
-rw-r--r--usr.sbin/identd/identd.c5
-rw-r--r--usr.sbin/ikectl/ikeca.c6
-rw-r--r--usr.sbin/ikectl/ikectl.c3
-rw-r--r--usr.sbin/ikectl/parser.c3
-rw-r--r--usr.sbin/inetd/inetd.c10
-rw-r--r--usr.sbin/iscsictl/iscsictl.c5
-rw-r--r--usr.sbin/kgmon/kgmon.c3
-rw-r--r--usr.sbin/kvm_mkdb/kvm_mkdb.c7
-rw-r--r--usr.sbin/kvm_mkdb/nlist.c4
-rw-r--r--usr.sbin/kvm_mkdb/testdb.c4
-rw-r--r--usr.sbin/ldpd/kroute.c4
-rw-r--r--usr.sbin/ldpd/ldpd.c3
-rw-r--r--usr.sbin/lpr/common_source/common.c4
-rw-r--r--usr.sbin/lpr/common_source/common_vars.c7
-rw-r--r--usr.sbin/lpr/common_source/displayq.c4
-rw-r--r--usr.sbin/lpr/common_source/lp.h4
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c5
-rw-r--r--usr.sbin/lpr/common_source/startdaemon.c4
-rw-r--r--usr.sbin/lpr/lpc/cmds.c6
-rw-r--r--usr.sbin/lpr/lpc/lpc.c9
-rw-r--r--usr.sbin/lpr/lpd/key.c5
-rw-r--r--usr.sbin/lpr/lpd/lpd.c4
-rw-r--r--usr.sbin/lpr/lpd/modes.c3
-rw-r--r--usr.sbin/lpr/lpd/printjob.c8
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c5
-rw-r--r--usr.sbin/lpr/lpq/lpq.c5
-rw-r--r--usr.sbin/lpr/lpr/lpr.c8
-rw-r--r--usr.sbin/lpr/lprm/lprm.c7
-rw-r--r--usr.sbin/map-mbone/mapper.c7
-rw-r--r--usr.sbin/mrinfo/mrinfo.c3
-rw-r--r--usr.sbin/mrouted/defs.h7
-rw-r--r--usr.sbin/mrouted/igmp.c2
-rw-r--r--usr.sbin/mrouted/pathnames.h6
-rw-r--r--usr.sbin/mrouted/rsrr.c9
-rw-r--r--usr.sbin/mrouted/vif.c4
-rw-r--r--usr.sbin/mtrace/mtrace.c6
-rw-r--r--usr.sbin/mtree/compare.c6
-rw-r--r--usr.sbin/mtree/create.c8
-rw-r--r--usr.sbin/mtree/mtree.c6
-rw-r--r--usr.sbin/mtree/verify.c8
-rw-r--r--usr.sbin/ndp/ndp.c3
-rw-r--r--usr.sbin/ospf6d/kroute.c4
-rw-r--r--usr.sbin/ospf6d/ospf6d.c3
-rw-r--r--usr.sbin/ospf6d/rde.c7
-rw-r--r--usr.sbin/ospfd/kroute.c4
-rw-r--r--usr.sbin/ospfd/ospfd.c3
-rw-r--r--usr.sbin/pcidump/pcidump.c7
-rw-r--r--usr.sbin/pppd/auth.c5
-rw-r--r--usr.sbin/pppd/demand.c16
-rw-r--r--usr.sbin/pppd/ipcp.c9
-rw-r--r--usr.sbin/pppd/main.c28
-rw-r--r--usr.sbin/pppd/options.c8
-rw-r--r--usr.sbin/pppd/pppd.h7
-rw-r--r--usr.sbin/pppd/pppstats/pppstats.c15
-rw-r--r--usr.sbin/procmap/procmap.c4
-rw-r--r--usr.sbin/pstat/pstat.c5
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c19
-rw-r--r--usr.sbin/quot/quot.c4
-rw-r--r--usr.sbin/quotaon/quotaon.c1
-rw-r--r--usr.sbin/rarpd/arptab.c3
-rw-r--r--usr.sbin/rarpd/rarpd.c23
-rw-r--r--usr.sbin/rbootd/bpf.c3
-rw-r--r--usr.sbin/rbootd/conf.c6
-rw-r--r--usr.sbin/rbootd/defs.h9
-rw-r--r--usr.sbin/rbootd/parseconf.c3
-rw-r--r--usr.sbin/rbootd/rbootd.c6
-rw-r--r--usr.sbin/rbootd/rmpproto.c3
-rw-r--r--usr.sbin/rbootd/utils.c4
-rw-r--r--usr.sbin/rdate/ntp.c3
-rw-r--r--usr.sbin/rdate/rdate.c3
-rw-r--r--usr.sbin/rdate/rfc868time.c3
-rw-r--r--usr.sbin/relayctl/relayctl.c4
-rw-r--r--usr.sbin/repquota/repquota.c2
-rw-r--r--usr.sbin/ripd/kroute.c3
-rw-r--r--usr.sbin/ripd/rde.c7
-rw-r--r--usr.sbin/ripd/ripd.c3
-rw-r--r--usr.sbin/rmt/rmt.c6
-rw-r--r--usr.sbin/route6d/route6d.c3
-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
-rw-r--r--usr.sbin/rpc.statd/statd.c7
-rw-r--r--usr.sbin/rtadvd/config.c3
-rw-r--r--usr.sbin/rtadvd/if.c3
-rw-r--r--usr.sbin/rtadvd/rrenum.c3
-rw-r--r--usr.sbin/rtadvd/rtadvd.c5
-rw-r--r--usr.sbin/sa/extern.h5
-rw-r--r--usr.sbin/sasyncd/monitor.c6
-rw-r--r--usr.sbin/sasyncd/pfkey.c3
-rw-r--r--usr.sbin/sensorsd/sensorsd.c5
-rw-r--r--usr.sbin/slowcgi/slowcgi.c9
-rw-r--r--usr.sbin/smtpd/ber.c6
-rw-r--r--usr.sbin/smtpd/ca.c3
-rw-r--r--usr.sbin/smtpd/config.c3
-rw-r--r--usr.sbin/smtpd/envelope.c3
-rw-r--r--usr.sbin/smtpd/lka.c3
-rw-r--r--usr.sbin/smtpd/makemap.c3
-rw-r--r--usr.sbin/smtpd/mproc.c3
-rw-r--r--usr.sbin/smtpd/mta.c3
-rw-r--r--usr.sbin/smtpd/mta_session.c3
-rw-r--r--usr.sbin/smtpd/parse.y5
-rw-r--r--usr.sbin/smtpd/queue_backend.c9
-rw-r--r--usr.sbin/smtpd/queue_fs.c5
-rw-r--r--usr.sbin/smtpd/queue_proc.c3
-rw-r--r--usr.sbin/smtpd/scheduler_proc.c3
-rw-r--r--usr.sbin/smtpd/smtp.c3
-rw-r--r--usr.sbin/smtpd/smtp_session.c3
-rw-r--r--usr.sbin/smtpd/smtpd.c3
-rw-r--r--usr.sbin/smtpd/ssl_smtpd.c3
-rw-r--r--usr.sbin/smtpd/table_passwd.c3
-rw-r--r--usr.sbin/smtpd/table_proc.c3
-rw-r--r--usr.sbin/smtpd/table_sqlite.c3
-rw-r--r--usr.sbin/smtpd/to.c3
-rw-r--r--usr.sbin/smtpd/util.c3
-rw-r--r--usr.sbin/snmpctl/snmpclient.c3
-rw-r--r--usr.sbin/syslogd/privsep.c19
-rw-r--r--usr.sbin/syslogd/privsep_fdpass.c4
-rw-r--r--usr.sbin/syslogd/ringbuf.c11
-rw-r--r--usr.sbin/syslogd/syslogd.c20
-rw-r--r--usr.sbin/syslogd/ttymsg.c4
-rw-r--r--usr.sbin/tcpdrop/tcpdrop.c3
-rw-r--r--usr.sbin/tcpdump/addrtoname.c12
-rw-r--r--usr.sbin/tcpdump/print-802_11.c3
-rw-r--r--usr.sbin/tcpdump/print-arp.c3
-rw-r--r--usr.sbin/tcpdump/print-atalk.c8
-rw-r--r--usr.sbin/tcpdump/print-atm.c3
-rw-r--r--usr.sbin/tcpdump/print-bgp.c10
-rw-r--r--usr.sbin/tcpdump/print-bootp.c3
-rw-r--r--usr.sbin/tcpdump/print-cdp.c3
-rw-r--r--usr.sbin/tcpdump/print-decnet.c3
-rw-r--r--usr.sbin/tcpdump/print-dhcp6.c3
-rw-r--r--usr.sbin/tcpdump/print-domain.c3
-rw-r--r--usr.sbin/tcpdump/print-dvmrp.c3
-rw-r--r--usr.sbin/tcpdump/print-enc.c4
-rw-r--r--usr.sbin/tcpdump/print-ether.c3
-rw-r--r--usr.sbin/tcpdump/print-etherip.c3
-rw-r--r--usr.sbin/tcpdump/print-fddi.c3
-rw-r--r--usr.sbin/tcpdump/print-frag6.c3
-rw-r--r--usr.sbin/tcpdump/print-gre.c3
-rw-r--r--usr.sbin/tcpdump/print-gtp.c3
-rw-r--r--usr.sbin/tcpdump/print-iapp.c3
-rw-r--r--usr.sbin/tcpdump/print-icmp.c8
-rw-r--r--usr.sbin/tcpdump/print-icmp6.c3
-rw-r--r--usr.sbin/tcpdump/print-igrp.c3
-rw-r--r--usr.sbin/tcpdump/print-ike.c3
-rw-r--r--usr.sbin/tcpdump/print-ip.c3
-rw-r--r--usr.sbin/tcpdump/print-ip6.c3
-rw-r--r--usr.sbin/tcpdump/print-ip6opts.c3
-rw-r--r--usr.sbin/tcpdump/print-ipsec.c3
-rw-r--r--usr.sbin/tcpdump/print-ipx.c3
-rw-r--r--usr.sbin/tcpdump/print-krb.c3
-rw-r--r--usr.sbin/tcpdump/print-l2tp.c3
-rw-r--r--usr.sbin/tcpdump/print-llc.c3
-rw-r--r--usr.sbin/tcpdump/print-lldp.c3
-rw-r--r--usr.sbin/tcpdump/print-lwres.c1
-rw-r--r--usr.sbin/tcpdump/print-mobile.c3
-rw-r--r--usr.sbin/tcpdump/print-netbios.c3
-rw-r--r--usr.sbin/tcpdump/print-nfs.c3
-rw-r--r--usr.sbin/tcpdump/print-ntp.c3
-rw-r--r--usr.sbin/tcpdump/print-null.c3
-rw-r--r--usr.sbin/tcpdump/print-ospf.c3
-rw-r--r--usr.sbin/tcpdump/print-ospf6.c3
-rw-r--r--usr.sbin/tcpdump/print-pflog.c5
-rw-r--r--usr.sbin/tcpdump/print-pfsync.c4
-rw-r--r--usr.sbin/tcpdump/print-pim.c3
-rw-r--r--usr.sbin/tcpdump/print-ppp.c3
-rw-r--r--usr.sbin/tcpdump/print-raw.c3
-rw-r--r--usr.sbin/tcpdump/print-rip.c3
-rw-r--r--usr.sbin/tcpdump/print-ripng.c3
-rw-r--r--usr.sbin/tcpdump/print-rt6.c3
-rw-r--r--usr.sbin/tcpdump/print-skip.c3
-rw-r--r--usr.sbin/tcpdump/print-sl.c5
-rw-r--r--usr.sbin/tcpdump/print-slow.c3
-rw-r--r--usr.sbin/tcpdump/print-snmp.c3
-rw-r--r--usr.sbin/tcpdump/print-stp.c3
-rw-r--r--usr.sbin/tcpdump/print-sunrpc.c3
-rw-r--r--usr.sbin/tcpdump/print-tcp.c3
-rw-r--r--usr.sbin/tcpdump/print-tftp.c3
-rw-r--r--usr.sbin/tcpdump/print-timed.c3
-rw-r--r--usr.sbin/tcpdump/print-udp.c3
-rw-r--r--usr.sbin/tcpdump/privsep.c6
-rw-r--r--usr.sbin/tcpdump/smbutil.c3
-rw-r--r--usr.sbin/tftp-proxy/tftp-proxy.c5
-rw-r--r--usr.sbin/tftpd/tftpd.c13
-rw-r--r--usr.sbin/tokenadm/tokenadm.c5
-rw-r--r--usr.sbin/tokeninit/tokeninit.c5
-rw-r--r--usr.sbin/traceroute/traceroute.c6
-rw-r--r--usr.sbin/trpt/trpt.c3
-rw-r--r--usr.sbin/user/user.c7
-rw-r--r--usr.sbin/watchdogd/watchdogd.c5
-rw-r--r--usr.sbin/ypbind/ypbind.c13
-rw-r--r--usr.sbin/ypldap/ber.c6
-rw-r--r--usr.sbin/ypldap/entries.c4
-rw-r--r--usr.sbin/ypldap/ldapclient.c5
-rw-r--r--usr.sbin/ypldap/parse.y3
-rw-r--r--usr.sbin/ypldap/yp.c4
-rw-r--r--usr.sbin/ypldap/ypldap.c5
-rw-r--r--usr.sbin/ypldap/ypldap.h6
-rw-r--r--usr.sbin/ypldap/ypldap_dns.c4
-rw-r--r--usr.sbin/yppoll/yppoll.c3
-rw-r--r--usr.sbin/ypserv/common/ypdb.c5
-rw-r--r--usr.sbin/ypserv/common/yplib_host.c3
-rw-r--r--usr.sbin/ypserv/makedbm/db.c5
-rw-r--r--usr.sbin/ypserv/makedbm/makedbm.c13
-rw-r--r--usr.sbin/ypserv/mkalias/mkalias.c13
-rw-r--r--usr.sbin/ypserv/mknetid/mknetid.c8
-rw-r--r--usr.sbin/ypserv/yppush/yppush.c8
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv_db.c9
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv_proc.c13
-rw-r--r--usr.sbin/ypserv/ypxfr/ypxfr.c8
-rw-r--r--usr.sbin/ypset/ypset.c3
-rw-r--r--usr.sbin/ztsscale/ztsscale.c4
260 files changed, 626 insertions, 736 deletions
diff --git a/usr.sbin/apm/apm.c b/usr.sbin/apm/apm.c
index a358f609b68..551a083f875 100644
--- a/usr.sbin/apm/apm.c
+++ b/usr.sbin/apm/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.28 2014/10/17 07:43:33 jmc Exp $ */
+/* $OpenBSD: apm.c,v 1.29 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 1996 John T. Kohl
@@ -29,7 +29,7 @@
*
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index 87dc1ddeead..e73f35a95b3 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmd.c,v 1.73 2014/10/28 06:04:19 dcoppa Exp $ */
+/* $OpenBSD: apmd.c,v 1.74 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
@@ -29,7 +29,6 @@
*
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -48,7 +47,9 @@
#include <signal.h>
#include <errno.h>
#include <err.h>
+#include <limits.h>
#include <machine/apmvar.h>
+
#include "pathnames.h"
#include "apm-proto.h"
@@ -190,7 +191,7 @@ power_status(int fd, int force, struct apm_power_info *pinfo)
return acon;
}
-char socketname[MAXPATHLEN];
+char socketname[PATH_MAX];
void
sockunlink(void)
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index 3c070fbd579..fcd61491e3b 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arp.c,v 1.62 2014/09/07 22:40:30 bluhm Exp $ */
+/* $OpenBSD: arp.c,v 1.63 2015/01/16 06:40:15 deraadt Exp $ */
/* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */
/*
@@ -37,7 +37,6 @@
* arp - display, set, delete arp table entries and wake up hosts.
*/
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -59,6 +58,7 @@
#include <string.h>
#include <paths.h>
#include <unistd.h>
+#include <limits.h>
#include <ifaddrs.h>
void dump(void);
@@ -841,7 +841,7 @@ do_wakeup(const char *eaddr, const char *iface, int bpf)
int
get_bpf(void)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
int i, fd;
for (i = 0; ; i++) {
diff --git a/usr.sbin/bgpctl/irr_asset.c b/usr.sbin/bgpctl/irr_asset.c
index 7d303befd54..6c579241327 100644
--- a/usr.sbin/bgpctl/irr_asset.c
+++ b/usr.sbin/bgpctl/irr_asset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_asset.c,v 1.10 2014/10/08 16:15:37 deraadt Exp $ */
+/* $OpenBSD: irr_asset.c,v 1.11 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -17,7 +17,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/bgpctl/irr_output.c b/usr.sbin/bgpctl/irr_output.c
index 1f86bdb8ca6..36e77ffb99d 100644
--- a/usr.sbin/bgpctl/irr_output.c
+++ b/usr.sbin/bgpctl/irr_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_output.c,v 1.15 2013/11/22 15:15:16 deraadt Exp $ */
+/* $OpenBSD: irr_output.c,v 1.16 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -17,7 +17,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <err.h>
diff --git a/usr.sbin/bgpctl/irr_parser.c b/usr.sbin/bgpctl/irr_parser.c
index c61e0aa3520..b707e97e39c 100644
--- a/usr.sbin/bgpctl/irr_parser.c
+++ b/usr.sbin/bgpctl/irr_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_parser.c,v 1.11 2013/11/22 15:15:16 deraadt Exp $ */
+/* $OpenBSD: irr_parser.c,v 1.12 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -17,13 +17,13 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <ctype.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "irrfilter.h"
diff --git a/usr.sbin/bgpctl/irr_prefix.c b/usr.sbin/bgpctl/irr_prefix.c
index 80a645b0d55..f4bd3006df8 100644
--- a/usr.sbin/bgpctl/irr_prefix.c
+++ b/usr.sbin/bgpctl/irr_prefix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_prefix.c,v 1.19 2014/10/08 16:15:37 deraadt Exp $ */
+/* $OpenBSD: irr_prefix.c,v 1.20 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -17,7 +17,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <err.h>
#include <errno.h>
diff --git a/usr.sbin/bgpctl/irrfilter.c b/usr.sbin/bgpctl/irrfilter.c
index fb5b4f05fff..0873586dfb8 100644
--- a/usr.sbin/bgpctl/irrfilter.c
+++ b/usr.sbin/bgpctl/irrfilter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irrfilter.c,v 1.4 2007/05/28 23:31:53 henning Exp $ */
+/* $OpenBSD: irrfilter.c,v 1.5 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -17,7 +17,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/bgpd/timer.c b/usr.sbin/bgpd/timer.c
index 1690708e7ce..65da0002955 100644
--- a/usr.sbin/bgpd/timer.c
+++ b/usr.sbin/bgpd/timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.c,v 1.15 2012/04/12 17:26:09 claudio Exp $ */
+/* $OpenBSD: timer.c,v 1.16 2015/01/16 06:40:15 deraadt Exp $ */
/*
* Copyright (c) 2003-2007 Henning Brauer <henning@openbsd.org>
@@ -16,13 +16,14 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <stdlib.h>
#include "bgpd.h"
#include "session.h"
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
time_t
getmonotime(void)
{
@@ -63,7 +64,7 @@ timer_nextduein(struct peer *p)
struct peer_timer *pt;
if ((pt = TAILQ_FIRST(&p->timers)) != NULL && pt->val > 0)
- return (MAX(pt->val - getmonotime(), 0));
+ return (MAXIMUM(pt->val - getmonotime(), 0));
return (-1);
}
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index f078f586afd..41aafc8fd17 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.h,v 1.27 2014/05/18 09:29:54 espie Exp $ */
+/* $OpenBSD: config.h,v 1.28 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: config.h,v 1.30 1997/02/02 21:12:30 thorpej Exp $ */
/*
@@ -46,12 +46,8 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
-#if !defined(MAKE_BOOTSTRAP) && defined(BSD)
#include <paths.h>
-#endif /* ...BSD */
-
#include <stdlib.h>
#include <unistd.h>
diff --git a/usr.sbin/config/files.c b/usr.sbin/config/files.c
index b80f6e5cdd0..1610903d14c 100644
--- a/usr.sbin/config/files.c
+++ b/usr.sbin/config/files.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: files.c,v 1.19 2012/09/17 17:36:13 espie Exp $ */
+/* $OpenBSD: files.c,v 1.20 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: files.c,v 1.6 1996/03/17 13:18:17 cgd Exp $ */
/*
@@ -41,8 +41,6 @@
* from: @(#)files.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/config/gram.y b/usr.sbin/config/gram.y
index da4a6177a56..b4229937176 100644
--- a/usr.sbin/config/gram.y
+++ b/usr.sbin/config/gram.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: gram.y,v 1.23 2012/09/17 17:36:13 espie Exp $ */
+/* $OpenBSD: gram.y,v 1.24 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: gram.y,v 1.14 1997/02/02 21:12:32 thorpej Exp $ */
/*
@@ -42,11 +42,12 @@
* from: @(#)gram.y 8.1 (Berkeley) 6/6/93
*/
+#include <sys/param.h> /* NODEV */
#include <sys/types.h>
-#include <sys/param.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <string.h>
#include <errno.h>
#include "config.h"
@@ -447,7 +448,7 @@ cleanup(void)
static void
setmachine(const char *mch, const char *mcharch)
{
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
machine = mch;
machinearch = mcharch;
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 0644a230cd4..6805b2665b4 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.47 2014/05/18 09:29:54 espie Exp $ */
+/* $OpenBSD: main.c,v 1.48 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: main.c,v 1.22 1997/02/02 21:12:33 thorpej Exp $ */
/*
@@ -43,7 +43,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <ctype.h>
#include <err.h>
@@ -52,6 +51,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "config.h"
@@ -313,7 +313,7 @@ static int
mksymlinks(void)
{
int ret;
- char *p, buf[MAXPATHLEN];
+ char *p, buf[PATH_MAX];
const char *q;
snprintf(buf, sizeof buf, "arch/%s/include", machine);
diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c
index 6f29be63686..497dcc8e3d8 100644
--- a/usr.sbin/config/mkheaders.c
+++ b/usr.sbin/config/mkheaders.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkheaders.c,v 1.20 2013/11/23 17:38:15 deraadt Exp $ */
+/* $OpenBSD: mkheaders.c,v 1.21 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: mkheaders.c,v 1.12 1997/02/02 21:12:34 thorpej Exp $ */
/*
@@ -41,8 +41,6 @@
* from: @(#)mkheaders.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
-
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index ddc9ec586ea..7dc2ad2ca4d 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkioconf.c,v 1.32 2014/05/18 09:29:54 espie Exp $ */
+/* $OpenBSD: mkioconf.c,v 1.33 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: mkioconf.c,v 1.41 1996/11/11 14:18:49 mycroft Exp $ */
/*
@@ -41,8 +41,6 @@
* from: @(#)mkioconf.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 0f497f568cf..7d260aedb58 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkmakefile.c,v 1.40 2014/06/04 07:14:29 jsg Exp $ */
+/* $OpenBSD: mkmakefile.c,v 1.41 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: mkmakefile.c,v 1.34 1997/02/02 21:12:36 thorpej Exp $ */
/*
@@ -41,8 +41,6 @@
* from: @(#)mkmakefile.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
-
#include <ctype.h>
#include <err.h>
#include <errno.h>
diff --git a/usr.sbin/config/mkswap.c b/usr.sbin/config/mkswap.c
index 2783404496d..9926034092b 100644
--- a/usr.sbin/config/mkswap.c
+++ b/usr.sbin/config/mkswap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkswap.c,v 1.14 2013/04/19 15:03:02 florian Exp $ */
+/* $OpenBSD: mkswap.c,v 1.15 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: mkswap.c,v 1.5 1996/08/31 20:58:27 mycroft Exp $ */
/*
@@ -41,7 +41,7 @@
* from: @(#)mkswap.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
+#include <sys/param.h> /* NODEV */
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/config/pack.c b/usr.sbin/config/pack.c
index 93a74e6e64d..56cfb705f18 100644
--- a/usr.sbin/config/pack.c
+++ b/usr.sbin/config/pack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pack.c,v 1.17 2014/05/18 09:29:54 espie Exp $ */
+/* $OpenBSD: pack.c,v 1.18 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: pack.c,v 1.5 1996/08/31 21:15:11 mycroft Exp $ */
/*
@@ -41,8 +41,6 @@
* from: @(#)pack.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
-
#include <stdlib.h>
#include <string.h>
diff --git a/usr.sbin/config/scan.l b/usr.sbin/config/scan.l
index f37ffc24548..b5c0543325c 100644
--- a/usr.sbin/config/scan.l
+++ b/usr.sbin/config/scan.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: scan.l,v 1.21 2012/09/17 17:36:13 espie Exp $ */
+/* $OpenBSD: scan.l,v 1.22 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: scan.l,v 1.13 1997/02/02 21:12:37 thorpej Exp $ */
/*
@@ -42,7 +42,6 @@
* from: @(#)scan.l 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/config/sem.c b/usr.sbin/config/sem.c
index 328d5f73f1a..87f03b0ac63 100644
--- a/usr.sbin/config/sem.c
+++ b/usr.sbin/config/sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sem.c,v 1.34 2014/05/18 09:29:54 espie Exp $ */
+/* $OpenBSD: sem.c,v 1.35 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: sem.c,v 1.10 1996/11/11 23:40:11 gwr Exp $ */
/*
@@ -41,7 +41,7 @@
* from: @(#)sem.c 8.1 (Berkeley) 6/6/93
*/
-#include <sys/param.h>
+#include <sys/param.h> /* NODEV */
#include <ctype.h>
#include <err.h>
diff --git a/usr.sbin/crunchgen/crunchgen.c b/usr.sbin/crunchgen/crunchgen.c
index 679b63d5de1..2da9aca88af 100644
--- a/usr.sbin/crunchgen/crunchgen.c
+++ b/usr.sbin/crunchgen/crunchgen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crunchgen.c,v 1.13 2014/01/11 04:44:15 deraadt Exp $ */
+/* $OpenBSD: crunchgen.c,v 1.14 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 1994 University of Maryland
@@ -32,15 +32,16 @@
* Generates a Makefile and main C file for a crunched executable,
* from specs given in a .conf file.
*/
+#include <sys/param.h> /* MACHINE */
+#include <sys/types.h>
+#include <sys/stat.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/param.h>
+#include <limits.h>
#define CRUNCH_VERSION "1.3"
@@ -82,15 +83,15 @@ typedef struct prog {
strlst_t *srcdirs = NULL;
strlst_t *libs = NULL;
strlst_t *libdirs = NULL;
-char objdir[MAXPATHLEN] = "obj";
+char objdir[PATH_MAX] = "obj";
prog_t *progs = NULL;
char line[MAXLINELEN];
-char confname[MAXPATHLEN], infilename[MAXPATHLEN];
-char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN];
-char cachename[MAXPATHLEN], curfilename[MAXPATHLEN];
-char topdir[MAXPATHLEN], execfname[MAXPATHLEN];
+char confname[PATH_MAX], infilename[PATH_MAX];
+char outmkname[PATH_MAX], outcfname[PATH_MAX];
+char cachename[PATH_MAX], curfilename[PATH_MAX];
+char topdir[PATH_MAX], execfname[PATH_MAX];
int linenum = -1;
int goterror = 0;
@@ -154,7 +155,7 @@ main(int argc, char *argv[])
elf_names = 1;
break;
case 'L':
- if (strlen(optarg) >= MAXPATHLEN)
+ if (strlen(optarg) >= PATH_MAX)
usage();
add_string(&libdirs, optarg);
break;
@@ -334,7 +335,7 @@ void
add_srcdirs(int argc, char **argv)
{
int i;
- char tmppath[MAXPATHLEN];
+ char tmppath[PATH_MAX];
int overflow;
for (i = 1; i < argc; i++) {
@@ -372,8 +373,8 @@ void
add_libdirs(int argc, char **argv)
{
int i;
- char tmppath[MAXPATHLEN];
- char tmppath2[MAXPATHLEN];
+ char tmppath[PATH_MAX];
+ char tmppath2[PATH_MAX];
int overflow;
for (i = 1; i < argc; i++) {
@@ -581,7 +582,7 @@ gen_outputs(void)
void
fillin_program(prog_t * p)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
char *srcparent;
strlst_t *s;
int i;
@@ -651,7 +652,7 @@ fillin_program(prog_t * p)
void
fillin_program_objs(prog_t * p, char *path)
{
- char *cp, *obj, tempfname[MAXPATHLEN];
+ char *cp, *obj, tempfname[PATH_MAX];
int fd, rc;
FILE *f;
@@ -850,7 +851,7 @@ genident(char *str)
char *
dir_search(char *progname)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
strlst_t *dir;
for (dir = srcdirs; dir != NULL; dir = dir->next) {
diff --git a/usr.sbin/dev_mkdb/dev_mkdb.c b/usr.sbin/dev_mkdb/dev_mkdb.c
index 08570b688b2..74a05d6d4aa 100644
--- a/usr.sbin/dev_mkdb/dev_mkdb.c
+++ b/usr.sbin/dev_mkdb/dev_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_mkdb.c,v 1.12 2013/11/27 13:32:02 okan Exp $ */
+/* $OpenBSD: dev_mkdb.c,v 1.13 2015/01/16 06:40:16 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <db.h>
@@ -60,7 +59,7 @@ main(int argc, char *argv[])
HASHINFO info;
int ch;
u_char buf[MAXNAMLEN + 1];
- char dbtmp[MAXPATHLEN], dbname[MAXPATHLEN];
+ char dbtmp[PATH_MAX], dbname[PATH_MAX];
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
diff --git a/usr.sbin/dhcpd/dhcpd.c b/usr.sbin/dhcpd/dhcpd.c
index 8c854bbf9dd..38bd308ddc0 100644
--- a/usr.sbin/dhcpd/dhcpd.c
+++ b/usr.sbin/dhcpd/dhcpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.c,v 1.45 2014/07/11 09:42:27 yasuoka Exp $ */
+/* $OpenBSD: dhcpd.c,v 1.46 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
@@ -320,6 +320,8 @@ lease_ping_timeout(void *vlp)
/* from memory.c - needed to be able to walk the lease table */
extern struct subnet *subnets;
+#define MINIMUM(a,b) (((a)<(b))?(a):(b))
+
void
periodic_scan(void *p)
{
@@ -330,10 +332,10 @@ periodic_scan(void *p)
struct lease *l;
/* find the shortest lease this server gives out */
- x = MIN(root_group.default_lease_time, root_group.max_lease_time);
+ x = MINIMUM(root_group.default_lease_time, root_group.max_lease_time);
for (n = subnets; n; n = n->next_subnet)
for (g = n->group; g; g = g->next)
- x = MIN(x, g->default_lease_time);
+ x = MINIMUM(x, g->default_lease_time);
/* use half of the shortest lease as the scan interval */
y = x / 2;
diff --git a/usr.sbin/dhcpd/pfutils.c b/usr.sbin/dhcpd/pfutils.c
index 1a1d36846eb..cdf1af8b196 100644
--- a/usr.sbin/dhcpd/pfutils.c
+++ b/usr.sbin/dhcpd/pfutils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfutils.c,v 1.10 2013/10/18 15:19:39 krw Exp $ */
+/* $OpenBSD: pfutils.c,v 1.11 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org>
*
@@ -17,7 +17,6 @@
#include <sys/types.h>
#include <sys/ioctl.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
diff --git a/usr.sbin/dhcpd/sync.c b/usr.sbin/dhcpd/sync.c
index 27346b82854..3418559492b 100644
--- a/usr.sbin/dhcpd/sync.c
+++ b/usr.sbin/dhcpd/sync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sync.c,v 1.15 2013/10/18 15:19:40 krw Exp $ */
+/* $OpenBSD: sync.c,v 1.16 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2008 Bob Beck <beck@openbsd.org>
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/stdint.h>
#include <sys/file.h>
#include <sys/wait.h>
diff --git a/usr.sbin/dhcpd/udpsock.c b/usr.sbin/dhcpd/udpsock.c
index 548767a14b0..182887ff17c 100644
--- a/usr.sbin/dhcpd/udpsock.c
+++ b/usr.sbin/dhcpd/udpsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udpsock.c,v 1.1 2014/07/11 09:42:27 yasuoka Exp $ */
+/* $OpenBSD: udpsock.c,v 1.2 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2014 YASUOKA Masahiko <yasuoka@openbsd.org>
@@ -16,7 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* nitems */
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
diff --git a/usr.sbin/dvmrpd/dvmrpd.c b/usr.sbin/dvmrpd/dvmrpd.c
index cca3415a6c5..1784b9be26a 100644
--- a/usr.sbin/dvmrpd/dvmrpd.c
+++ b/usr.sbin/dvmrpd/dvmrpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvmrpd.c,v 1.16 2014/07/12 19:22:32 krw Exp $ */
+/* $OpenBSD: dvmrpd.c,v 1.17 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -23,7 +23,6 @@
#include <sys/queue.h>
#include <sys/time.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/wait.h>
diff --git a/usr.sbin/dvmrpd/kroute.c b/usr.sbin/dvmrpd/kroute.c
index d958a376d50..f90a2b2c642 100644
--- a/usr.sbin/dvmrpd/kroute.c
+++ b/usr.sbin/dvmrpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.8 2014/06/23 03:46:17 guenther Exp $ */
+/* $OpenBSD: kroute.c,v 1.9 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index 7471445c2a2..904569ecca1 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -33,7 +33,7 @@
/*
* Disk quota editor.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* btodb dbtob */
#include <sys/stat.h>
#include <sys/file.h>
#include <sys/wait.h>
@@ -51,6 +51,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
char *qfname = QUOTAFILENAME;
char *qfextension[] = INITQFNAMES;
@@ -61,7 +62,7 @@ struct quotause {
struct quotause *next;
long flags;
struct dqblk dqblk;
- char fsname[MAXPATHLEN];
+ char fsname[PATH_MAX];
char qfname[1]; /* actually longer */
} *getprivs(u_int, int);
#define FOUND 0x01
diff --git a/usr.sbin/eeprom/main.c b/usr.sbin/eeprom/main.c
index 3500fbb366f..68fec1aa674 100644
--- a/usr.sbin/eeprom/main.c
+++ b/usr.sbin/eeprom/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.19 2014/07/24 19:19:26 miod Exp $ */
+/* $OpenBSD: main.c,v 1.20 2015/01/16 06:40:16 deraadt Exp $ */
/* $NetBSD: main.c,v 1.3 1996/05/16 16:00:55 thorpej Exp $ */
/*-
@@ -30,7 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <err.h>
#include <string.h>
#include <stdio.h>
diff --git a/usr.sbin/hostapd/apme.c b/usr.sbin/hostapd/apme.c
index 33ef473dcbe..df4ca930253 100644
--- a/usr.sbin/hostapd/apme.c
+++ b/usr.sbin/hostapd/apme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apme.c,v 1.15 2007/02/08 11:15:55 reyk Exp $ */
+/* $OpenBSD: apme.c,v 1.16 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -16,9 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* roundup isclr */
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/uio.h>
@@ -41,6 +40,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "hostapd.h"
#include "iapp.h"
diff --git a/usr.sbin/hostapd/handle.c b/usr.sbin/hostapd/handle.c
index 052d97adb1f..77c6d07d875 100644
--- a/usr.sbin/hostapd/handle.c
+++ b/usr.sbin/hostapd/handle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: handle.c,v 1.11 2007/02/08 11:15:55 reyk Exp $ */
+/* $OpenBSD: handle.c,v 1.12 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -41,6 +40,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "hostapd.h"
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c
index 6ed01d656ac..0e43c64dffd 100644
--- a/usr.sbin/hostapd/hostapd.c
+++ b/usr.sbin/hostapd/hostapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.c,v 1.34 2008/05/12 23:49:28 millert Exp $ */
+/* $OpenBSD: hostapd.c,v 1.35 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -17,9 +17,9 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/queue.h>
@@ -44,6 +44,7 @@
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <err.h>
#include "hostapd.h"
diff --git a/usr.sbin/hostapd/hostapd.h b/usr.sbin/hostapd/hostapd.h
index 3bf4a9e1761..e01cfbcca94 100644
--- a/usr.sbin/hostapd/hostapd.h
+++ b/usr.sbin/hostapd/hostapd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.h,v 1.20 2006/12/31 03:25:58 reyk Exp $ */
+/* $OpenBSD: hostapd.h,v 1.21 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -19,7 +19,6 @@
#ifndef _HOSTAPD_H
#define _HOSTAPD_H
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/tree.h>
@@ -344,7 +343,7 @@ struct hostapd_config {
struct event c_priv_ev;
- char c_config[MAXPATHLEN];
+ char c_config[PATH_MAX];
u_int c_verbose;
u_int c_debug;
diff --git a/usr.sbin/hostapd/iapp.c b/usr.sbin/hostapd/iapp.c
index 308fbd813cc..68222c77c35 100644
--- a/usr.sbin/hostapd/iapp.c
+++ b/usr.sbin/hostapd/iapp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iapp.c,v 1.18 2009/04/16 20:13:13 sobrado Exp $ */
+/* $OpenBSD: iapp.c,v 1.19 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -38,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "hostapd.h"
#include "iapp.h"
diff --git a/usr.sbin/hostapd/llc.c b/usr.sbin/hostapd/llc.c
index 82dfb7d3031..c12043043d4 100644
--- a/usr.sbin/hostapd/llc.c
+++ b/usr.sbin/hostapd/llc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: llc.c,v 1.5 2007/02/08 11:15:55 reyk Exp $ */
+/* $OpenBSD: llc.c,v 1.6 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -38,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "hostapd.h"
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y
index 8a5ad076754..1ffd4c2de09 100644
--- a/usr.sbin/hostapd/parse.y
+++ b/usr.sbin/hostapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.48 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.49 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -21,7 +21,6 @@
*/
%{
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -52,6 +51,7 @@
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <stdint.h>
#include <err.h>
diff --git a/usr.sbin/hostapd/print-802_11.c b/usr.sbin/hostapd/print-802_11.c
index 1e50ce3210d..66c4ce14ca6 100644
--- a/usr.sbin/hostapd/print-802_11.c
+++ b/usr.sbin/hostapd/print-802_11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-802_11.c,v 1.6 2006/06/26 23:06:07 reyk Exp $ */
+/* $OpenBSD: print-802_11.c,v 1.7 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2005 Reyk Floeter <reyk@openbsd.org>
@@ -18,7 +18,6 @@
/* usr.sbin/tcpdump/print-802_11.c,v 1.3 2005/03/09 11:43:17 deraadt Exp */
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
@@ -41,6 +40,7 @@
#include <pcap.h>
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include "hostapd.h"
diff --git a/usr.sbin/hostapd/privsep.c b/usr.sbin/hostapd/privsep.c
index 7b27131fc4e..c4675587e71 100644
--- a/usr.sbin/hostapd/privsep.c
+++ b/usr.sbin/hostapd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.23 2007/05/02 09:09:29 claudio Exp $ */
+/* $OpenBSD: privsep.c,v 1.24 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -48,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "hostapd.h"
#include "iapp.h"
diff --git a/usr.sbin/hostapd/roaming.c b/usr.sbin/hostapd/roaming.c
index e62bf4c3191..47ddec60096 100644
--- a/usr.sbin/hostapd/roaming.c
+++ b/usr.sbin/hostapd/roaming.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roaming.c,v 1.5 2010/05/26 19:18:10 millert Exp $ */
+/* $OpenBSD: roaming.c,v 1.6 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/tree.h>
@@ -39,6 +38,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include <limits.h>
#include "hostapd.h"
diff --git a/usr.sbin/httpd/httpd.c b/usr.sbin/httpd/httpd.c
index 491c2d4d385..c7d8f9ff16c 100644
--- a/usr.sbin/httpd/httpd.c
+++ b/usr.sbin/httpd/httpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: httpd.c,v 1.28 2014/12/11 17:06:55 schwarze Exp $ */
+/* $OpenBSD: httpd.c,v 1.29 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -16,12 +16,14 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* nitems */
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/resource.h>
+#include <sys/signal.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -42,6 +44,8 @@
#include "httpd.h"
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
__dead void usage(void);
int parent_configure(struct httpd *);
@@ -678,7 +682,7 @@ socket_rlimit(int maxfd)
if (maxfd == -1)
rl.rlim_cur = rl.rlim_max;
else
- rl.rlim_cur = MAX(rl.rlim_max, (rlim_t)maxfd);
+ rl.rlim_cur = MAXIMUM(rl.rlim_max, (rlim_t)maxfd);
if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
fatal("socket_rlimit: failed to set resource limit");
}
diff --git a/usr.sbin/httpd/httpd.h b/usr.sbin/httpd/httpd.h
index 3a8c7cafd9a..a6f470658b7 100644
--- a/usr.sbin/httpd/httpd.h
+++ b/usr.sbin/httpd/httpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: httpd.h,v 1.67 2015/01/13 09:21:15 reyk Exp $ */
+/* $OpenBSD: httpd.h,v 1.68 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -23,7 +23,6 @@
#include <sys/tree.h>
-#include <sys/param.h> /* MAXHOSTNAMELEN */
#include <limits.h>
#include <imsg.h>
#include <tls.h>
@@ -361,11 +360,11 @@ TAILQ_HEAD(log_files, log_file) log_files;
struct server_config {
u_int32_t id;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
char location[NAME_MAX];
char index[NAME_MAX];
- char root[MAXPATHLEN];
- char socket[MAXPATHLEN];
+ char root[PATH_MAX];
+ char socket[PATH_MAX];
char accesslog[NAME_MAX];
char errorlog[NAME_MAX];
diff --git a/usr.sbin/httpd/logger.c b/usr.sbin/httpd/logger.c
index 672f3b820c1..ee215851f59 100644
--- a/usr.sbin/httpd/logger.c
+++ b/usr.sbin/httpd/logger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: logger.c,v 1.8 2014/12/21 00:54:49 guenther Exp $ */
+/* $OpenBSD: logger.c,v 1.9 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -16,6 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* nitems */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
@@ -152,7 +153,7 @@ logger_open_fd(struct imsg *imsg)
int
logger_open_priv(struct imsg *imsg)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
char name[NAME_MAX], *p;
u_int32_t id;
size_t len;
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index 5489738749b..f06927095a2 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.53 2015/01/13 09:21:15 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.54 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -119,7 +119,7 @@ typedef struct {
struct portrange port;
struct {
struct sockaddr_storage ss;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
} addr;
} v;
int lineno;
diff --git a/usr.sbin/httpd/server.c b/usr.sbin/httpd/server.c
index f4b6414c9fd..943e60af036 100644
--- a/usr.sbin/httpd/server.c
+++ b/usr.sbin/httpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.51 2015/01/13 09:21:15 reyk Exp $ */
+/* $OpenBSD: server.c,v 1.52 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -16,6 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* nitems */
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/time.h>
@@ -45,6 +46,8 @@
#include "httpd.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
int server_dispatch_parent(int, struct privsep_proc *,
struct imsg *);
int server_dispatch_logger(int, struct privsep_proc *,
@@ -569,7 +572,7 @@ server_tls_readcb(int fd, short event, void *arg)
}
if (bufev->wm_read.high != 0)
- howmuch = MIN(sizeof(rbuf), bufev->wm_read.high);
+ howmuch = MINIMUM(sizeof(rbuf), bufev->wm_read.high);
ret = tls_read(clt->clt_tls_ctx, rbuf, howmuch, &len);
if (ret == TLS_READ_AGAIN || ret == TLS_WRITE_AGAIN) {
@@ -1025,7 +1028,7 @@ server_sendlog(struct server_config *srv_conf, int cmd, const char *emsg, ...)
void
server_log(struct client *clt, const char *msg)
{
- char ibuf[MAXHOSTNAMELEN], obuf[MAXHOSTNAMELEN];
+ char ibuf[HOST_NAME_MAX+1], obuf[HOST_NAME_MAX+1];
struct server_config *srv_conf = clt->clt_srv_conf;
char *ptr = NULL;
int debug_cmd = -1;
diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c
index 012e2eaaea8..d4135aa3925 100644
--- a/usr.sbin/httpd/server_fcgi.c
+++ b/usr.sbin/httpd/server_fcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_fcgi.c,v 1.45 2015/01/13 08:54:01 reyk Exp $ */
+/* $OpenBSD: server_fcgi.c,v 1.46 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
@@ -97,7 +97,7 @@ server_fcgi(struct httpd *env, struct client *clt)
struct http_descriptor *desc = clt->clt_descreq;
struct fcgi_record_header *h;
struct fcgi_begin_request_body *begin;
- char hbuf[MAXHOSTNAMELEN];
+ char hbuf[HOST_NAME_MAX+1];
size_t scriptlen;
int pathlen;
int fd = -1, ret;
diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c
index e12644dd6f6..447a0ddd701 100644
--- a/usr.sbin/httpd/server_file.c
+++ b/usr.sbin/httpd/server_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_file.c,v 1.46 2015/01/13 09:21:15 reyk Exp $ */
+/* $OpenBSD: server_file.c,v 1.47 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -43,6 +43,9 @@
#include "httpd.h"
#include "http.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
int server_file_access(struct httpd *, struct client *, char *, size_t);
int server_file_request(struct httpd *, struct client *, char *,
struct stat *);
@@ -150,7 +153,7 @@ server_file(struct httpd *env, struct client *clt)
{
struct http_descriptor *desc = clt->clt_descreq;
struct server_config *srv_conf = clt->clt_srv_conf;
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
const char *stripped, *errstr = NULL;
int ret = 500;
@@ -221,7 +224,7 @@ server_file_request(struct httpd *env, struct client *clt, char *path,
media = media_find(env->sc_mediatypes, path);
ret = server_response_http(clt, 200, media, st->st_size,
- MIN(time(NULL), st->st_mtim.tv_sec));
+ MINIMUM(time(NULL), st->st_mtim.tv_sec));
switch (ret) {
case -1:
goto fail;
@@ -270,7 +273,7 @@ server_file_request(struct httpd *env, struct client *clt, char *path,
int
server_file_index(struct httpd *env, struct client *clt, struct stat *st)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
char tmstr[21];
struct http_descriptor *desc = clt->clt_descreq;
struct server_config *srv_conf = clt->clt_srv_conf;
@@ -299,7 +302,7 @@ server_file_index(struct httpd *env, struct client *clt, struct stat *st)
goto abort;
/* Save last modification time */
- dir_mtime = MIN(time(NULL), st->st_mtim.tv_sec);
+ dir_mtime = MINIMUM(time(NULL), st->st_mtim.tv_sec);
if ((evb = evbuffer_new()) == NULL)
goto abort;
@@ -349,13 +352,13 @@ server_file_index(struct httpd *env, struct client *clt, struct stat *st)
if (evbuffer_add_printf(evb,
"<a href=\"%s\">%s/</a>%*s%s%20s\n",
dp->d_name, dp->d_name,
- MAX(namewidth, 0), " ", tmstr, "-") == -1)
+ MAXIMUM(namewidth, 0), " ", tmstr, "-") == -1)
skip = 1;
} else if (S_ISREG(st->st_mode)) {
if (evbuffer_add_printf(evb,
"<a href=\"%s\">%s</a>%*s%s%20llu\n",
dp->d_name, dp->d_name,
- MAX(namewidth, 0), " ", tmstr, st->st_size) == -1)
+ MAXIMUM(namewidth, 0), " ", tmstr, st->st_size) == -1)
skip = 1;
}
free(dp);
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c
index 4e1d627e17f..c5dd4ab5650 100644
--- a/usr.sbin/httpd/server_http.c
+++ b/usr.sbin/httpd/server_http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_http.c,v 1.63 2015/01/13 09:21:15 reyk Exp $ */
+/* $OpenBSD: server_http.c,v 1.64 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <stdio.h>
#include <err.h>
#include <pwd.h>
@@ -571,7 +572,7 @@ server_http_time(time_t t, char *tmbuf, size_t len)
const char *
server_http_host(struct sockaddr_storage *ss, char *buf, size_t len)
{
- char hbuf[MAXHOSTNAMELEN];
+ char hbuf[HOST_NAME_MAX+1];
in_port_t port;
if (print_host(ss, buf, len) == NULL)
@@ -768,8 +769,8 @@ server_close_http(struct client *clt)
int
server_response(struct httpd *httpd, struct client *clt)
{
- char path[MAXPATHLEN];
- char hostname[MAXHOSTNAMELEN];
+ char path[PATH_MAX];
+ char hostname[HOST_NAME_MAX+1];
struct http_descriptor *desc = clt->clt_descreq;
struct http_descriptor *resp = clt->clt_descresp;
struct server *srv = clt->clt_srv;
diff --git a/usr.sbin/identd/identd.c b/usr.sbin/identd/identd.c
index 7dc119a5b40..cd11699bf9a 100644
--- a/usr.sbin/identd/identd.c
+++ b/usr.sbin/identd/identd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: identd.c,v 1.26 2014/07/13 17:53:41 claudio Exp $ */
+/* $OpenBSD: identd.c,v 1.27 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
@@ -38,6 +38,7 @@
#include <fcntl.h>
#include <pwd.h>
#include <stdio.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
@@ -436,7 +437,7 @@ parent_token(struct ident_resolver *r, struct passwd *pw)
void
parent_noident(struct ident_resolver *r, struct passwd *pw)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
struct stat st;
int rv;
diff --git a/usr.sbin/ikectl/ikeca.c b/usr.sbin/ikectl/ikeca.c
index dd18a208443..7e25f7fb609 100644
--- a/usr.sbin/ikectl/ikeca.c
+++ b/usr.sbin/ikectl/ikeca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikeca.c,v 1.29 2014/08/26 17:47:24 jsing Exp $ */
+/* $OpenBSD: ikeca.c,v 1.30 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2010 Jonathan Gray <jsg@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -29,6 +28,7 @@
#include <fcntl.h>
#include <fts.h>
#include <dirent.h>
+#include <limits.h>
#include <openssl/rand.h>
#include <openssl/rsa.h>
@@ -189,7 +189,7 @@ int
ca_sign(struct ca *ca, char *keyname, int type, char *envargs)
{
char cmd[PATH_MAX * 2];
- char hostname[MAXHOSTNAMELEN];
+ char hostname[HOST_NAME_MAX+1];
char name[128];
strlcpy(name, keyname, sizeof(name));
diff --git a/usr.sbin/ikectl/ikectl.c b/usr.sbin/ikectl/ikectl.c
index 1c5a04eef91..5e85ab8859c 100644
--- a/usr.sbin/ikectl/ikectl.c
+++ b/usr.sbin/ikectl/ikectl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikectl.c,v 1.18 2013/11/14 20:48:52 deraadt Exp $ */
+/* $OpenBSD: ikectl.c,v 1.19 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2007-2013 Reyk Floeter <reyk@openbsd.org>
@@ -19,7 +19,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
diff --git a/usr.sbin/ikectl/parser.c b/usr.sbin/ikectl/parser.c
index 4ee5bb26fa7..6c21436ac31 100644
--- a/usr.sbin/ikectl/parser.c
+++ b/usr.sbin/ikectl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.12 2013/01/08 10:38:19 reyk Exp $ */
+/* $OpenBSD: parser.c,v 1.13 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -18,7 +18,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index d74e11554a3..85661194cc7 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.142 2014/10/29 03:33:14 dlg Exp $ */
+/* $OpenBSD: inetd.c,v 1.143 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -121,7 +121,6 @@
*
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -145,6 +144,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <limits.h>
#include <string.h>
#include <login_cap.h>
#include <ifaddrs.h>
@@ -154,6 +154,8 @@
#include <event.h>
#include "pathnames.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#define TOOMANY 256 /* don't start more than TOOMANY */
#define CNT_INTVL 60 /* servers in CNT_INTVL sec. */
#define RETRYTIME (60*10) /* retry after bind or server fail */
@@ -1428,8 +1430,8 @@ bump_nofile(void)
syslog(LOG_ERR, "getrlimit: %m");
return -1;
}
- rl.rlim_cur = MIN(rl.rlim_max, rl.rlim_cur + FD_CHUNK);
- rl.rlim_cur = MIN(FD_SETSIZE, rl.rlim_cur + FD_CHUNK);
+ rl.rlim_cur = MINIMUM(rl.rlim_max, rl.rlim_cur + FD_CHUNK);
+ rl.rlim_cur = MINIMUM(FD_SETSIZE, rl.rlim_cur + FD_CHUNK);
if (rl.rlim_cur <= rlim_nofile_cur) {
syslog(LOG_ERR,
"bump_nofile: cannot extend file limit, max = %d",
diff --git a/usr.sbin/iscsictl/iscsictl.c b/usr.sbin/iscsictl/iscsictl.c
index 5e1aea8ea4c..cb981131fad 100644
--- a/usr.sbin/iscsictl/iscsictl.c
+++ b/usr.sbin/iscsictl/iscsictl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iscsictl.c,v 1.8 2014/04/21 20:20:37 claudio Exp $ */
+/* $OpenBSD: iscsictl.c,v 1.9 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
@@ -16,8 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/param.h> /* nitems */
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/uio.h>
diff --git a/usr.sbin/kgmon/kgmon.c b/usr.sbin/kgmon/kgmon.c
index 91505950cdf..87cbf116217 100644
--- a/usr.sbin/kgmon/kgmon.c
+++ b/usr.sbin/kgmon/kgmon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kgmon.c,v 1.20 2013/11/27 13:32:02 okan Exp $ */
+/* $OpenBSD: kgmon.c,v 1.21 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 1983, 1992, 1993
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/sysctl.h>
#include <sys/gmon.h>
diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c
index 6223ae6d2d1..2ab71c0a749 100644
--- a/usr.sbin/kvm_mkdb/kvm_mkdb.c
+++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_mkdb.c,v 1.19 2014/12/23 03:29:52 tedu Exp $ */
+/* $OpenBSD: kvm_mkdb.c,v 1.20 2015/01/16 06:40:17 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
@@ -67,7 +66,7 @@ main(int argc, char *argv[])
struct rlimit rl;
int fd, rval, ch, verbose = 0;
char *nlistpath, *nlistname;
- char dbdir[MAXPATHLEN];
+ char dbdir[PATH_MAX];
/* Increase our data size to the max if we can. */
if (getrlimit(RLIMIT_DATA, &rl) == 0) {
@@ -129,7 +128,7 @@ kvm_mkdb(int fd, const char *dbdir, char *nlistpath, char *nlistname,
int verbose)
{
DB *db;
- char dbtemp[MAXPATHLEN], dbname[MAXPATHLEN];
+ char dbtemp[PATH_MAX], dbname[PATH_MAX];
int r;
struct group *gr;
diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c
index 1de7eb7ce7c..841bab91902 100644
--- a/usr.sbin/kvm_mkdb/nlist.c
+++ b/usr.sbin/kvm_mkdb/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.45 2014/05/20 01:25:24 guenther Exp $ */
+/* $OpenBSD: nlist.c,v 1.46 2015/01/16 06:40:17 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <a.out.h>
#include <db.h>
diff --git a/usr.sbin/kvm_mkdb/testdb.c b/usr.sbin/kvm_mkdb/testdb.c
index c4c52ac5188..a804634e61c 100644
--- a/usr.sbin/kvm_mkdb/testdb.c
+++ b/usr.sbin/kvm_mkdb/testdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: testdb.c,v 1.8 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: testdb.c,v 1.9 2015/01/16 06:40:17 deraadt Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
#include <db.h>
diff --git a/usr.sbin/ldpd/kroute.c b/usr.sbin/ldpd/kroute.c
index e55a03f15fb..8ae9ad4fde9 100644
--- a/usr.sbin/ldpd/kroute.c
+++ b/usr.sbin/ldpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.33 2014/06/23 03:46:17 guenther Exp $ */
+/* $OpenBSD: kroute.c,v 1.34 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -18,7 +18,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -38,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "ldpd.h"
#include "log.h"
diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c
index 621ff71d7a6..847c782d99a 100644
--- a/usr.sbin/ldpd/ldpd.c
+++ b/usr.sbin/ldpd/ldpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.c,v 1.20 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ldpd.c,v 1.21 2015/01/16 06:40:17 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -24,7 +24,6 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c
index fd48614df1c..e2d4a063545 100644
--- a/usr.sbin/lpr/common_source/common.c
+++ b/usr.sbin/lpr/common_source/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.37 2014/11/02 13:56:55 deraadt Exp $ */
+/* $OpenBSD: common.c,v 1.38 2015/01/16 06:40:17 deraadt Exp $ */
/* $NetBSD: common.c,v 1.21 2000/08/09 14:28:50 itojun Exp $ */
/*
@@ -35,7 +35,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -48,6 +47,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.sbin/lpr/common_source/common_vars.c b/usr.sbin/lpr/common_source/common_vars.c
index a7cdb5fb494..372e7bae96b 100644
--- a/usr.sbin/lpr/common_source/common_vars.c
+++ b/usr.sbin/lpr/common_source/common_vars.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common_vars.c,v 1.4 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: common_vars.c,v 1.5 2015/01/16 06:40:17 deraadt Exp $ */
/* $NetBSD: common.c,v 1.15 1999/09/26 10:32:27 mrg Exp $ */
/*
@@ -35,13 +35,14 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <limits.h>
#include "pathnames.h"
char *name; /* program name */
char *printer; /* printer name */
-char host[MAXHOSTNAMELEN+1]; /* host machine name */
+char host[HOST_NAME_MAX+1 + 1]; /* host machine name */
char *from = host; /* client's machine name */
char *printcapdb[2] = { _PATH_PRINTCAP, 0 };
char *bp; /* pointer into printcap buffer. */
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index 5f3301e785b..0d401b7a7b5 100644
--- a/usr.sbin/lpr/common_source/displayq.c
+++ b/usr.sbin/lpr/common_source/displayq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: displayq.c,v 1.35 2014/05/21 18:38:42 pascal Exp $ */
+/* $OpenBSD: displayq.c,v 1.36 2015/01/16 06:40:17 deraadt Exp $ */
/* $NetBSD: displayq.c,v 1.21 2001/08/30 00:51:50 itojun Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@@ -39,6 +38,7 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
+#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h
index 1c3307daba0..d1c997fd2e9 100644
--- a/usr.sbin/lpr/common_source/lp.h
+++ b/usr.sbin/lpr/common_source/lp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lp.h,v 1.18 2013/12/10 16:38:04 naddy Exp $ */
+/* $OpenBSD: lp.h,v 1.19 2015/01/16 06:40:17 deraadt Exp $ */
/* $NetBSD: lp.h,v 1.14 2000/04/16 14:43:58 mrg Exp $ */
/*
@@ -78,7 +78,7 @@ extern char line[BUFSIZ];
extern char *bp; /* pointer into printcap buffer */
extern char *printer; /* printer name */
/* host machine name */
-extern char host[MAXHOSTNAMELEN];
+extern char host[HOST_NAME_MAX+1];
extern char *from; /* client's machine name */
extern int remote; /* true if sending files to a remote host */
extern char *printcapdb[]; /* printcap database array */
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index f481a7aabf0..e58822aa349 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmjob.c,v 1.21 2013/11/24 21:32:32 deraadt Exp $ */
+/* $OpenBSD: rmjob.c,v 1.22 2015/01/16 06:40:17 deraadt Exp $ */
/* $NetBSD: rmjob.c,v 1.16 2000/04/16 14:43:58 mrg Exp $ */
/*
@@ -30,13 +30,12 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <dirent.h>
#include <unistd.h>
+#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c
index 6274215387f..84988f3e3ed 100644
--- a/usr.sbin/lpr/common_source/startdaemon.c
+++ b/usr.sbin/lpr/common_source/startdaemon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: startdaemon.c,v 1.14 2014/07/20 01:38:40 guenther Exp $ */
+/* $OpenBSD: startdaemon.c,v 1.15 2015/01/16 06:40:17 deraadt Exp $ */
/* $NetBSD: startdaemon.c,v 1.10 1998/07/18 05:04:39 lukem Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -39,6 +38,7 @@
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
+#include <limits.h>
#include <string.h>
#include <signal.h>
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c
index bd73855b824..d27788c9429 100644
--- a/usr.sbin/lpr/lpc/cmds.c
+++ b/usr.sbin/lpr/lpc/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.26 2013/12/29 14:26:22 krw Exp $ */
+/* $OpenBSD: cmds.c,v 1.27 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: cmds.c,v 1.12 1997/10/05 15:12:06 mrg Exp $ */
/*
@@ -35,7 +35,6 @@
* lpc -- line printer control program -- commands:
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/file.h>
@@ -45,6 +44,7 @@
#include <errno.h>
#include <dirent.h>
#include <unistd.h>
+#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
@@ -189,7 +189,7 @@ static void
upstat(char *msg)
{
int fd;
- char statfile[MAXPATHLEN];
+ char statfile[PATH_MAX];
if (cgetstr(bp, "st", &ST) == -1)
ST = DEFSTAT;
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index 833a3369479..2661119f60d 100644
--- a/usr.sbin/lpr/lpc/lpc.c
+++ b/usr.sbin/lpr/lpc/lpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpc.c,v 1.18 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: lpc.c,v 1.19 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: lpc.c,v 1.11 2001/11/14 03:01:15 enami Exp $ */
/*
@@ -31,8 +31,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <dirent.h>
#include <signal.h>
#include <syslog.h>
@@ -41,6 +39,7 @@
#include <stdio.h>
#include <err.h>
#include <errno.h>
+#include <limits.h>
#include <ctype.h>
#include <string.h>
#include <grp.h>
@@ -278,7 +277,7 @@ static int
ingroup(char *grname)
{
static struct group *gptr = NULL;
- static gid_t groups[NGROUPS];
+ static gid_t groups[NGROUPS_MAX];
static int ngroups;
gid_t gid;
int i;
@@ -288,7 +287,7 @@ ingroup(char *grname)
warnx("Warning: unknown group `%s'", grname);
return(0);
}
- if ((ngroups = getgroups(NGROUPS, groups)) < 0)
+ if ((ngroups = getgroups(NGROUPS_MAX, groups)) < 0)
err(1, "getgroups");
}
gid = gptr->gr_gid;
diff --git a/usr.sbin/lpr/lpd/key.c b/usr.sbin/lpr/lpd/key.c
index be14b708fe7..a065494e44f 100644
--- a/usr.sbin/lpr/lpd/key.c
+++ b/usr.sbin/lpr/lpd/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.7 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: key.c,v 1.8 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: key.c,v 1.3 1997/10/20 08:08:28 scottr Exp $ */
/*-
@@ -30,15 +30,16 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <errno.h>
+#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <syslog.h>
#include <dirent.h>
+#include <limits.h>
#include <termios.h>
#include "lp.h"
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index f6721e6990d..38b37e96c3f 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpd.c,v 1.56 2014/10/17 06:11:27 deraadt Exp $ */
+/* $OpenBSD: lpd.c,v 1.57 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: lpd.c,v 1.33 2002/01/21 14:42:29 wiz Exp $ */
/*
@@ -63,7 +63,6 @@
* Users can't touch the spool w/o the help of one of the lp* programs.
*/
-#include <sys/param.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -86,6 +85,7 @@
#include <string.h>
#include <syslog.h>
#include <unistd.h>
+#include <limits.h>
#include "lp.h"
#include "lp.local.h"
diff --git a/usr.sbin/lpr/lpd/modes.c b/usr.sbin/lpr/lpd/modes.c
index b59fda51ad7..b62b18c0d0b 100644
--- a/usr.sbin/lpr/lpd/modes.c
+++ b/usr.sbin/lpr/lpd/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.7 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: modes.c,v 1.8 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: modes.c,v 1.3 1997/10/20 08:08:31 scottr Exp $ */
/*-
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <stddef.h>
#include <string.h>
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index 226f299b458..5445a50ad6b 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printjob.c,v 1.53 2014/12/16 03:35:49 millert Exp $ */
+/* $OpenBSD: printjob.c,v 1.54 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */
/*
@@ -38,7 +38,6 @@
* it does not need to be removed because file locks are dynamic.
*/
-#include <sys/param.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -54,6 +53,7 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
@@ -91,12 +91,12 @@ static char title[80]; /* ``pr'' title */
static int tof; /* true if at top of form */
static char class[32]; /* classification field */
-static char fromhost[MAXHOSTNAMELEN]; /* user's host machine */
+static char fromhost[HOST_NAME_MAX+1]; /* user's host machine */
/* indentation size in static characters */
static char indent[10] = "-i0";
static char jobname[NAME_MAX]; /* job or file name */
static char length[10] = "-l"; /* page length in lines */
-static char logname[MAXLOGNAME]; /* user's login name */
+static char logname[LOGIN_NAME_MAX];/* user's login name */
static char pxlength[10] = "-y"; /* page length in pixels */
static char pxwidth[10] = "-x"; /* page width in pixels */
static char tempfile[] = "errsXXXXXXXXXX"; /* file name for filter output */
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index 5ab57f223d2..787da15b308 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recvjob.c,v 1.25 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: recvjob.c,v 1.26 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: recvjob.c,v 1.14 2001/12/04 22:52:44 christos Exp $ */
/*
@@ -35,7 +35,7 @@
* Receive printer jobs from the network, queue them and
* start the printer daemon.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
#include <sys/stat.h>
@@ -49,6 +49,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#include <limits.h>
#include "lp.h"
#include "lp.local.h"
#include "extern.h"
diff --git a/usr.sbin/lpr/lpq/lpq.c b/usr.sbin/lpr/lpq/lpq.c
index 934ec081ef1..6947dfb7fe2 100644
--- a/usr.sbin/lpr/lpq/lpq.c
+++ b/usr.sbin/lpr/lpq/lpq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpq.c,v 1.20 2013/11/24 21:32:32 deraadt Exp $ */
+/* $OpenBSD: lpq.c,v 1.21 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: lpq.c,v 1.9 1999/12/07 14:54:47 mrg Exp $ */
/*
@@ -41,15 +41,16 @@
* -P used to identify printer as per lpr/lprm
*/
-#include <sys/param.h>
#include <ctype.h>
+#include <signal.h>
#include <dirent.h>
#include <err.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
+#include <limits.h>
#include <syslog.h>
#include "lp.h"
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index dc13643acd6..5027435df47 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpr.c,v 1.46 2014/05/20 01:25:24 guenther Exp $ */
+/* $OpenBSD: lpr.c,v 1.47 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: lpr.c,v 1.19 2000/10/11 20:23:52 is Exp $ */
/*
@@ -43,7 +43,6 @@
* using information from a printer data base.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/file.h>
@@ -55,6 +54,7 @@
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
+#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
@@ -109,7 +109,7 @@ main(int argc, char **argv)
struct passwd *pw;
struct group *gptr;
char *arg, *cp;
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
int i, f, ch;
struct stat stb;
@@ -439,7 +439,7 @@ static char *
linked(char *file)
{
char *cp;
- static char buf[MAXPATHLEN];
+ static char buf[PATH_MAX];
int ret;
if (*file != '/') {
diff --git a/usr.sbin/lpr/lprm/lprm.c b/usr.sbin/lpr/lprm/lprm.c
index d29af91e6f7..0fa579e936b 100644
--- a/usr.sbin/lpr/lprm/lprm.c
+++ b/usr.sbin/lpr/lprm/lprm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lprm.c,v 1.20 2014/01/22 19:31:00 tobias Exp $ */
+/* $OpenBSD: lprm.c,v 1.21 2015/01/16 06:40:18 deraadt Exp $ */
/* $$NetBSD: lprm.c,v 1.9 1999/08/16 03:12:32 simonb Exp $ */
/*
@@ -42,9 +42,9 @@
* entries, otherwise one can only remove their own.
*/
-#include <sys/param.h>
#include <ctype.h>
+#include <signal.h>
#include <dirent.h>
#include <err.h>
#include <errno.h>
@@ -54,6 +54,7 @@
#include <string.h>
#include <syslog.h>
#include <unistd.h>
+#include <limits.h>
#include "lp.h"
#include "lp.local.h"
@@ -67,7 +68,7 @@ int requests; /* # of spool requests */
char *user[MAXUSERS]; /* users to process */
int users; /* # of users in user array */
volatile sig_atomic_t gotintr; /* set when we receive SIGINT */
-static char luser[MAXLOGNAME]; /* buffer for person */
+static char luser[LOGIN_NAME_MAX]; /* buffer for person */
static __dead void usage(void);
diff --git a/usr.sbin/map-mbone/mapper.c b/usr.sbin/map-mbone/mapper.c
index e4fe726e699..dc71c059a14 100644
--- a/usr.sbin/map-mbone/mapper.c
+++ b/usr.sbin/map-mbone/mapper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mapper.c,v 1.21 2014/11/26 18:34:51 millert Exp $ */
+/* $OpenBSD: mapper.c,v 1.22 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: mapper.c,v 1.3 1995/12/10 11:12:04 mycroft Exp $ */
/* Mapper for connections between MRouteD multicast routers.
@@ -42,6 +42,7 @@
#include <arpa/inet.h>
#include <stdarg.h>
#include <poll.h>
+#include <limits.h>
#include <err.h>
#define DEFAULT_TIMEOUT 2 /* How long to wait before retrying requests */
@@ -689,7 +690,7 @@ void graph_edges(Node *node)
{
Interface *ifc;
Neighbor *nb;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
if (node) {
graph_edges(node->left);
@@ -872,9 +873,7 @@ int main(int argc, char *argv[])
memset(&addr, 0, sizeof addr);
addr.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof addr;
-#endif
addr.sin_addr.s_addr = dvmrp_group;
addr.sin_port = htons(2000); /* any port over 1024 will do... */
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c
index 72da4b033f6..55de2f0c8bc 100644
--- a/usr.sbin/mrinfo/mrinfo.c
+++ b/usr.sbin/mrinfo/mrinfo.c
@@ -81,6 +81,7 @@
#include <arpa/inet.h>
#include <stdarg.h>
#include <poll.h>
+#include <limits.h>
#include <err.h>
#define DEFAULT_TIMEOUT 4 /* How long to wait before retrying requests */
@@ -370,9 +371,7 @@ main(int argc, char *argv[])
addrlen = sizeof(addr);
memset(&addr, 0, sizeof addr);
addr.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof addr;
-#endif
addr.sin_addr.s_addr = target_addr;
addr.sin_port = htons(2000); /* any port over 1024 will
* do... */
diff --git a/usr.sbin/mrouted/defs.h b/usr.sbin/mrouted/defs.h
index 2fb2ea62f83..f4d3a6acc66 100644
--- a/usr.sbin/mrouted/defs.h
+++ b/usr.sbin/mrouted/defs.h
@@ -18,7 +18,6 @@
#include <syslog.h>
#include <signal.h>
#include <string.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
@@ -127,12 +126,6 @@ extern char s2[];
extern char s3[];
extern char s4[];
-#if !(defined(BSD) && (BSD >= 199103))
-extern int errno;
-extern int sys_nerr;
-extern char * sys_errlist[];
-#endif
-
#ifdef OLD_KERNEL
#define MRT_INIT DVMRP_INIT
#define MRT_DONE DVMRP_DONE
diff --git a/usr.sbin/mrouted/igmp.c b/usr.sbin/mrouted/igmp.c
index f32df762bb4..46a652e6c5f 100644
--- a/usr.sbin/mrouted/igmp.c
+++ b/usr.sbin/mrouted/igmp.c
@@ -328,9 +328,7 @@ send_igmp(u_int32_t src, u_int32_t dst, int type, int code,
bzero(&sdst, sizeof(sdst));
sdst.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
sdst.sin_len = sizeof(sdst);
-#endif
sdst.sin_addr.s_addr = dst;
if (sendto(igmp_socket, send_buf, ntohs(ip->ip_len), 0,
(struct sockaddr *)&sdst, sizeof(sdst)) < 0) {
diff --git a/usr.sbin/mrouted/pathnames.h b/usr.sbin/mrouted/pathnames.h
index 1bdcfdcd9fe..c1021c7b541 100644
--- a/usr.sbin/mrouted/pathnames.h
+++ b/usr.sbin/mrouted/pathnames.h
@@ -11,12 +11,6 @@
#define _PATH_MROUTED_CONF "/etc/mrouted.conf"
-#if (defined(BSD) && (BSD >= 199103))
#define _PATH_MROUTED_GENID "/var/run/mrouted.genid"
#define _PATH_MROUTED_DUMP "/var/tmp/mrouted.dump"
#define _PATH_MROUTED_CACHE "/var/tmp/mrouted.cache"
-#else
-#define _PATH_MROUTED_GENID "/etc/mrouted.genid"
-#define _PATH_MROUTED_DUMP "/usr/tmp/mrouted.dump"
-#define _PATH_MROUTED_CACHE "/usr/tmp/mrouted.cache"
-#endif
diff --git a/usr.sbin/mrouted/rsrr.c b/usr.sbin/mrouted/rsrr.c
index 317b1f1c673..252cdea2fea 100644
--- a/usr.sbin/mrouted/rsrr.c
+++ b/usr.sbin/mrouted/rsrr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsrr.c,v 1.12 2013/04/21 06:42:43 tedu Exp $ */
+/* $OpenBSD: rsrr.c,v 1.13 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: rsrr.c,v 1.3 1995/12/10 10:07:14 mycroft Exp $ */
/*
@@ -40,10 +40,7 @@
#ifdef RSRR
#include "defs.h"
-#include <sys/param.h>
-#if (defined(BSD) && (BSD >= 199103))
#include <stddef.h>
-#endif
/* Taken from prune.c */
/*
@@ -96,13 +93,9 @@ rsrr_init(void)
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sun_family = AF_UNIX;
strlcpy(serv_addr.sun_path, RSRR_SERV_PATH, sizeof serv_addr.sun_path);
-#if (defined(BSD) && (BSD >= 199103))
servlen = offsetof(struct sockaddr_un, sun_path) +
strlen(serv_addr.sun_path);
serv_addr.sun_len = servlen;
-#else
- servlen = sizeof(serv_addr.sun_family) + strlen(serv_addr.sun_path);
-#endif
if (bind(rsrr_socket, (struct sockaddr *) &serv_addr, servlen) < 0)
logit(LOG_ERR, errno, "Can't bind RSRR socket");
diff --git a/usr.sbin/mrouted/vif.c b/usr.sbin/mrouted/vif.c
index 7b7a540afc7..a427f427d56 100644
--- a/usr.sbin/mrouted/vif.c
+++ b/usr.sbin/mrouted/vif.c
@@ -699,9 +699,7 @@ accept_neighbor_request(u_int32_t src, u_int32_t dst)
memset(&addr, 0, sizeof addr);
addr.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof addr;
-#endif
addr.sin_addr.s_addr = dst;
addr.sin_port = htons(2000); /* any port over 1024 will do... */
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
@@ -786,9 +784,7 @@ accept_neighbor_request2(u_int32_t src, u_int32_t dst)
memset(&addr, 0, sizeof addr);
addr.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof addr;
-#endif
addr.sin_addr.s_addr = dst;
addr.sin_port = htons(2000); /* any port over 1024 will do... */
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c
index c881db9a167..556f20e9afb 100644
--- a/usr.sbin/mtrace/mtrace.c
+++ b/usr.sbin/mtrace/mtrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtrace.c,v 1.32 2013/11/24 00:54:12 deraadt Exp $ */
+/* $OpenBSD: mtrace.c,v 1.33 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: mtrace.c,v 1.5 1995/12/10 10:57:15 mycroft Exp $ */
/*
@@ -1277,9 +1277,7 @@ usage: mtrace [-lMnpsv] [-g gateway] [-i if_addr] [-m max_hops] [-q nqueries]\n\
*/
memset(&addr, 0, sizeof addr);
addr.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof(addr);
-#endif
addr.sin_addr.s_addr = qgrp;
addr.sin_port = htons(2000); /* Any port above 1024 will do */
@@ -1299,7 +1297,7 @@ usage: mtrace [-lMnpsv] [-g gateway] [-i if_addr] [-m max_hops] [-q nqueries]\n\
* mtrace -i [if_addr] will have to be used.
*/
if (addr.sin_addr.s_addr == 0) {
- char myhostname[MAXHOSTNAMELEN];
+ char myhostname[HOST_NAME_MAX+1];
struct hostent *hp;
int error;
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index 21c0fca9ba1..454a458d37a 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -1,5 +1,5 @@
/* $NetBSD: compare.c,v 1.11 1996/09/05 09:56:48 mycroft Exp $ */
-/* $OpenBSD: compare.c,v 1.23 2012/07/08 21:19:42 naddy Exp $ */
+/* $OpenBSD: compare.c,v 1.24 2015/01/16 06:40:18 deraadt Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <fts.h>
@@ -38,6 +37,7 @@
#include <stdio.h>
#include <time.h>
#include <unistd.h>
+#include <limits.h>
#include <md5.h>
#include <rmd160.h>
#include <sha1.h>
@@ -399,7 +399,7 @@ ftype(u_int type)
char *
rlink(char *name)
{
- static char lbuf[MAXPATHLEN];
+ static char lbuf[PATH_MAX];
int len;
if ((len = readlink(name, lbuf, sizeof(lbuf)-1)) == -1)
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c
index 777a9bff344..eac12974748 100644
--- a/usr.sbin/mtree/create.c
+++ b/usr.sbin/mtree/create.c
@@ -1,5 +1,5 @@
/* $NetBSD: create.c,v 1.11 1996/09/05 09:24:19 mycroft Exp $ */
-/* $OpenBSD: create.c,v 1.29 2013/08/22 04:43:41 guenther Exp $ */
+/* $OpenBSD: create.c,v 1.30 2015/01/16 06:40:18 deraadt Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <time.h>
#include <fcntl.h>
@@ -40,6 +39,7 @@
#include <pwd.h>
#include <errno.h>
#include <unistd.h>
+#include <limits.h>
#include <stdio.h>
#include <stdarg.h>
#include <vis.h>
@@ -57,7 +57,7 @@ extern u_int32_t crc_total;
extern int ftsoptions;
extern int dflag, iflag, nflag, sflag;
extern u_int keys;
-extern char fullpath[MAXPATHLEN];
+extern char fullpath[PATH_MAX];
static gid_t gid;
static uid_t uid;
@@ -74,7 +74,7 @@ cwalk(void)
FTS *t;
FTSENT *p;
time_t clock;
- char *argv[2], host[MAXHOSTNAMELEN];
+ char *argv[2], host[HOST_NAME_MAX+1];
int indent = 0;
(void)time(&clock);
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c
index 837b2fe1b97..f0b6987ff17 100644
--- a/usr.sbin/mtree/mtree.c
+++ b/usr.sbin/mtree/mtree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtree.c,v 1.21 2013/11/27 13:32:02 okan Exp $ */
+/* $OpenBSD: mtree.c,v 1.22 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: mtree.c,v 1.7 1996/09/05 23:29:22 thorpej Exp $ */
/*-
@@ -30,11 +30,11 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
+#include <limits.h>
#include <fts.h>
#include "mtree.h"
#include "extern.h"
@@ -45,7 +45,7 @@ int ftsoptions = FTS_PHYSICAL;
int cflag, dflag, eflag, iflag, lflag, nflag, qflag, rflag, sflag, tflag,
uflag, Uflag;
u_int keys;
-char fullpath[MAXPATHLEN];
+char fullpath[PATH_MAX];
static void usage(void);
diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c
index 763e5b9b53c..c82f799fc95 100644
--- a/usr.sbin/mtree/verify.c
+++ b/usr.sbin/mtree/verify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: verify.c,v 1.19 2009/10/27 23:59:53 deraadt Exp $ */
+/* $OpenBSD: verify.c,v 1.20 2015/01/16 06:40:18 deraadt Exp $ */
/* $NetBSD: verify.c,v 1.10 1995/03/07 21:26:28 cgd Exp $ */
/*-
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <dirent.h>
#include <fts.h>
@@ -38,16 +37,17 @@
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
+#include <limits.h>
#include "mtree.h"
#include "extern.h"
extern u_int32_t crc_total;
extern int ftsoptions;
extern int dflag, eflag, qflag, rflag, sflag, uflag;
-extern char fullpath[MAXPATHLEN];
+extern char fullpath[PATH_MAX];
static NODE *root;
-static char path[MAXPATHLEN];
+static char path[PATH_MAX];
static void miss(NODE *, char *, size_t);
static int vwalk(void);
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index 73a7b60678d..bd8b76f8505 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.58 2014/09/07 22:40:30 bluhm Exp $ */
+/* $OpenBSD: ndp.c,v 1.59 2015/01/16 06:40:18 deraadt Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -74,7 +74,6 @@
*/
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/usr.sbin/ospf6d/kroute.c b/usr.sbin/ospf6d/kroute.c
index 2931d68418a..b1efa74c578 100644
--- a/usr.sbin/ospf6d/kroute.c
+++ b/usr.sbin/ospf6d/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.44 2014/06/23 03:46:17 guenther Exp $ */
+/* $OpenBSD: kroute.c,v 1.45 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -36,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "ospf6d.h"
#include "ospfe.h"
diff --git a/usr.sbin/ospf6d/ospf6d.c b/usr.sbin/ospf6d/ospf6d.c
index 4478b527df6..1f18fc5270f 100644
--- a/usr.sbin/ospf6d/ospf6d.c
+++ b/usr.sbin/ospf6d/ospf6d.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospf6d.c,v 1.25 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ospf6d.c,v 1.26 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -24,7 +24,6 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <sys/param.h>
#include <sys/sysctl.h>
#include <netinet/in.h>
diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c
index b60d263e756..4e4154c1c20 100644
--- a/usr.sbin/ospf6d/rde.c
+++ b/usr.sbin/ospf6d/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.62 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: rde.c,v 1.63 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -18,7 +18,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h> /* for MIN() */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
@@ -40,6 +39,8 @@
#include "log.h"
#include "rde.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
void rde_sig_handler(int sig, short, void *);
void rde_shutdown(void);
void rde_dispatch_imsg(int, short, void *);
@@ -1315,7 +1316,7 @@ prefix_compare(struct prefix_node *a, struct prefix_node *b)
p = a->prefix;
q = b->prefix;
- len = MIN(LSA_PREFIXSIZE(p->prefixlen), LSA_PREFIXSIZE(q->prefixlen));
+ len = MINIMUM(LSA_PREFIXSIZE(p->prefixlen), LSA_PREFIXSIZE(q->prefixlen));
i = memcmp(p + 1, q + 1, len);
if (i)
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index c4c72a54f37..9f6841c7363 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.94 2014/06/23 03:46:17 guenther Exp $ */
+/* $OpenBSD: kroute.c,v 1.95 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -36,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "ospfd.h"
#include "log.h"
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index f24d947d94b..edce6fd599c 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.81 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ospfd.c,v 1.82 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -24,7 +24,6 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <sys/param.h>
#include <sys/sysctl.h>
#include <netinet/in.h>
diff --git a/usr.sbin/pcidump/pcidump.c b/usr.sbin/pcidump/pcidump.c
index 065d2cf9402..0ae2377c14b 100644
--- a/usr.sbin/pcidump/pcidump.c
+++ b/usr.sbin/pcidump/pcidump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcidump.c,v 1.36 2014/05/20 01:25:24 guenther Exp $ */
+/* $OpenBSD: pcidump.c,v 1.37 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 2006, 2007 David Gwynne <loki@animata.net>
@@ -16,8 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/types.h>
#include <sys/ioctl.h>
-#include <sys/param.h>
#include <sys/pciio.h>
#include <dev/pci/pcireg.h>
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#define PCIDEV "/dev/pci"
@@ -104,7 +105,7 @@ main(int argc, char *argv[])
{
int nfuncs;
int bus, dev, func;
- char pcidev[MAXPATHLEN] = PCIDEV;
+ char pcidev[PATH_MAX] = PCIDEV;
char *romfile = NULL;
const char *errstr;
int c, error = 0, dumpall = 1, domid = 0;
diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c
index 6837010f532..286bb49fbcf 100644
--- a/usr.sbin/pppd/auth.c
+++ b/usr.sbin/pppd/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.33 2014/11/13 06:19:51 schwarze Exp $ */
+/* $OpenBSD: auth.c,v 1.34 2015/01/16 06:40:19 deraadt Exp $ */
/*
* auth.c - PPP authentication and phase control.
@@ -77,6 +77,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
+#include <limits.h>
#include <syslog.h>
#include <pwd.h>
#include <string.h>
@@ -552,7 +553,7 @@ auth_check_options()
/* Default our_name to hostname, and user to our_name */
if (our_name[0] == 0 || usehostname)
- strlcpy(our_name, hostname, MAXHOSTNAMELEN);
+ strlcpy(our_name, hostname, HOST_NAME_MAX+1);
if (user[0] == 0)
strlcpy(user, our_name, MAXNAMELEN);
diff --git a/usr.sbin/pppd/demand.c b/usr.sbin/pppd/demand.c
index fda74ca5faa..5d09d0beb19 100644
--- a/usr.sbin/pppd/demand.c
+++ b/usr.sbin/pppd/demand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: demand.c,v 1.10 2011/04/30 18:49:38 nicm Exp $ */
+/* $OpenBSD: demand.c,v 1.11 2015/01/16 06:40:19 deraadt Exp $ */
/*
* demand.c - Support routines for demand-dialling.
@@ -35,14 +35,6 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include <netdb.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
@@ -54,6 +46,12 @@
#include <net/bpf.h>
#include <pcap.h>
#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <syslog.h>
#include "pppd.h"
#include "fsm.h"
diff --git a/usr.sbin/pppd/ipcp.c b/usr.sbin/pppd/ipcp.c
index 1577557ab77..245f73fc28c 100644
--- a/usr.sbin/pppd/ipcp.c
+++ b/usr.sbin/pppd/ipcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipcp.c,v 1.13 2010/05/10 02:00:50 krw Exp $ */
+/* $OpenBSD: ipcp.c,v 1.14 2015/01/16 06:40:19 deraadt Exp $ */
/*
* ipcp.c - PPP IP Control Protocol.
@@ -46,15 +46,14 @@
* TODO:
*/
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <netdb.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
#include "pppd.h"
#include "fsm.h"
diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c
index 7d74d74f92e..08ee24bb118 100644
--- a/usr.sbin/pppd/main.c
+++ b/usr.sbin/pppd/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.50 2014/10/08 04:51:29 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.51 2015/01/16 06:40:19 deraadt Exp $ */
/*
* main.c - Point-to-Point Protocol main module
@@ -42,11 +42,19 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <net/if.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
@@ -54,14 +62,6 @@
#include <netdb.h>
#include <utmp.h>
#include <pwd.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <net/if.h>
#include "pppd.h"
#include "magic.h"
@@ -91,9 +91,9 @@ char ifname[IFNAMSIZ]; /* Interface name */
int ifunit; /* Interface unit number */
char *progname; /* Name of this program */
-char hostname[MAXHOSTNAMELEN]; /* Our hostname */
-static char pidfilename[MAXPATHLEN]; /* name of pid file */
-static char default_devnam[MAXPATHLEN]; /* name of default device */
+char hostname[HOST_NAME_MAX+1]; /* Our hostname */
+static char pidfilename[PATH_MAX]; /* name of pid file */
+static char default_devnam[PATH_MAX]; /* name of default device */
static pid_t pid; /* Our pid */
static uid_t uid; /* Our real user-id */
static int conn_running; /* we have a [dis]connector running */
@@ -194,7 +194,7 @@ main(argc, argv)
phase = PHASE_INITIALIZE;
p = ttyname(0);
if (p)
- strlcpy(devnam, p, MAXPATHLEN);
+ strlcpy(devnam, p, PATH_MAX);
strlcpy(default_devnam, devnam, sizeof default_devnam);
script_env = NULL;
@@ -1217,11 +1217,9 @@ run_program(prog, args, must_exist)
dup2 (0, 2); /* stderr -> /dev/null */
}
-#ifdef BSD
/* Force the priority back to zero if pppd is running higher. */
if (setpriority (PRIO_PROCESS, 0, 0) < 0)
syslog (LOG_WARNING, "can't reset priority to 0: %m");
-#endif
/* SysV recommends a second fork at this point. */
diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c
index 99c29d8e10f..349d498e789 100644
--- a/usr.sbin/pppd/options.c
+++ b/usr.sbin/pppd/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.27 2014/12/10 03:39:54 jsg Exp $ */
+/* $OpenBSD: options.c,v 1.28 2015/01/16 06:40:19 deraadt Exp $ */
/*
* options.c - handles option processing for PPP.
@@ -97,7 +97,7 @@ int dflag = 0; /* Tell libpcap we want debugging */
int debug = 0; /* Debug flag */
int kdebugflag = 0; /* Tell kernel to print debug messages */
int default_device = 1; /* Using /dev/tty or equivalent */
-char devnam[MAXPATHLEN] = "/dev/tty"; /* Device name */
+char devnam[PATH_MAX] = "/dev/tty"; /* Device name */
int crtscts = 0; /* Use hardware flow control */
int modem = 1; /* Use modem control lines */
int modem_chat = 0; /* Use modem control lines during chat */
@@ -1567,7 +1567,7 @@ setdevname(cp, quiet)
int quiet;
{
struct stat statbuf;
- char dev[MAXPATHLEN];
+ char dev[PATH_MAX];
if (*cp == 0)
return 0;
@@ -1588,7 +1588,7 @@ setdevname(cp, quiet)
return -1;
}
- (void) strlcpy(devnam, cp, MAXPATHLEN);
+ (void) strlcpy(devnam, cp, PATH_MAX);
default_device = FALSE;
devnam_info.priv = privileged_option;
devnam_info.source = option_source;
diff --git a/usr.sbin/pppd/pppd.h b/usr.sbin/pppd/pppd.h
index 815b8bed73a..eaef54aa4db 100644
--- a/usr.sbin/pppd/pppd.h
+++ b/usr.sbin/pppd/pppd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppd.h,v 1.17 2011/04/30 18:49:38 nicm Exp $ */
+/* $OpenBSD: pppd.h,v 1.18 2015/01/16 06:40:19 deraadt Exp $ */
/*
* pppd.h - PPP daemon global declarations.
@@ -49,12 +49,11 @@
#ifndef __PPPD_H__
#define __PPPD_H__
-#include <stdio.h> /* for FILE */
-#include <stdarg.h>
-#include <sys/param.h> /* for MAXPATHLEN and BSD4_4, if defined */
#include <sys/types.h> /* for u_int32_t, if defined */
#include <sys/time.h> /* for struct timeval */
#include <net/ppp_defs.h>
+#include <stdio.h> /* for FILE */
+#include <stdarg.h>
/*
* Limits.
diff --git a/usr.sbin/pppd/pppstats/pppstats.c b/usr.sbin/pppd/pppstats/pppstats.c
index 0d0fde8840c..640ca0c82da 100644
--- a/usr.sbin/pppd/pppstats/pppstats.c
+++ b/usr.sbin/pppd/pppstats/pppstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppstats.c,v 1.10 2009/10/27 23:59:53 deraadt Exp $ */
+/* $OpenBSD: pppstats.c,v 1.11 2015/01/16 06:40:19 deraadt Exp $ */
/*
* print PPP statistics:
@@ -47,6 +47,12 @@
* SUCH DAMAGE.
*/
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/ppp_defs.h>
+#include <net/if.h>
+#include <net/if_ppp.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
@@ -57,13 +63,6 @@
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <net/ppp_defs.h>
-#include <net/if.h>
-#include <net/if_ppp.h>
int vflag, rflag, zflag; /* select type of display */
int aflag; /* print absolute values, not deltas */
diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c
index 15fc3118e39..b7e29e67ffd 100644
--- a/usr.sbin/procmap/procmap.c
+++ b/usr.sbin/procmap/procmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procmap.c,v 1.57 2014/11/16 12:31:01 deraadt Exp $ */
+/* $OpenBSD: procmap.c,v 1.58 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */
/*
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/param.h> /* MAXCOMLEN */
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/exec.h>
#include <sys/proc.h>
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index 6aa3f568a92..2db691b82bd 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pstat.c,v 1.96 2014/12/19 14:12:00 tedu Exp $ */
+/* $OpenBSD: pstat.c,v 1.97 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */
/*-
@@ -30,7 +30,8 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN DEV_BSIZE */
+#include <sys/types.h>
#include <sys/proc.h>
#include <sys/time.h>
#include <sys/vnode.h>
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index 02ff7493a86..3c128e9b582 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwd_mkdb.c,v 1.45 2014/08/25 07:50:26 doug Exp $ */
+/* $OpenBSD: pwd_mkdb.c,v 1.46 2015/01/16 06:40:19 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXBSIZE */
#include <sys/stat.h>
#include <db.h>
@@ -46,8 +46,11 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <util.h>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#define INSECURE 1
#define SECURE 2
#define PERM_INSECURE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
@@ -97,7 +100,7 @@ main(int argc, char **argv)
uid_t olduid;
gid_t shadow;
int ch, tfd, makeold, secureonly, flags, checkonly;
- char *username, buf[MAX(MAXPATHLEN, LINE_MAX * 2)];
+ char *username, buf[MAX(PATH_MAX, LINE_MAX * 2)];
flags = checkonly = makeold = secureonly = 0;
username = NULL;
@@ -108,7 +111,7 @@ main(int argc, char **argv)
break;
case 'd':
basedir = optarg;
- if (strlen(basedir) > MAXPATHLEN - 40)
+ if (strlen(basedir) > PATH_MAX - 40)
errx(1, "basedir too long");
break;
case 'p': /* create V7 "file.orig" */
@@ -178,7 +181,7 @@ main(int argc, char **argv)
/* Tweak openinfo values for large passwd files. */
if (st.st_size > (off_t)100*1024)
- openinfo.cachesize = MIN(st.st_size * 20, (off_t)12*1024*1024);
+ openinfo.cachesize = MINIMUM(st.st_size * 20, (off_t)12*1024*1024);
if (st.st_size / 128 > openinfo.nelem)
openinfo.nelem = st.st_size / 128;
@@ -399,7 +402,7 @@ cp(char *from, char *to, mode_t mode)
void
mv(char *from, char *to)
{
- char buf[MAXPATHLEN * 2];
+ char buf[PATH_MAX * 2];
if (rename(from, to)) {
int sverrno = errno;
@@ -439,7 +442,7 @@ errorx(char *name)
void
cleanup(void)
{
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
if (clean & FILE_ORIG) {
(void)snprintf(buf, sizeof(buf), "%s.orig", pname);
@@ -468,7 +471,7 @@ usage(void)
char *
changedir(char *path, char *dir)
{
- static char fixed[MAXPATHLEN];
+ static char fixed[PATH_MAX];
char *p;
if (!dir)
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
index 8935b1a1758..588b6334de2 100644
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quot.c,v 1.24 2013/11/12 22:27:12 deraadt Exp $ */
+/* $OpenBSD: quot.c,v 1.25 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (C) 1991, 1994 Wolfgang Solfrank.
@@ -31,7 +31,7 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXFRAG DEV_BSIZE MAXBSIZE */
#include <sys/mount.h>
#include <sys/time.h>
#include <ufs/ufs/dinode.h>
diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c
index c906cdf636d..d2e3acfba32 100644
--- a/usr.sbin/quotaon/quotaon.c
+++ b/usr.sbin/quotaon/quotaon.c
@@ -33,7 +33,6 @@
/*
* Turn quota on/off for a filesystem.
*/
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/mount.h>
#include <ufs/ufs/quota.h>
diff --git a/usr.sbin/rarpd/arptab.c b/usr.sbin/rarpd/arptab.c
index 87fd7686faf..c713805cf13 100644
--- a/usr.sbin/rarpd/arptab.c
+++ b/usr.sbin/rarpd/arptab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arptab.c,v 1.22 2013/11/12 19:49:42 deraadt Exp $ */
+/* $OpenBSD: arptab.c,v 1.23 2015/01/16 06:40:19 deraadt Exp $ */
/*
* Copyright (c) 1984, 1993
@@ -37,7 +37,6 @@
*/
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 98360e0b3c8..61e96b2ae9d 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rarpd.c,v 1.57 2014/12/16 03:35:49 millert Exp $ */
+/* $OpenBSD: rarpd.c,v 1.58 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */
/*
@@ -26,23 +26,24 @@
* rarpd - Reverse ARP Daemon
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/param.h>
-#include <unistd.h>
#include <sys/time.h>
-#include <net/bpf.h>
+#include <sys/file.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <sys/file.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <string.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <limits.h>
#include <errno.h>
#include <netdb.h>
#include <arpa/inet.h>
@@ -518,7 +519,7 @@ choose_ipaddr(u_int32_t **alist, u_int32_t net, u_int32_t netmask)
void
rarp_process(struct if_info *ii, u_char *pkt)
{
- char ename[MAXHOSTNAMELEN];
+ char ename[HOST_NAME_MAX+1];
u_int32_t target_ipaddr;
struct ether_header *ep;
struct ether_addr *ea;
diff --git a/usr.sbin/rbootd/bpf.c b/usr.sbin/rbootd/bpf.c
index 64a536e813b..f6c37be1bde 100644
--- a/usr.sbin/rbootd/bpf.c
+++ b/usr.sbin/rbootd/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.20 2014/11/02 02:44:50 deraadt Exp $ */
+/* $OpenBSD: bpf.c,v 1.21 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: bpf.c,v 1.5.2.1 1995/11/14 08:45:42 thorpej Exp $ */
/*
@@ -43,7 +43,6 @@
* Author: Jeff Forys, University of Utah CSS
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/usr.sbin/rbootd/conf.c b/usr.sbin/rbootd/conf.c
index 90e53369f33..8c7508645cb 100644
--- a/usr.sbin/rbootd/conf.c
+++ b/usr.sbin/rbootd/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.7 2009/10/27 23:59:54 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.8 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: conf.c,v 1.5 1995/10/06 05:12:13 thorpej Exp $ */
/*
@@ -43,10 +43,10 @@
* Author: Jeff Forys, University of Utah CSS
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <stdio.h>
+#include <limits.h>
#include "defs.h"
#include "pathnames.h"
@@ -60,7 +60,7 @@
** simplify the boot file search code.
*/
-char MyHost[MAXHOSTNAMELEN]; /* host name */
+char MyHost[HOST_NAME_MAX+1]; /* host name */
int DebugFlg = 0; /* set true if debugging */
int BootAny = 0; /* set true if we boot anyone */
diff --git a/usr.sbin/rbootd/defs.h b/usr.sbin/rbootd/defs.h
index feb03805231..eff3f0419a2 100644
--- a/usr.sbin/rbootd/defs.h
+++ b/usr.sbin/rbootd/defs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: defs.h,v 1.8 2013/04/20 20:17:17 miod Exp $ */
+/* $OpenBSD: defs.h,v 1.9 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: defs.h,v 1.5 1995/10/06 05:12:14 thorpej Exp $ */
/*
@@ -52,13 +52,6 @@
*/
/*
- * This may be defined in <sys/param.h>, if not, it's defined here.
- */
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif
-
-/*
* SIGUSR1 and SIGUSR2 are defined in <signal.h> for 4.3BSD systems.
*/
#ifndef SIGUSR1
diff --git a/usr.sbin/rbootd/parseconf.c b/usr.sbin/rbootd/parseconf.c
index f2d36b75afc..583f8ad32f4 100644
--- a/usr.sbin/rbootd/parseconf.c
+++ b/usr.sbin/rbootd/parseconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parseconf.c,v 1.11 2013/11/28 18:26:46 deraadt Exp $ */
+/* $OpenBSD: parseconf.c,v 1.12 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: parseconf.c,v 1.4 1995/10/06 05:12:16 thorpej Exp $ */
/*
@@ -43,7 +43,6 @@
* Author: Jeff Forys, University of Utah CSS
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <ctype.h>
diff --git a/usr.sbin/rbootd/rbootd.c b/usr.sbin/rbootd/rbootd.c
index d2e0bae497a..bfc09695442 100644
--- a/usr.sbin/rbootd/rbootd.c
+++ b/usr.sbin/rbootd/rbootd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rbootd.c,v 1.25 2014/05/17 21:37:51 chl Exp $ */
+/* $OpenBSD: rbootd.c,v 1.26 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: rbootd.c,v 1.5 1995/10/06 05:12:17 thorpej Exp $ */
/*
@@ -43,7 +43,6 @@
* Author: Jeff Forys, University of Utah CSS
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <ctype.h>
@@ -56,6 +55,7 @@
#include <string.h>
#include <syslog.h>
#include <unistd.h>
+#include <limits.h>
#include <util.h>
#include <pwd.h>
#include <poll.h>
@@ -158,7 +158,7 @@ main(int argc, char *argv[])
(void) signal(SIGINT, Exit);
(void) signal(SIGTERM, Exit);
- gethostname(MyHost, MAXHOSTNAMELEN);
+ gethostname(MyHost, HOST_NAME_MAX+1);
if (pidfile(NULL) < 0)
syslog(LOG_WARNING, "pidfile: failed");
diff --git a/usr.sbin/rbootd/rmpproto.c b/usr.sbin/rbootd/rmpproto.c
index 809cf83ac43..2831eaad74e 100644
--- a/usr.sbin/rbootd/rmpproto.c
+++ b/usr.sbin/rbootd/rmpproto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmpproto.c,v 1.10 2009/10/27 23:59:54 deraadt Exp $ */
+/* $OpenBSD: rmpproto.c,v 1.11 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: rmpproto.c,v 1.5.2.1 1995/11/14 08:45:44 thorpej Exp $ */
/*
@@ -43,7 +43,6 @@
* Author: Jeff Forys, University of Utah CSS
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <errno.h>
diff --git a/usr.sbin/rbootd/utils.c b/usr.sbin/rbootd/utils.c
index 3ad5792d51a..b89e6e4611d 100644
--- a/usr.sbin/rbootd/utils.c
+++ b/usr.sbin/rbootd/utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utils.c,v 1.12 2013/08/22 04:43:41 guenther Exp $ */
+/* $OpenBSD: utils.c,v 1.13 2015/01/16 06:40:19 deraadt Exp $ */
/* $NetBSD: utils.c,v 1.5.2.1 1995/11/14 08:45:46 thorpej Exp $ */
/*
@@ -43,8 +43,6 @@
* Author: Jeff Forys, University of Utah CSS
*/
-#include <sys/param.h>
-
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c
index e06f236dc8f..688436ac4de 100644
--- a/usr.sbin/rdate/ntp.c
+++ b/usr.sbin/rdate/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.32 2014/10/29 04:00:44 deraadt Exp $ */
+/* $OpenBSD: ntp.c,v 1.33 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved.
@@ -29,7 +29,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/rdate/rdate.c b/usr.sbin/rdate/rdate.c
index 1c503dc64bf..d14bb783a62 100644
--- a/usr.sbin/rdate/rdate.c
+++ b/usr.sbin/rdate/rdate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rdate.c,v 1.30 2013/11/12 22:27:13 deraadt Exp $ */
+/* $OpenBSD: rdate.c,v 1.31 2015/01/16 06:40:20 deraadt Exp $ */
/* $NetBSD: rdate.c,v 1.4 1996/03/16 12:37:45 pk Exp $ */
/*
@@ -38,7 +38,6 @@
* midnight January 1st 1900.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
diff --git a/usr.sbin/rdate/rfc868time.c b/usr.sbin/rdate/rfc868time.c
index 7f1b23bc283..be97fcd4785 100644
--- a/usr.sbin/rdate/rfc868time.c
+++ b/usr.sbin/rdate/rfc868time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfc868time.c,v 1.9 2013/11/12 22:27:13 deraadt Exp $ */
+/* $OpenBSD: rfc868time.c,v 1.10 2015/01/16 06:40:20 deraadt Exp $ */
/* $NetBSD: rdate.c,v 1.4 1996/03/16 12:37:45 pk Exp $ */
/*
@@ -39,7 +39,6 @@
* midnight January 1st 1900.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c
index 9c57db4da43..e42dc5ec671 100644
--- a/usr.sbin/relayctl/relayctl.c
+++ b/usr.sbin/relayctl/relayctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayctl.c,v 1.51 2014/07/09 16:42:05 reyk Exp $ */
+/* $OpenBSD: relayctl.c,v 1.52 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2013 Reyk Floeter <reyk@openbsd.org>
@@ -332,7 +332,7 @@ show_summary_msg(struct imsg *imsg, int type)
struct router *rt;
struct netroute *nr;
struct ctl_stats stats[RELAY_MAXPROC];
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
switch (imsg->hdr.type) {
case IMSG_CTL_RDR:
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c
index 57f2acda532..df68703913c 100644
--- a/usr.sbin/repquota/repquota.c
+++ b/usr.sbin/repquota/repquota.c
@@ -33,7 +33,7 @@
/*
* Quota report
*/
-#include <sys/param.h>
+#include <sys/param.h> /* dbtob */
#include <sys/stat.h>
#include <ufs/ufs/quota.h>
#include <fstab.h>
diff --git a/usr.sbin/ripd/kroute.c b/usr.sbin/ripd/kroute.c
index 619e885b21d..87579af8052 100644
--- a/usr.sbin/ripd/kroute.c
+++ b/usr.sbin/ripd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.25 2014/06/23 03:46:17 guenther Exp $ */
+/* $OpenBSD: kroute.c,v 1.26 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c
index 6915add3d1c..79f033b1f88 100644
--- a/usr.sbin/ripd/rde.c
+++ b/usr.sbin/ripd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.17 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: rde.c,v 1.18 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -19,7 +19,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h> /* for MIN() */
#include <sys/socket.h>
#include <sys/queue.h>
#include <netinet/in.h>
@@ -39,6 +38,8 @@
#include "log.h"
#include "rde.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
struct ripd_conf *rdeconf = NULL;
struct imsgev *iev_ripe;
struct imsgev *iev_main;
@@ -401,7 +402,7 @@ rde_check_route(struct rip_route *e)
if ((iface = if_find_index(e->ifindex)) == NULL)
return (-1);
- metric = MIN(INFINITY, e->metric + iface->cost);
+ metric = MINIMUM(INFINITY, e->metric + iface->cost);
if ((rn = rt_find(e->address.s_addr, e->mask.s_addr)) == NULL) {
if (metric >= INFINITY)
diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c
index 9ba92b91f81..f779aaf25eb 100644
--- a/usr.sbin/ripd/ripd.c
+++ b/usr.sbin/ripd/ripd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripd.c,v 1.23 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ripd.c,v 1.24 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -25,7 +25,6 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <sys/param.h>
#include <sys/sysctl.h>
#include <netinet/in.h>
diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c
index 7e457121f71..28d31dd1c33 100644
--- a/usr.sbin/rmt/rmt.c
+++ b/usr.sbin/rmt/rmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmt.c,v 1.14 2013/12/03 00:20:03 deraadt Exp $ */
+/* $OpenBSD: rmt.c,v 1.15 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -38,12 +38,12 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mtio.h>
-#include <sys/param.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <limits.h>
int tape = -1;
@@ -51,7 +51,7 @@ char *record;
int maxrecsize = -1;
#define STRSIZE 64
-char device[MAXPATHLEN];
+char device[PATH_MAX];
char count[STRSIZE], mode[STRSIZE], pos[STRSIZE], op[STRSIZE];
char resp[BUFSIZ];
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index 9b9f3ad8e0a..faecab21631 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route6d.c,v 1.63 2014/10/08 10:57:17 deraadt Exp $ */
+/* $OpenBSD: route6d.c,v 1.64 2015/01/16 06:40:20 deraadt Exp $ */
/* $KAME: route6d.c,v 1.111 2006/10/25 06:38:13 jinmei Exp $ */
/*
@@ -47,7 +47,6 @@
#include <poll.h>
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
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);
diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c
index a6aa05390bb..9bc448c1e68 100644
--- a/usr.sbin/rpc.statd/statd.c
+++ b/usr.sbin/rpc.statd/statd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: statd.c,v 1.1 2008/06/15 04:43:28 sturm Exp $ */
+/* $OpenBSD: statd.c,v 1.2 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -39,7 +39,6 @@
/* file was generated by running rpcgen /usr/include/rpcsvc/sm_inter.x */
/* The actual program logic is in the file procs.c */
-#include <sys/param.h>
#include <sys/wait.h>
#include <err.h>
@@ -241,7 +240,7 @@ change_host(char *hostnamep, HostInfo *hp)
{
DBT key, data;
char *ptr;
- char hostname[MAXHOSTNAMELEN + 1];
+ char hostname[HOST_NAME_MAX+1 + 1];
HostInfo h;
strlcpy(hostname, hostnamep, sizeof(hostname));
@@ -561,7 +560,7 @@ notify_one_host(char *hostname)
CLIENT *cli;
char dummy;
stat_chge arg;
- char our_hostname[MAXHOSTNAMELEN + 1];
+ char our_hostname[HOST_NAME_MAX+1 + 1];
gethostname(our_hostname, sizeof(our_hostname));
our_hostname[sizeof(our_hostname) - 1] = '\0';
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index 3f56f61ca3a..554f1af31a1 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.42 2014/07/04 22:39:31 guenther Exp $ */
+/* $OpenBSD: config.c,v 1.43 2015/01/16 06:40:20 deraadt Exp $ */
/* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c
index db8bbd861a1..d530c538229 100644
--- a/usr.sbin/rtadvd/if.c
+++ b/usr.sbin/rtadvd/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.26 2014/06/29 00:58:45 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.27 2015/01/16 06:40:20 deraadt Exp $ */
/* $KAME: if.c,v 1.17 2001/01/21 15:27:30 itojun Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/queue.h>
diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c
index 712ecef91aa..f42b4a827a3 100644
--- a/usr.sbin/rtadvd/rrenum.c
+++ b/usr.sbin/rtadvd/rrenum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rrenum.c,v 1.17 2014/06/29 00:58:45 deraadt Exp $ */
+/* $OpenBSD: rrenum.c,v 1.18 2015/01/16 06:40:20 deraadt Exp $ */
/* $KAME: rrenum.c,v 1.11 2002/05/21 14:26:55 itojun Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 7fa6180caad..f4075911262 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtadvd.c,v 1.52 2015/01/01 20:28:27 florian Exp $ */
+/* $OpenBSD: rtadvd.c,v 1.53 2015/01/16 06:40:20 deraadt Exp $ */
/* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */
/*
@@ -30,8 +30,9 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/signal.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <sys/queue.h>
diff --git a/usr.sbin/sa/extern.h b/usr.sbin/sa/extern.h
index 5d6584a1d69..722043c2f4d 100644
--- a/usr.sbin/sa/extern.h
+++ b/usr.sbin/sa/extern.h
@@ -27,11 +27,10 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: extern.h,v 1.3 2002/02/16 21:28:09 millert Exp $
+ * $Id: extern.h,v 1.4 2015/01/16 06:40:20 deraadt Exp $
*/
-#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
#include <db.h>
/* structures */
diff --git a/usr.sbin/sasyncd/monitor.c b/usr.sbin/sasyncd/monitor.c
index c4174d732bb..27c734ed7ef 100644
--- a/usr.sbin/sasyncd/monitor.c
+++ b/usr.sbin/sasyncd/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.18 2014/06/29 00:58:45 deraadt Exp $ */
+/* $OpenBSD: monitor.c,v 1.19 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -25,7 +25,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -43,6 +42,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <limits.h>
#include <imsg.h>
#include "types.h" /* iked imsg types */
@@ -70,7 +70,7 @@ monitor_init(void)
{
struct passwd *pw = getpwnam(SASYNCD_USER);
extern char *__progname;
- char root[MAXPATHLEN];
+ char root[PATH_MAX];
int p[2];
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, p) != 0) {
diff --git a/usr.sbin/sasyncd/pfkey.c b/usr.sbin/sasyncd/pfkey.c
index 8f8c9834418..a0ee2d80276 100644
--- a/usr.sbin/sasyncd/pfkey.c
+++ b/usr.sbin/sasyncd/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.22 2014/10/26 14:47:37 chl Exp $ */
+/* $OpenBSD: pfkey.c,v 1.23 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -30,7 +30,6 @@
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c
index 146cd313f89..5e1a61bfbc2 100644
--- a/usr.sbin/sensorsd/sensorsd.c
+++ b/usr.sbin/sensorsd/sensorsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensorsd.c,v 1.53 2014/06/29 00:58:45 deraadt Exp $ */
+/* $OpenBSD: sensorsd.c,v 1.54 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -18,7 +18,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/queue.h>
#include <sys/sensors.h>
@@ -32,6 +32,7 @@
#include <syslog.h>
#include <time.h>
#include <unistd.h>
+#include <limits.h>
#define RFBUFSIZ 28 /* buffer size for print_sensor */
#define RFBUFCNT 4 /* ring buffers */
diff --git a/usr.sbin/slowcgi/slowcgi.c b/usr.sbin/slowcgi/slowcgi.c
index fdf0cd9fac0..44595bb0e1a 100644
--- a/usr.sbin/slowcgi/slowcgi.c
+++ b/usr.sbin/slowcgi/slowcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slowcgi.c,v 1.41 2014/12/08 12:12:46 blambert Exp $ */
+/* $OpenBSD: slowcgi.c,v 1.42 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
* Copyright (c) 2013 Florian Obser <florian@openbsd.org>
@@ -30,6 +30,7 @@
#include <errno.h>
#include <event.h>
#include <netdb.h>
+#include <limits.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
@@ -118,7 +119,7 @@ struct request {
struct fcgi_response_head response_head;
struct fcgi_stdin_head stdin_head;
uint16_t id;
- char script_name[MAXPATHLEN];
+ char script_name[PATH_MAX];
struct env_head env;
int env_count;
pid_t script_pid;
@@ -745,11 +746,11 @@ parse_params(uint8_t *buf, uint16_t n, struct request *c, uint16_t id)
n -= name_len;
env_entry->val[name_len] = '\0';
- if (val_len < MAXPATHLEN && strcmp(env_entry->val,
+ if (val_len < PATH_MAX && strcmp(env_entry->val,
"SCRIPT_NAME") == 0 && c->script_name[0] == '\0') {
bcopy(buf, c->script_name, val_len);
c->script_name[val_len] = '\0';
- } else if (val_len < MAXPATHLEN && strcmp(env_entry->val,
+ } else if (val_len < PATH_MAX && strcmp(env_entry->val,
"SCRIPT_FILENAME") == 0) {
bcopy(buf, c->script_name, val_len);
c->script_name[val_len] = '\0';
diff --git a/usr.sbin/smtpd/ber.c b/usr.sbin/smtpd/ber.c
index 58c134c88ee..be19f726939 100644
--- a/usr.sbin/smtpd/ber.c
+++ b/usr.sbin/smtpd/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.4 2013/12/26 17:25:32 eric Exp $ */
+/* $OpenBSD: ber.c,v 1.5 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -19,7 +19,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <errno.h>
#include <limits.h>
@@ -32,6 +31,7 @@
#include "ber.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define BER_TYPE_CONSTRUCTED 0x20 /* otherwise primitive */
#define BER_TYPE_SINGLE_MAX 30
@@ -1164,7 +1164,7 @@ ber_readbuf(struct ber *b, void *buf, size_t nbytes)
return -1;
sz = b->br_rend - b->br_rptr;
- len = MIN(nbytes, sz);
+ len = MINIMUM(nbytes, sz);
if (len == 0) {
errno = ECANCELED;
return (-1); /* end of buffer and parser wants more data */
diff --git a/usr.sbin/smtpd/ca.c b/usr.sbin/smtpd/ca.c
index 11d691a688a..932cf8afee4 100644
--- a/usr.sbin/smtpd/ca.c
+++ b/usr.sbin/smtpd/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.12 2014/12/24 08:43:58 eric Exp $ */
+/* $OpenBSD: ca.c,v 1.13 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -23,6 +23,7 @@
#include <signal.h>
#include <string.h>
+#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include <imsg.h>
diff --git a/usr.sbin/smtpd/config.c b/usr.sbin/smtpd/config.c
index 6443e4506c6..cfb69093528 100644
--- a/usr.sbin/smtpd/config.c
+++ b/usr.sbin/smtpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.31 2014/05/01 15:50:20 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.32 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -26,6 +26,7 @@
#include <imsg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <string.h>
#include <unistd.h>
diff --git a/usr.sbin/smtpd/envelope.c b/usr.sbin/smtpd/envelope.c
index 9def08ed7f0..65dbef0d574 100644
--- a/usr.sbin/smtpd/envelope.c
+++ b/usr.sbin/smtpd/envelope.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: envelope.c,v 1.29 2014/04/19 12:30:54 gilles Exp $ */
+/* $OpenBSD: envelope.c,v 1.30 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -35,6 +35,7 @@
#include <inttypes.h>
#include <libgen.h>
#include <pwd.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index d6c4664a910..82627c22778 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.173 2014/09/03 07:42:47 giovanni Exp $ */
+/* $OpenBSD: lka.c,v 1.174 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -36,6 +36,7 @@
#include <openssl/ssl.h>
#include <pwd.h>
#include <resolv.h>
+#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c
index b3fdf3dcba5..f46260569da 100644
--- a/usr.sbin/smtpd/makemap.c
+++ b/usr.sbin/smtpd/makemap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: makemap.c,v 1.50 2014/10/25 18:48:30 gilles Exp $ */
+/* $OpenBSD: makemap.c,v 1.51 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <util.h>
#include "smtpd.h"
diff --git a/usr.sbin/smtpd/mproc.c b/usr.sbin/smtpd/mproc.c
index c36775a6539..07333c2af8f 100644
--- a/usr.sbin/smtpd/mproc.c
+++ b/usr.sbin/smtpd/mproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mproc.c,v 1.10 2014/07/08 13:49:09 eric Exp $ */
+/* $OpenBSD: mproc.c,v 1.11 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
@@ -32,6 +32,7 @@
#include <imsg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <string.h>
#include <unistd.h>
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index a0973cb888b..fd7e789222f 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.189 2014/07/08 13:02:42 eric Exp $ */
+/* $OpenBSD: mta.c,v 1.190 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -31,6 +31,7 @@
#include <imsg.h>
#include <inttypes.h>
#include <netdb.h>
+#include <limits.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c
index ce8793490ca..507aab18003 100644
--- a/usr.sbin/smtpd/mta_session.c
+++ b/usr.sbin/smtpd/mta_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta_session.c,v 1.69 2014/12/24 13:51:31 eric Exp $ */
+/* $OpenBSD: mta_session.c,v 1.70 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -35,6 +35,7 @@
#include <openssl/ssl.h>
#include <pwd.h>
#include <resolv.h>
+#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y
index c8ae7e6587b..5619d022fee 100644
--- a/usr.sbin/smtpd/parse.y
+++ b/usr.sbin/smtpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.149 2014/11/20 05:51:21 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.150 2015/01/16 06:40:20 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -41,6 +41,7 @@
#include <imsg.h>
#include <inttypes.h>
#include <netdb.h>
+#include <limits.h>
#include <paths.h>
#include <pwd.h>
#include <stdio.h>
@@ -772,7 +773,7 @@ main : BOUNCEWARN {
}
} filter_args;
| PKI STRING {
- char buf[MAXHOSTNAMELEN];
+ char buf[HOST_NAME_MAX+1];
xlowercase(buf, $2, sizeof(buf));
free($2);
pki = dict_get(conf->sc_pki_dict, buf);
diff --git a/usr.sbin/smtpd/queue_backend.c b/usr.sbin/smtpd/queue_backend.c
index 504e798391e..245e0d9fc03 100644
--- a/usr.sbin/smtpd/queue_backend.c
+++ b/usr.sbin/smtpd/queue_backend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_backend.c,v 1.53 2014/12/08 08:19:36 gilles Exp $ */
+/* $OpenBSD: queue_backend.c,v 1.54 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
@@ -28,6 +28,7 @@
#include <event.h>
#include <fcntl.h>
#include <imsg.h>
+#include <limits.h>
#include <inttypes.h>
#include <libgen.h>
#include <pwd.h>
@@ -179,7 +180,7 @@ queue_message_create(uint32_t *msgid)
int
queue_message_delete(uint32_t msgid)
{
- char msgpath[MAXPATHLEN];
+ char msgpath[PATH_MAX];
int r;
profile_enter("queue_message_delete");
@@ -200,8 +201,8 @@ int
queue_message_commit(uint32_t msgid)
{
int r;
- char msgpath[MAXPATHLEN];
- char tmppath[MAXPATHLEN];
+ char msgpath[PATH_MAX];
+ char tmppath[PATH_MAX];
FILE *ifp = NULL;
FILE *ofp = NULL;
diff --git a/usr.sbin/smtpd/queue_fs.c b/usr.sbin/smtpd/queue_fs.c
index 2541e00c085..25a7f17b404 100644
--- a/usr.sbin/smtpd/queue_fs.c
+++ b/usr.sbin/smtpd/queue_fs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_fs.c,v 1.6 2014/07/08 15:45:32 eric Exp $ */
+/* $OpenBSD: queue_fs.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
@@ -17,12 +17,11 @@
*/
#include <sys/types.h>
+#include <sys/mount.h>
#include <sys/queue.h>
#include <sys/tree.h>
#include <sys/socket.h>
#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/mount.h>
#include <ctype.h>
#include <err.h>
diff --git a/usr.sbin/smtpd/queue_proc.c b/usr.sbin/smtpd/queue_proc.c
index da321715e16..87de867831b 100644
--- a/usr.sbin/smtpd/queue_proc.c
+++ b/usr.sbin/smtpd/queue_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_proc.c,v 1.3 2014/07/08 15:45:32 eric Exp $ */
+/* $OpenBSD: queue_proc.c,v 1.4 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -19,7 +19,6 @@
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/tree.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
diff --git a/usr.sbin/smtpd/scheduler_proc.c b/usr.sbin/smtpd/scheduler_proc.c
index 5dcc8ddc5d8..4db950f2273 100644
--- a/usr.sbin/smtpd/scheduler_proc.c
+++ b/usr.sbin/smtpd/scheduler_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scheduler_proc.c,v 1.5 2014/07/10 14:45:02 eric Exp $ */
+/* $OpenBSD: scheduler_proc.c,v 1.6 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -19,7 +19,6 @@
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/tree.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <ctype.h>
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c
index 2ebd932941c..9f120eed517 100644
--- a/usr.sbin/smtpd/smtp.c
+++ b/usr.sbin/smtpd/smtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp.c,v 1.141 2014/11/05 19:38:09 gilles Exp $ */
+/* $OpenBSD: smtp.c,v 1.142 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -30,6 +30,7 @@
#include <netdb.h>
#include <pwd.h>
#include <signal.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 59a5f1b28fc..078a4d331e3 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.225 2015/01/14 08:50:32 gilles Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.226 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -31,6 +31,7 @@
#include <errno.h>
#include <event.h>
#include <imsg.h>
+#include <limits.h>
#include <inttypes.h>
#include <openssl/ssl.h>
#include <resolv.h>
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index 9ba5fdfa0a3..36b2c6bb300 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.236 2015/01/15 09:05:37 gilles Exp $ */
+/* $OpenBSD: smtpd.c,v 1.237 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -40,6 +40,7 @@
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/usr.sbin/smtpd/ssl_smtpd.c b/usr.sbin/smtpd/ssl_smtpd.c
index d7181bda243..49c379a4273 100644
--- a/usr.sbin/smtpd/ssl_smtpd.c
+++ b/usr.sbin/smtpd/ssl_smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_smtpd.c,v 1.7 2014/04/29 19:13:14 reyk Exp $ */
+/* $OpenBSD: ssl_smtpd.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -27,6 +27,7 @@
#include <ctype.h>
#include <event.h>
#include <fcntl.h>
+#include <limits.h>
#include <imsg.h>
#include <pwd.h>
#include <stdio.h>
diff --git a/usr.sbin/smtpd/table_passwd.c b/usr.sbin/smtpd/table_passwd.c
index b290054cd4c..0da86673c45 100644
--- a/usr.sbin/smtpd/table_passwd.c
+++ b/usr.sbin/smtpd/table_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_passwd.c,v 1.8 2014/09/29 08:41:55 gilles Exp $ */
+/* $OpenBSD: table_passwd.c,v 1.9 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2013 Gilles Chehade <gilles@poolp.org>
@@ -22,6 +22,7 @@
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <string.h>
#include <unistd.h>
diff --git a/usr.sbin/smtpd/table_proc.c b/usr.sbin/smtpd/table_proc.c
index c968ccedc29..ed4e5dd8786 100644
--- a/usr.sbin/smtpd/table_proc.c
+++ b/usr.sbin/smtpd/table_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_proc.c,v 1.3 2014/07/08 13:49:09 eric Exp $ */
+/* $OpenBSD: table_proc.c,v 1.4 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -19,7 +19,6 @@
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/tree.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <ctype.h>
diff --git a/usr.sbin/smtpd/table_sqlite.c b/usr.sbin/smtpd/table_sqlite.c
index 9ce3a2b0bf2..57e95939fe1 100644
--- a/usr.sbin/smtpd/table_sqlite.c
+++ b/usr.sbin/smtpd/table_sqlite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_sqlite.c,v 1.14 2014/07/08 13:49:09 eric Exp $ */
+/* $OpenBSD: table_sqlite.c,v 1.15 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -22,6 +22,7 @@
#include <fcntl.h>
#include <sqlite3.h>
#include <stdio.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/usr.sbin/smtpd/to.c b/usr.sbin/smtpd/to.c
index 51a3cabab7a..2ac22b523a5 100644
--- a/usr.sbin/smtpd/to.c
+++ b/usr.sbin/smtpd/to.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: to.c,v 1.17 2014/04/19 14:27:29 gilles Exp $ */
+/* $OpenBSD: to.c,v 1.18 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net>
@@ -35,6 +35,7 @@
#include <fcntl.h>
#include <fts.h>
#include <imsg.h>
+#include <limits.h>
#include <inttypes.h>
#include <libgen.h>
#include <netdb.h>
diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c
index a6c619891c6..9f8c86c97e8 100644
--- a/usr.sbin/smtpd/util.c
+++ b/usr.sbin/smtpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.110 2014/05/25 10:55:36 espie Exp $ */
+/* $OpenBSD: util.c,v 1.111 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2000,2001 Markus Friedl. All rights reserved.
@@ -39,6 +39,7 @@
#include <libgen.h>
#include <netdb.h>
#include <pwd.h>
+#include <limits.h>
#include <resolv.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/usr.sbin/snmpctl/snmpclient.c b/usr.sbin/snmpctl/snmpclient.c
index 6254e24260c..b62128fa99f 100644
--- a/usr.sbin/snmpctl/snmpclient.c
+++ b/usr.sbin/snmpctl/snmpclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpclient.c,v 1.12 2014/11/18 20:54:29 krw Exp $ */
+/* $OpenBSD: snmpclient.c,v 1.13 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
@@ -17,7 +17,6 @@
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
diff --git a/usr.sbin/syslogd/privsep.c b/usr.sbin/syslogd/privsep.c
index b69d687c087..9e527943a41 100644
--- a/usr.sbin/syslogd/privsep.c
+++ b/usr.sbin/syslogd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.49 2014/12/31 13:55:57 bluhm Exp $ */
+/* $OpenBSD: privsep.c,v 1.50 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2003 Anil Madhavapeddy <anil@recoil.org>
@@ -15,8 +15,8 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
#include <sys/ioctl.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/uio.h>
#include <sys/types.h>
@@ -37,6 +37,7 @@
#include <unistd.h>
#include <util.h>
#include <utmp.h>
+#include <limits.h>
#include "syslogd.h"
/*
@@ -74,14 +75,14 @@ enum cmd_types {
static int priv_fd = -1;
static volatile pid_t child_pid = -1;
-static char config_file[MAXPATHLEN];
+static char config_file[PATH_MAX];
static struct stat cf_info;
static int allow_getnameinfo = 0;
static volatile sig_atomic_t cur_state = STATE_INIT;
/* Queue for the allowed logfiles */
struct logname {
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
TAILQ_ENTRY(logname) next;
};
static TAILQ_HEAD(, logname) lognames;
@@ -102,7 +103,7 @@ priv_init(char *conf, int numeric, int lockfd, int nullfd, char *argv[])
{
int i, fd, socks[2], cmd, addr_len, result, restart;
size_t path_len, protoname_len, hostname_len, servname_len;
- char path[MAXPATHLEN], protoname[5], hostname[MAXHOSTNAMELEN];
+ char path[PATH_MAX], protoname[5], hostname[HOST_NAME_MAX+1];
char servname[NI_MAXSERV];
struct sockaddr_storage addr;
struct stat cf_stat;
@@ -527,7 +528,7 @@ check_log_name(char *lognam, size_t logsize)
lg = malloc(sizeof(struct logname));
if (!lg)
err(1, "check_log_name() malloc");
- strlcpy(lg->path, lognam, MAXPATHLEN);
+ strlcpy(lg->path, lognam, PATH_MAX);
TAILQ_INSERT_TAIL(&lognames, lg, next);
break;
case STATE_RUNNING:
@@ -564,7 +565,7 @@ increase_state(int state)
int
priv_open_tty(const char *tty)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
int cmd, fd;
size_t path_len;
@@ -587,7 +588,7 @@ priv_open_tty(const char *tty)
int
priv_open_log(const char *lognam)
{
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
int cmd, fd;
size_t path_len;
@@ -698,7 +699,7 @@ int
priv_getaddrinfo(char *proto, char *host, char *serv, struct sockaddr *addr,
size_t addr_len)
{
- char protocpy[5], hostcpy[MAXHOSTNAMELEN], servcpy[NI_MAXSERV];
+ char protocpy[5], hostcpy[HOST_NAME_MAX+1], servcpy[NI_MAXSERV];
int cmd, ret_len;
size_t protoname_len, hostname_len, servname_len;
diff --git a/usr.sbin/syslogd/privsep_fdpass.c b/usr.sbin/syslogd/privsep_fdpass.c
index 6984929fa9e..4ae2ee272fd 100644
--- a/usr.sbin/syslogd/privsep_fdpass.c
+++ b/usr.sbin/syslogd/privsep_fdpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep_fdpass.c,v 1.8 2012/04/04 17:24:50 deraadt Exp $ */
+/* $OpenBSD: privsep_fdpass.c,v 1.9 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -31,7 +31,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+
#include <sys/uio.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/syslogd/ringbuf.c b/usr.sbin/syslogd/ringbuf.c
index 80f06fe603d..1af7d7d6fa0 100644
--- a/usr.sbin/syslogd/ringbuf.c
+++ b/usr.sbin/syslogd/ringbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ringbuf.c,v 1.7 2005/09/21 23:25:32 djm Exp $ */
+/* $OpenBSD: ringbuf.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2004 Damien Miller
@@ -21,13 +21,14 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "syslogd.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
/* Initialise a ring buffer */
struct ringbuf *
ringbuf_init(size_t len)
@@ -141,7 +142,7 @@ ringbuf_to_string(char *buf, size_t len, struct ringbuf *rb)
if (buf == NULL || rb == NULL || len == 0)
return (-1);
- copy_len = MIN(len - 1, ringbuf_used(rb));
+ copy_len = MINIMUM(len - 1, ringbuf_used(rb));
if (copy_len == 0)
return (copy_len);
@@ -151,9 +152,9 @@ ringbuf_to_string(char *buf, size_t len, struct ringbuf *rb)
else {
/* If the buffer is wrapped, copy each hunk separately */
n = rb->len - rb->start;
- memcpy(buf, rb->buf + rb->start, MIN(n, copy_len));
+ memcpy(buf, rb->buf + rb->start, MINIMUM(n, copy_len));
if (copy_len > n)
- memcpy(buf + n, rb->buf, MIN(rb->end, copy_len - n));
+ memcpy(buf + n, rb->buf, MINIMUM(rb->end, copy_len - n));
}
buf[copy_len] = '\0';
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index d70fd9f6a2a..c94936e342d 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.141 2015/01/15 11:49:59 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.142 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -64,7 +64,6 @@
#define TIMERINTVL 30 /* interval for checking flush, mark */
#define TTYMSGTIME 1 /* timeout passed to ttymsg */
-#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -93,9 +92,12 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <utmp.h>
#include <vis.h>
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
#define SYSLOG_NAMES
#include <sys/syslog.h>
@@ -131,13 +133,13 @@ struct filed {
union {
char f_uname[MAXUNAMES][UT_NAMESIZE+1];
struct {
- char f_loghost[1+4+3+1+MAXHOSTNAMELEN+1+NI_MAXSERV];
+ char f_loghost[1+4+3+1+HOST_NAME_MAX+1+1+NI_MAXSERV];
/* @proto46://[hostname]:servname\0 */
struct sockaddr_storage f_addr;
struct bufferevent *f_bufev;
int f_reconnectwait;
} f_forw; /* forwarding address */
- char f_fname[MAXPATHLEN];
+ char f_fname[PATH_MAX];
struct {
char f_mname[MAX_MEMBUF_NAME];
struct ringbuf *f_rb;
@@ -148,7 +150,7 @@ struct filed {
} f_un;
char f_prevline[MAXSVLINE]; /* last message logged */
char f_lasttime[16]; /* time of last occurrence */
- char f_prevhost[MAXHOSTNAMELEN]; /* host from which recd. */
+ char f_prevhost[HOST_NAME_MAX+1]; /* host from which recd. */
int f_prevpri; /* pri of f_prevline */
int f_prevlen; /* length of f_prevline */
int f_prevcount; /* repetition cnt of prevline */
@@ -194,7 +196,7 @@ int nunix = 1; /* Number of Unix domain sockets requested */
char *path_unix[MAXUNIX] = { _PATH_LOG }; /* Paths to Unix domain sockets */
int Debug; /* debug flag */
int Startup = 1; /* startup flag */
-char LocalHostName[MAXHOSTNAMELEN]; /* our hostname */
+char LocalHostName[HOST_NAME_MAX+1]; /* our hostname */
char *LocalDomain; /* our local domain name */
int Initialized = 0; /* set when we have initialized ourselves */
@@ -645,7 +647,7 @@ udp_readcb(int fd, short event, void *arg)
salen = sizeof(sa);
n = recvfrom(fd, linebuf, MAXLINE, 0, (struct sockaddr *)&sa, &salen);
if (n > 0) {
- char resolve[MAXHOSTNAMELEN];
+ char resolve[HOST_NAME_MAX+1];
linebuf[n] = '\0';
cvthname((struct sockaddr *)&sa, resolve, sizeof(resolve));
@@ -1740,7 +1742,7 @@ cfline(char *line, char *prog)
logerror(ebuf);
break;
}
- if (strlen(host) >= MAXHOSTNAMELEN) {
+ if (strlen(host) >= HOST_NAME_MAX+1) {
snprintf(ebuf, sizeof(ebuf), "host too long \"%s\"",
f->f_un.f_forw.f_loghost);
logerror(ebuf);
@@ -1864,7 +1866,7 @@ cfline(char *line, char *prog)
}
/* Set buffer length */
- rb_len = MAX(rb_len, MIN_MEMBUF);
+ rb_len = MAXIMUM(rb_len, MIN_MEMBUF);
f->f_un.f_mb.f_len = rb_len;
f->f_un.f_mb.f_overflow = 0;
f->f_un.f_mb.f_attached = 0;
diff --git a/usr.sbin/syslogd/ttymsg.c b/usr.sbin/syslogd/ttymsg.c
index 25313f3e08a..a611218cedd 100644
--- a/usr.sbin/syslogd/ttymsg.c
+++ b/usr.sbin/syslogd/ttymsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttymsg.c,v 1.5 2014/08/25 18:05:30 bluhm Exp $ */
+/* $OpenBSD: ttymsg.c,v 1.6 2015/01/16 06:40:21 deraadt Exp $ */
/* $NetBSD: ttymsg.c,v 1.3 1994/11/17 07:17:55 jtc Exp $ */
/*
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* nitems */
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h>
diff --git a/usr.sbin/tcpdrop/tcpdrop.c b/usr.sbin/tcpdrop/tcpdrop.c
index 0520ea34d62..4f41dd9a61b 100644
--- a/usr.sbin/tcpdrop/tcpdrop.c
+++ b/usr.sbin/tcpdrop/tcpdrop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdrop.c,v 1.16 2015/01/13 03:43:18 lteo Exp $ */
+/* $OpenBSD: tcpdrop.c,v 1.17 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/queue.h>
diff --git a/usr.sbin/tcpdump/addrtoname.c b/usr.sbin/tcpdump/addrtoname.c
index 72f44e640d3..fb87a9fc9f3 100644
--- a/usr.sbin/tcpdump/addrtoname.c
+++ b/usr.sbin/tcpdump/addrtoname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: addrtoname.c,v 1.32 2014/10/08 04:58:50 deraadt Exp $ */
+/* $OpenBSD: addrtoname.c,v 1.33 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -24,7 +24,6 @@
* and address to string conversion routines
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -55,6 +54,7 @@ struct rtentry;
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <limits.h>
#include "interface.h"
#include "addrtoname.h"
@@ -159,7 +159,7 @@ static u_int32_t netmask;
char *
getname(const u_char *ap)
{
- char host[MAXHOSTNAMELEN];
+ char host[HOST_NAME_MAX+1];
u_int32_t addr;
struct hnamemem *p;
@@ -245,7 +245,7 @@ getname(const u_char *ap)
char *
getname6(const u_char *ap)
{
- char host[MAXHOSTNAMELEN];
+ char host[HOST_NAME_MAX+1];
struct in6_addr addr;
struct h6namemem *p;
register char *cp;
@@ -460,7 +460,7 @@ etheraddr_string(register const u_char *ep)
return (tp->e_name);
#ifdef HAVE_ETHER_NTOHOST
if (!nflag) {
- char buf[MAXHOSTNAMELEN + 1];
+ char buf[HOST_NAME_MAX+1 + 1];
if (priv_ether_ntohost(buf, sizeof(buf),
(struct ether_addr *)ep) > 0) {
tp->e_name = savestr(buf);
@@ -770,7 +770,7 @@ init_etherarray(void)
register struct etherlist *el;
register struct enamemem *tp;
#ifdef HAVE_ETHER_NTOHOST
- char name[MAXHOSTNAMELEN + 1];
+ char name[HOST_NAME_MAX+1 + 1];
#else
register struct pcap_etherent *ep;
register FILE *fp;
diff --git a/usr.sbin/tcpdump/print-802_11.c b/usr.sbin/tcpdump/print-802_11.c
index e7a73af1b91..5f81f45ebca 100644
--- a/usr.sbin/tcpdump/print-802_11.c
+++ b/usr.sbin/tcpdump/print-802_11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-802_11.c,v 1.15 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-802_11.c,v 1.16 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2005 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-arp.c b/usr.sbin/tcpdump/print-arp.c
index 1f1c5123dce..4d4b97ffeea 100644
--- a/usr.sbin/tcpdump/print-arp.c
+++ b/usr.sbin/tcpdump/print-arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-arp.c,v 1.12 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-arp.c,v 1.13 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-atalk.c b/usr.sbin/tcpdump/print-atalk.c
index d8639b57ba4..513267660be 100644
--- a/usr.sbin/tcpdump/print-atalk.c
+++ b/usr.sbin/tcpdump/print-atalk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-atalk.c,v 1.27 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-atalk.c,v 1.28 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -23,7 +23,6 @@
* Format and print AppleTalk packets.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
@@ -43,6 +42,7 @@ struct rtentry;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "interface.h"
#include "addrtoname.h"
@@ -556,7 +556,7 @@ static void
init_atalk(void)
{
struct hnamemem *tp;
- char nambuf[MAXHOSTNAMELEN + 20];
+ char nambuf[HOST_NAME_MAX+1 + 20];
char line[BUFSIZ];
int i1, i2, i3;
@@ -587,7 +587,7 @@ ataddr_string(u_short atnet, u_char athost)
{
register struct hnamemem *tp, *tp2;
register int i = (atnet << 8) | athost;
- char nambuf[MAXHOSTNAMELEN + 20];
+ char nambuf[HOST_NAME_MAX+1 + 20];
static int first = 1;
if (first) {
diff --git a/usr.sbin/tcpdump/print-atm.c b/usr.sbin/tcpdump/print-atm.c
index 469cf7a2692..f9b1fdb94e8 100644
--- a/usr.sbin/tcpdump/print-atm.c
+++ b/usr.sbin/tcpdump/print-atm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-atm.c,v 1.11 2014/11/20 04:11:33 jsg Exp $ */
+/* $OpenBSD: print-atm.c,v 1.12 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-bgp.c b/usr.sbin/tcpdump/print-bgp.c
index 61b86c8ebc0..6d8ffa9ea6c 100644
--- a/usr.sbin/tcpdump/print-bgp.c
+++ b/usr.sbin/tcpdump/print-bgp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-bgp.c,v 1.16 2014/01/12 11:26:48 deraadt Exp $ */
+/* $OpenBSD: print-bgp.c,v 1.17 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -40,6 +39,7 @@
#include <stdio.h>
#include <string.h>
#include <netdb.h>
+#include <limits.h>
#include "interface.h"
#include "addrtoname.h"
@@ -409,7 +409,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len)
int advance;
int tlen, asn_bytes;
const u_char *p;
- char buf[MAXHOSTNAMELEN + 100];
+ char buf[HOST_NAME_MAX+1 + 100];
p = dat;
tlen = len;
@@ -868,7 +868,7 @@ bgp_update_print(const u_char *dat, int length)
#ifdef INET6
printf(" (Withdrawn routes: %d bytes)", len);
#else
- char buf[MAXHOSTNAMELEN + 100];
+ char buf[HOST_NAME_MAX+1 + 100];
int wpfx;
TCHECK2(p[2], len);
@@ -949,7 +949,7 @@ bgp_update_print(const u_char *dat, int length)
if (dat + length > p) {
printf("(NLRI:"); /* ) */
while (dat + length > p) {
- char buf[MAXHOSTNAMELEN + 100];
+ char buf[HOST_NAME_MAX+1 + 100];
i = decode_prefix4(p, buf, sizeof(buf));
if (i == -1) {
printf(" (illegal prefix length)");
diff --git a/usr.sbin/tcpdump/print-bootp.c b/usr.sbin/tcpdump/print-bootp.c
index f7fdfd73ddc..a130b0e3b79 100644
--- a/usr.sbin/tcpdump/print-bootp.c
+++ b/usr.sbin/tcpdump/print-bootp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-bootp.c,v 1.18 2013/10/27 18:49:25 guenther Exp $ */
+/* $OpenBSD: print-bootp.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -22,7 +22,6 @@
*
* Format and print bootp packets.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-cdp.c b/usr.sbin/tcpdump/print-cdp.c
index bfb20b0db6c..9af884697b0 100644
--- a/usr.sbin/tcpdump/print-cdp.c
+++ b/usr.sbin/tcpdump/print-cdp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-cdp.c,v 1.4 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-cdp.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -26,7 +26,6 @@
* http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/tcpdump/print-decnet.c b/usr.sbin/tcpdump/print-decnet.c
index 8615abff887..6e47c8d7508 100644
--- a/usr.sbin/tcpdump/print-decnet.c
+++ b/usr.sbin/tcpdump/print-decnet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-decnet.c,v 1.12 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-decnet.c,v 1.13 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-dhcp6.c b/usr.sbin/tcpdump/print-dhcp6.c
index 3546b6c9ac5..fd111244c17 100644
--- a/usr.sbin/tcpdump/print-dhcp6.c
+++ b/usr.sbin/tcpdump/print-dhcp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-dhcp6.c,v 1.7 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-dhcp6.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (C) 1998 and 1999 WIDE Project.
@@ -31,7 +31,6 @@
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-domain.c b/usr.sbin/tcpdump/print-domain.c
index 8516e8f7fbe..211fc3a2b31 100644
--- a/usr.sbin/tcpdump/print-domain.c
+++ b/usr.sbin/tcpdump/print-domain.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-domain.c,v 1.20 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-domain.c,v 1.21 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-dvmrp.c b/usr.sbin/tcpdump/print-dvmrp.c
index 9ea358486c6..4d841278831 100644
--- a/usr.sbin/tcpdump/print-dvmrp.c
+++ b/usr.sbin/tcpdump/print-dvmrp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-dvmrp.c,v 1.7 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-dvmrp.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-enc.c b/usr.sbin/tcpdump/print-enc.c
index 774857a0288..d2b64e26fe5 100644
--- a/usr.sbin/tcpdump/print-enc.c
+++ b/usr.sbin/tcpdump/print-enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-enc.c,v 1.12 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-enc.c,v 1.13 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
@@ -21,7 +21,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MSIZE */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-ether.c b/usr.sbin/tcpdump/print-ether.c
index 3dea6e7f810..cffb77562b7 100644
--- a/usr.sbin/tcpdump/print-ether.c
+++ b/usr.sbin/tcpdump/print-ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ether.c,v 1.28 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ether.c,v 1.29 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-etherip.c b/usr.sbin/tcpdump/print-etherip.c
index 79327d637b7..640bdebac8e 100644
--- a/usr.sbin/tcpdump/print-etherip.c
+++ b/usr.sbin/tcpdump/print-etherip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-etherip.c,v 1.7 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-etherip.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -30,7 +30,6 @@
* Format and print etherip packets
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-fddi.c b/usr.sbin/tcpdump/print-fddi.c
index df80e6e1bbf..baa1597107a 100644
--- a/usr.sbin/tcpdump/print-fddi.c
+++ b/usr.sbin/tcpdump/print-fddi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-fddi.c,v 1.15 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-fddi.c,v 1.16 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -22,7 +22,6 @@
*/
#ifdef HAVE_FDDI
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-frag6.c b/usr.sbin/tcpdump/print-frag6.c
index 074999fc8c2..be4c4a464d1 100644
--- a/usr.sbin/tcpdump/print-frag6.c
+++ b/usr.sbin/tcpdump/print-frag6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-frag6.c,v 1.6 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-frag6.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994
@@ -23,7 +23,6 @@
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-gre.c b/usr.sbin/tcpdump/print-gre.c
index b89d5baaa3b..d88822bbefb 100644
--- a/usr.sbin/tcpdump/print-gre.c
+++ b/usr.sbin/tcpdump/print-gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-gre.c,v 1.8 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-gre.c,v 1.9 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -31,7 +31,6 @@
* RFC1701 (GRE), RFC1702 (GRE IPv4), and RFC2637 (Enhanced GRE)
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-gtp.c b/usr.sbin/tcpdump/print-gtp.c
index 55882d4c439..e977719b849 100644
--- a/usr.sbin/tcpdump/print-gtp.c
+++ b/usr.sbin/tcpdump/print-gtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-gtp.c,v 1.6 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-gtp.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org>
*
@@ -40,7 +40,6 @@
* 3GPP TS 32.295 - Charging Data Record (CDR) transfer (GTPv1')
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/print-iapp.c b/usr.sbin/tcpdump/print-iapp.c
index 7bafd9d990f..614a917c4ce 100644
--- a/usr.sbin/tcpdump/print-iapp.c
+++ b/usr.sbin/tcpdump/print-iapp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-iapp.c,v 1.4 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-iapp.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2005 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-icmp.c b/usr.sbin/tcpdump/print-icmp.c
index a693aea3c42..fe967c5088b 100644
--- a/usr.sbin/tcpdump/print-icmp.c
+++ b/usr.sbin/tcpdump/print-icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-icmp.c,v 1.24 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-icmp.c,v 1.25 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994, 1995, 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
@@ -40,6 +39,7 @@ struct rtentry;
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include "interface.h"
#include "addrtoname.h"
@@ -171,8 +171,8 @@ icmp_print(const u_char *bp, u_int length, const u_char *bp2)
const struct ip *oip;
const struct udphdr *ouh;
u_int hlen, dport, mtu;
- char buf[MAXHOSTNAMELEN+256];
- char buf2[MAXHOSTNAMELEN+256];
+ char buf[HOST_NAME_MAX+1+256];
+ char buf2[HOST_NAME_MAX+1+256];
dp = (struct icmp *)bp;
ip = (struct ip *)bp2;
diff --git a/usr.sbin/tcpdump/print-icmp6.c b/usr.sbin/tcpdump/print-icmp6.c
index 7ac3e4a3aab..e80a4af6171 100644
--- a/usr.sbin/tcpdump/print-icmp6.c
+++ b/usr.sbin/tcpdump/print-icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-icmp6.c,v 1.14 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-icmp6.c,v 1.15 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994
@@ -25,7 +25,6 @@
#include <ctype.h>
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-igrp.c b/usr.sbin/tcpdump/print-igrp.c
index c463bfbcb8c..636e3dafcd8 100644
--- a/usr.sbin/tcpdump/print-igrp.c
+++ b/usr.sbin/tcpdump/print-igrp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-igrp.c,v 1.6 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-igrp.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1996, 1997
@@ -23,7 +23,6 @@
* Initial contribution from Francis Dupont (francis.dupont@inria.fr)
*/
-#include <sys/param.h>
#include <sys/types.h> /* concession to AIX */
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ike.c b/usr.sbin/tcpdump/print-ike.c
index 6490c06b952..94175355906 100644
--- a/usr.sbin/tcpdump/print-ike.c
+++ b/usr.sbin/tcpdump/print-ike.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ike.c,v 1.36 2012/01/28 13:47:55 sthen Exp $ */
+/* $OpenBSD: print-ike.c,v 1.37 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -27,7 +27,6 @@
* in co-operation with SSH Communications Security, Espoo, Finland
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ip.c b/usr.sbin/tcpdump/print-ip.c
index 604f45aa652..d6940d7d1a2 100644
--- a/usr.sbin/tcpdump/print-ip.c
+++ b/usr.sbin/tcpdump/print-ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ip.c,v 1.42 2014/12/09 17:03:19 mikeb Exp $ */
+/* $OpenBSD: print-ip.c,v 1.43 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c
index f9c851a2c23..269c522cdc5 100644
--- a/usr.sbin/tcpdump/print-ip6.c
+++ b/usr.sbin/tcpdump/print-ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ip6.c,v 1.20 2014/12/09 17:03:19 mikeb Exp $ */
+/* $OpenBSD: print-ip6.c,v 1.21 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
@@ -23,7 +23,6 @@
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ip6opts.c b/usr.sbin/tcpdump/print-ip6opts.c
index cdee34df886..9e7acf829a1 100644
--- a/usr.sbin/tcpdump/print-ip6opts.c
+++ b/usr.sbin/tcpdump/print-ip6opts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ip6opts.c,v 1.3 2006/12/09 01:12:28 itojun Exp $ */
+/* $OpenBSD: print-ip6opts.c,v 1.4 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -30,7 +30,6 @@
*/
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ipsec.c b/usr.sbin/tcpdump/print-ipsec.c
index 51d2470638a..c04cb2da75d 100644
--- a/usr.sbin/tcpdump/print-ipsec.c
+++ b/usr.sbin/tcpdump/print-ipsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ipsec.c,v 1.19 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ipsec.c,v 1.20 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -26,7 +26,6 @@
* in co-operation with SSH Communications Security, Espoo, Finland
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ipx.c b/usr.sbin/tcpdump/print-ipx.c
index 6728c1ac2ed..b72f5367cad 100644
--- a/usr.sbin/tcpdump/print-ipx.c
+++ b/usr.sbin/tcpdump/print-ipx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ipx.c,v 1.13 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ipx.c,v 1.14 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1994, 1995, 1996
@@ -24,7 +24,6 @@
* Contributed by Brad Parker (brad@fcr.com).
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-krb.c b/usr.sbin/tcpdump/print-krb.c
index 5f777834921..7a27cba9702 100644
--- a/usr.sbin/tcpdump/print-krb.c
+++ b/usr.sbin/tcpdump/print-krb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-krb.c,v 1.9 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-krb.c,v 1.10 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997
@@ -23,7 +23,6 @@
* Initial contribution from John Hawkinson (jhawk@mit.edu).
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-l2tp.c b/usr.sbin/tcpdump/print-l2tp.c
index f8808442145..857bac9ab25 100644
--- a/usr.sbin/tcpdump/print-l2tp.c
+++ b/usr.sbin/tcpdump/print-l2tp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-l2tp.c,v 1.7 2011/09/18 14:04:36 naddy Exp $ */
+/* $OpenBSD: print-l2tp.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
@@ -24,7 +24,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <stdio.h>
#include <strings.h>
diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c
index 2f78c6809db..28eda54c6e7 100644
--- a/usr.sbin/tcpdump/print-llc.c
+++ b/usr.sbin/tcpdump/print-llc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-llc.c,v 1.18 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-llc.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -24,7 +24,6 @@
* with an awful lot of hacking by Jeffrey Mogul, DECWRL
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/tcpdump/print-lldp.c b/usr.sbin/tcpdump/print-lldp.c
index 18e6c8e28df..98da2cbaad5 100644
--- a/usr.sbin/tcpdump/print-lldp.c
+++ b/usr.sbin/tcpdump/print-lldp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-lldp.c,v 1.7 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-lldp.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-lwres.c b/usr.sbin/tcpdump/print-lwres.c
index b6113d3c688..5f91bcc8396 100644
--- a/usr.sbin/tcpdump/print-lwres.c
+++ b/usr.sbin/tcpdump/print-lwres.c
@@ -31,7 +31,6 @@
#include "config.h"
#endif
-#include <sys/param.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/tcpdump/print-mobile.c b/usr.sbin/tcpdump/print-mobile.c
index cbfbaf99701..867b737f324 100644
--- a/usr.sbin/tcpdump/print-mobile.c
+++ b/usr.sbin/tcpdump/print-mobile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-mobile.c,v 1.4 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-mobile.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */
/* $NetBSD: print-mobile.c,v 1.3 1999/07/26 06:11:57 itojun Exp $ */
/*
@@ -30,7 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-netbios.c b/usr.sbin/tcpdump/print-netbios.c
index 1c1f8d8b338..730db213e54 100644
--- a/usr.sbin/tcpdump/print-netbios.c
+++ b/usr.sbin/tcpdump/print-netbios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-netbios.c,v 1.9 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-netbios.c,v 1.10 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1994, 1995, 1996
@@ -24,7 +24,6 @@
* Contributed by Brad Parker (brad@fcr.com).
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/usr.sbin/tcpdump/print-nfs.c b/usr.sbin/tcpdump/print-nfs.c
index 2edef633d33..daf3a0f86f3 100644
--- a/usr.sbin/tcpdump/print-nfs.c
+++ b/usr.sbin/tcpdump/print-nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-nfs.c,v 1.18 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-nfs.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ntp.c b/usr.sbin/tcpdump/print-ntp.c
index f3ea0df5092..b67116183e5 100644
--- a/usr.sbin/tcpdump/print-ntp.c
+++ b/usr.sbin/tcpdump/print-ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ntp.c,v 1.15 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-ntp.c,v 1.16 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -25,7 +25,6 @@
* loosely based on print-bootp.c
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-null.c b/usr.sbin/tcpdump/print-null.c
index 95b91ef47d3..f3187edd9c6 100644
--- a/usr.sbin/tcpdump/print-null.c
+++ b/usr.sbin/tcpdump/print-null.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-null.c,v 1.20 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-null.c,v 1.21 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-ospf.c b/usr.sbin/tcpdump/print-ospf.c
index 81e83e332f5..0730171314a 100644
--- a/usr.sbin/tcpdump/print-ospf.c
+++ b/usr.sbin/tcpdump/print-ospf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ospf.c,v 1.18 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ospf.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -23,7 +23,6 @@
* OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu)
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ospf6.c b/usr.sbin/tcpdump/print-ospf6.c
index 98e759dcd95..fa60d90285b 100644
--- a/usr.sbin/tcpdump/print-ospf6.c
+++ b/usr.sbin/tcpdump/print-ospf6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ospf6.c,v 1.7 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ospf6.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
@@ -26,7 +26,6 @@
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-pflog.c b/usr.sbin/tcpdump/print-pflog.c
index 2df0e7d5f29..df7c3d2dc7e 100644
--- a/usr.sbin/tcpdump/print-pflog.c
+++ b/usr.sbin/tcpdump/print-pflog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-pflog.c,v 1.25 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-pflog.c,v 1.26 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
@@ -21,8 +21,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/param.h> /* MSIZE MAXCOMLEN */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-pfsync.c b/usr.sbin/tcpdump/print-pfsync.c
index 0475fc05084..a418b98d967 100644
--- a/usr.sbin/tcpdump/print-pfsync.c
+++ b/usr.sbin/tcpdump/print-pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-pfsync.c,v 1.39 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-pfsync.c,v 1.40 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -26,12 +26,10 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
#include <sys/ioctl.h>
-#include <sys/mbuf.h>
#ifdef __STDC__
struct rtentry;
diff --git a/usr.sbin/tcpdump/print-pim.c b/usr.sbin/tcpdump/print-pim.c
index d0684327ca3..cb73669a82b 100644
--- a/usr.sbin/tcpdump/print-pim.c
+++ b/usr.sbin/tcpdump/print-pim.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-pim.c,v 1.6 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-pim.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ppp.c b/usr.sbin/tcpdump/print-ppp.c
index 34f66e4505f..63c57f3ffdd 100644
--- a/usr.sbin/tcpdump/print-ppp.c
+++ b/usr.sbin/tcpdump/print-ppp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ppp.c,v 1.27 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ppp.c,v 1.28 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -22,7 +22,6 @@
*/
#ifdef PPP
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-raw.c b/usr.sbin/tcpdump/print-raw.c
index 53bd247e32c..233293d198a 100644
--- a/usr.sbin/tcpdump/print-raw.c
+++ b/usr.sbin/tcpdump/print-raw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-raw.c,v 1.7 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-raw.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-rip.c b/usr.sbin/tcpdump/print-rip.c
index 6957fe95128..f4973c14c4b 100644
--- a/usr.sbin/tcpdump/print-rip.c
+++ b/usr.sbin/tcpdump/print-rip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-rip.c,v 1.13 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-rip.c,v 1.14 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1989, 1990, 1991, 1993, 1994, 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-ripng.c b/usr.sbin/tcpdump/print-ripng.c
index 3b845866618..9337cd9f61b 100644
--- a/usr.sbin/tcpdump/print-ripng.c
+++ b/usr.sbin/tcpdump/print-ripng.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ripng.c,v 1.3 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-ripng.c,v 1.4 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1989, 1990, 1991, 1993, 1994
@@ -23,7 +23,6 @@
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-rt6.c b/usr.sbin/tcpdump/print-rt6.c
index cad4329ba5a..27e741284f1 100644
--- a/usr.sbin/tcpdump/print-rt6.c
+++ b/usr.sbin/tcpdump/print-rt6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-rt6.c,v 1.4 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-rt6.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */
/*
@@ -24,7 +24,6 @@
#ifdef INET6
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-skip.c b/usr.sbin/tcpdump/print-skip.c
index 10ecd658ed9..8c123dd729d 100644
--- a/usr.sbin/tcpdump/print-skip.c
+++ b/usr.sbin/tcpdump/print-skip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-skip.c,v 1.4 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-skip.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1995 Sun Microsystems, Inc.
@@ -24,7 +24,6 @@
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
diff --git a/usr.sbin/tcpdump/print-sl.c b/usr.sbin/tcpdump/print-sl.c
index 3cd7f85a02c..a2a25298392 100644
--- a/usr.sbin/tcpdump/print-sl.c
+++ b/usr.sbin/tcpdump/print-sl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-sl.c,v 1.17 2014/11/20 04:01:01 jsg Exp $ */
+/* $OpenBSD: print-sl.c,v 1.18 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -22,11 +22,9 @@
*/
#ifdef HAVE_NET_SLIP_H
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/file.h>
#include <sys/ioctl.h>
-#include <sys/mbuf.h>
#include <sys/socket.h>
struct rtentry;
@@ -45,6 +43,7 @@ struct rtentry;
#include <netdb.h>
#include <pcap.h>
#include <stdio.h>
+#include <limits.h>
#include "interface.h"
#include "addrtoname.h"
diff --git a/usr.sbin/tcpdump/print-slow.c b/usr.sbin/tcpdump/print-slow.c
index 70b729e871f..493927425ba 100644
--- a/usr.sbin/tcpdump/print-slow.c
+++ b/usr.sbin/tcpdump/print-slow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-slow.c,v 1.2 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-slow.c,v 1.3 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1998-2005 The TCPDUMP project
@@ -19,7 +19,6 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-snmp.c b/usr.sbin/tcpdump/print-snmp.c
index 0d80d15a6f8..d0bdb853f5d 100644
--- a/usr.sbin/tcpdump/print-snmp.c
+++ b/usr.sbin/tcpdump/print-snmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-snmp.c,v 1.17 2009/11/12 00:02:16 deraadt Exp $ */
+/* $OpenBSD: print-snmp.c,v 1.18 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -55,7 +55,6 @@
# @(#)snmp.awk.x 1.1 (LANL) 1/15/90
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <ctype.h>
diff --git a/usr.sbin/tcpdump/print-stp.c b/usr.sbin/tcpdump/print-stp.c
index 958e558466f..fbeea005ca6 100644
--- a/usr.sbin/tcpdump/print-stp.c
+++ b/usr.sbin/tcpdump/print-stp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-stp.c,v 1.8 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-stp.c,v 1.9 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -30,7 +30,6 @@
* Pretty print 802.1D Bridge Protocol Data Units
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/tcpdump/print-sunrpc.c b/usr.sbin/tcpdump/print-sunrpc.c
index 73eefbd8163..d1be6d540f6 100644
--- a/usr.sbin/tcpdump/print-sunrpc.c
+++ b/usr.sbin/tcpdump/print-sunrpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-sunrpc.c,v 1.18 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-sunrpc.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-tcp.c b/usr.sbin/tcpdump/print-tcp.c
index 487241f5875..96730025ad7 100644
--- a/usr.sbin/tcpdump/print-tcp.c
+++ b/usr.sbin/tcpdump/print-tcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-tcp.c,v 1.31 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-tcp.c,v 1.32 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/print-tftp.c b/usr.sbin/tcpdump/print-tftp.c
index 2d23e71bc93..3e189a3058a 100644
--- a/usr.sbin/tcpdump/print-tftp.c
+++ b/usr.sbin/tcpdump/print-tftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-tftp.c,v 1.10 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: print-tftp.c,v 1.11 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -23,7 +23,6 @@
* Format and print trivial file transfer protocol packets.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/tcpdump/print-timed.c b/usr.sbin/tcpdump/print-timed.c
index fa0713e9770..3542e96239e 100644
--- a/usr.sbin/tcpdump/print-timed.c
+++ b/usr.sbin/tcpdump/print-timed.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-timed.c,v 1.5 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: print-timed.c,v 1.6 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2000 Ben Smithurst <ben@scientia.demon.co.uk>
@@ -29,7 +29,6 @@
#include "config.h"
#endif
-#include <sys/param.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/usr.sbin/tcpdump/print-udp.c b/usr.sbin/tcpdump/print-udp.c
index 70283cf7626..d179b3e04a6 100644
--- a/usr.sbin/tcpdump/print-udp.c
+++ b/usr.sbin/tcpdump/print-udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-udp.c,v 1.37 2014/08/14 12:44:44 mpi Exp $ */
+/* $OpenBSD: print-udp.c,v 1.38 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
@@ -21,7 +21,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tcpdump/privsep.c b/usr.sbin/tcpdump/privsep.c
index e584e57c4aa..237af086a13 100644
--- a/usr.sbin/tcpdump/privsep.c
+++ b/usr.sbin/tcpdump/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.30 2011/09/22 09:12:30 stsp Exp $ */
+/* $OpenBSD: privsep.c,v 1.31 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2003 Can Erkin Acar
@@ -411,7 +411,7 @@ impl_init_done(int fd, int *bpfd)
static void
impl_gethostbyaddr(int fd)
{
- char hostname[MAXHOSTNAMELEN];
+ char hostname[HOST_NAME_MAX+1];
size_t hostname_len;
int addr_af;
struct hostent *hp;
@@ -434,7 +434,7 @@ static void
impl_ether_ntohost(int fd)
{
struct ether_addr ether;
- char hostname[MAXHOSTNAMELEN];
+ char hostname[HOST_NAME_MAX+1];
logmsg(LOG_DEBUG, "[priv]: msg PRIV_ETHER_NTOHOST received");
diff --git a/usr.sbin/tcpdump/smbutil.c b/usr.sbin/tcpdump/smbutil.c
index a87def67f25..7e4a01255e3 100644
--- a/usr.sbin/tcpdump/smbutil.c
+++ b/usr.sbin/tcpdump/smbutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smbutil.c,v 1.8 2013/04/16 18:10:24 deraadt Exp $ */
+/* $OpenBSD: smbutil.c,v 1.9 2015/01/16 06:40:22 deraadt Exp $ */
/*
Copyright (C) Andrew Tridgell 1995-1999
@@ -11,7 +11,6 @@
#include "config.h"
#endif
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.sbin/tftp-proxy/tftp-proxy.c b/usr.sbin/tftp-proxy/tftp-proxy.c
index 2d216be7370..95ab0badefa 100644
--- a/usr.sbin/tftp-proxy/tftp-proxy.c
+++ b/usr.sbin/tftp-proxy/tftp-proxy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp-proxy.c,v 1.10 2013/12/23 13:08:25 florian Exp $
+/* $OpenBSD: tftp-proxy.c,v 1.11 2015/01/16 06:40:22 deraadt Exp $
*
* Copyright (c) 2005 DLS Internet Services
* Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl>
@@ -27,9 +27,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/ioctl.h>
-#include <sys/param.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/uio.h>
diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c
index a579b7bf260..d502d6d1d9a 100644
--- a/usr.sbin/tftpd/tftpd.c
+++ b/usr.sbin/tftpd/tftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftpd.c,v 1.25 2014/12/17 22:23:33 tedu Exp $ */
+/* $OpenBSD: tftpd.c,v 1.26 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2012 David Gwynne <dlg@uq.edu.au>
@@ -58,8 +58,6 @@
*/
#include <sys/ioctl.h>
-#include <sys/param.h>
-#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -84,6 +82,7 @@
#include <stdarg.h>
#include <syslog.h>
#include <unistd.h>
+#include <limits.h>
#include <vis.h>
#define TIMEOUT 5 /* packet rexmt timeout */
@@ -475,7 +474,7 @@ rewrite_res(int fd, short events, void *arg)
char *filename;
size_t len;
- switch (evbuffer_read(rwmap->rdbuf, fd, MAXPATHLEN)) {
+ switch (evbuffer_read(rwmap->rdbuf, fd, PATH_MAX)) {
case -1:
switch (errno) {
case EINTR:
@@ -794,7 +793,7 @@ tftp(struct tftp_client *client, struct tftphdr *tp, size_t size)
int i, first = 1, ecode, to;
struct formats *pf;
char *mode = NULL;
- char filename[MAXPATHLEN];
+ char filename[PATH_MAX];
const char *errstr;
if (size < 5) {
@@ -873,9 +872,9 @@ again:
}
if (verbose) {
- char nicebuf[MAXPATHLEN];
+ char nicebuf[PATH_MAX];
- (void)strnvis(nicebuf, filename, MAXPATHLEN,
+ (void)strnvis(nicebuf, filename, PATH_MAX,
VIS_SAFE|VIS_OCTAL);
linfo("%s: %s request for '%s'", getip(&client->ss),
diff --git a/usr.sbin/tokenadm/tokenadm.c b/usr.sbin/tokenadm/tokenadm.c
index b8efbe3b30f..6bdde8f9bab 100644
--- a/usr.sbin/tokenadm/tokenadm.c
+++ b/usr.sbin/tokenadm/tokenadm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tokenadm.c,v 1.9 2007/03/15 22:31:14 jmc Exp $ */
+/* $OpenBSD: tokenadm.c,v 1.10 2015/01/16 06:40:22 deraadt Exp $ */
/*-
* Copyright (c) 1995 Migration Associates Corp. All Rights Reserved
@@ -34,7 +34,7 @@
* BSDI $From: tokenadm.c,v 1.2 1996/10/17 00:54:28 prb Exp $
*/
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/resource.h>
#include <sys/time.h>
@@ -44,6 +44,7 @@
#include <syslog.h>
#include <stdlib.h>
#include <unistd.h>
+#include <limits.h>
#include <string.h>
#include "token.h"
diff --git a/usr.sbin/tokeninit/tokeninit.c b/usr.sbin/tokeninit/tokeninit.c
index 4d86c54df3b..c3fd879502f 100644
--- a/usr.sbin/tokeninit/tokeninit.c
+++ b/usr.sbin/tokeninit/tokeninit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tokeninit.c,v 1.7 2008/07/09 19:58:28 sobrado Exp $ */
+/* $OpenBSD: tokeninit.c,v 1.8 2015/01/16 06:40:22 deraadt Exp $ */
/*-
* Copyright (c) 1995 Migration Associates Corp. All Rights Reserved
@@ -34,7 +34,7 @@
* BSDI $From: tokeninit.c,v 1.1 1996/08/26 20:27:28 prb Exp
*/
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/resource.h>
#include <sys/time.h>
@@ -43,6 +43,7 @@
#include <syslog.h>
#include <stdlib.h>
#include <unistd.h>
+#include <limits.h>
#include <string.h>
#include <readpassphrase.h>
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c
index d6ae260c4ca..257cf69ff9d 100644
--- a/usr.sbin/traceroute/traceroute.c
+++ b/usr.sbin/traceroute/traceroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traceroute.c,v 1.134 2014/12/09 17:46:24 millert Exp $ */
+/* $OpenBSD: traceroute.c,v 1.135 2015/01/16 06:40:22 deraadt Exp $ */
/* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */
/*
@@ -233,7 +233,6 @@
* Tue Dec 20 03:50:13 PST 1988
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -265,6 +264,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#define MAX_LSRR ((MAX_IPOPTLEN - 4) / 4)
@@ -1703,7 +1703,7 @@ in_cksum(u_short *addr, int len)
const char *
inetname(struct sockaddr *sa)
{
- static char line[NI_MAXHOST], domain[MAXHOSTNAMELEN + 1];
+ static char line[NI_MAXHOST], domain[HOST_NAME_MAX+1 + 1];
static int first = 1;
char *cp;
diff --git a/usr.sbin/trpt/trpt.c b/usr.sbin/trpt/trpt.c
index f8aa4deac02..179cc3467c5 100644
--- a/usr.sbin/trpt/trpt.c
+++ b/usr.sbin/trpt/trpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trpt.c,v 1.29 2014/11/26 18:34:52 millert Exp $ */
+/* $OpenBSD: trpt.c,v 1.30 2015/01/16 06:40:22 deraadt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -59,7 +59,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#define PRUREQUESTS
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c
index 394710bf079..6356a90fe36 100644
--- a/usr.sbin/user/user.c
+++ b/usr.sbin/user/user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: user.c,v 1.100 2014/08/27 06:51:35 sebastia Exp $ */
+/* $OpenBSD: user.c,v 1.101 2015/01/16 06:40:22 deraadt Exp $ */
/* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */
/*
@@ -32,7 +32,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -51,6 +51,7 @@
#include <syslog.h>
#include <time.h>
#include <unistd.h>
+#include <limits.h>
#include <util.h>
#include "defs.h"
@@ -159,7 +160,7 @@ enum {
/* some useful constants */
enum {
MaxShellNameLen = 256,
- MaxFileNameLen = MAXPATHLEN,
+ MaxFileNameLen = PATH_MAX,
MaxUserNameLen = _PW_NAME_LEN,
MaxCommandLen = 2048,
PasswordLength = _PASSWORD_LEN,
diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c
index 2f7850d35d5..ee265aa1f58 100644
--- a/usr.sbin/watchdogd/watchdogd.c
+++ b/usr.sbin/watchdogd/watchdogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: watchdogd.c,v 1.14 2012/12/18 21:28:45 millert Exp $ */
+/* $OpenBSD: watchdogd.c,v 1.15 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2005 Marc Balmer <mbalmer@openbsd.org>
@@ -16,8 +16,9 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/resource.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/mman.h>
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 <deraadt@openbsd.org>
@@ -36,6 +36,7 @@
#include <net/if.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <errno.h>
#include <ctype.h>
#include <netdb.h>
@@ -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, '/'))
diff --git a/usr.sbin/ypldap/ber.c b/usr.sbin/ypldap/ber.c
index 5c8688e10bc..5f8cb774526 100644
--- a/usr.sbin/ypldap/ber.c
+++ b/usr.sbin/ypldap/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.7 2010/06/14 13:46:08 martinh Exp $ */
+/* $OpenBSD: ber.c,v 1.8 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -19,7 +19,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <errno.h>
#include <limits.h>
@@ -32,6 +31,7 @@
#include "ber.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define BER_TYPE_CONSTRUCTED 0x20 /* otherwise primitive */
#define BER_TYPE_SINGLE_MAX 30
@@ -1163,7 +1163,7 @@ ber_readbuf(struct ber *b, void *buf, size_t nbytes)
return -1;
sz = b->br_rend - b->br_rptr;
- len = MIN(nbytes, sz);
+ len = MINIMUM(nbytes, sz);
if (len == 0) {
errno = ECANCELED;
return (-1); /* end of buffer and parser wants more data */
diff --git a/usr.sbin/ypldap/entries.c b/usr.sbin/ypldap/entries.c
index 7bcb2bf501b..84fa48120fa 100644
--- a/usr.sbin/ypldap/entries.c
+++ b/usr.sbin/ypldap/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.2 2011/08/28 11:53:16 aschrijver Exp $ */
+/* $OpenBSD: entries.c,v 1.3 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
*
@@ -16,7 +16,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/tree.h>
@@ -32,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "ypldap.h"
diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c
index 4cceabf722c..3cb1a0701f3 100644
--- a/usr.sbin/ypldap/ldapclient.c
+++ b/usr.sbin/ypldap/ldapclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapclient.c,v 1.31 2014/11/16 23:24:44 tedu Exp $ */
+/* $OpenBSD: ldapclient.c,v 1.32 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -18,9 +18,9 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
+#include <sys/signal.h>
#include <sys/tree.h>
#include <netinet/in.h>
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "aldap.h"
#include "ypldap.h"
diff --git a/usr.sbin/ypldap/parse.y b/usr.sbin/ypldap/parse.y
index 1ca61fb1df4..39be6965362 100644
--- a/usr.sbin/ypldap/parse.y
+++ b/usr.sbin/ypldap/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.17 2014/11/20 05:51:21 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.18 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -28,7 +28,6 @@
#include <sys/time.h>
#include <sys/queue.h>
#include <sys/tree.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
diff --git a/usr.sbin/ypldap/yp.c b/usr.sbin/ypldap/yp.c
index c8e1a47442e..0a51affe712 100644
--- a/usr.sbin/ypldap/yp.c
+++ b/usr.sbin/ypldap/yp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp.c,v 1.12 2013/10/01 12:00:34 deraadt Exp $ */
+/* $OpenBSD: yp.c,v 1.13 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
*
@@ -16,7 +16,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/select.h>
@@ -33,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/usr.sbin/ypldap/ypldap.c b/usr.sbin/ypldap/ypldap.c
index 5f7b479e0b9..f53e3775005 100644
--- a/usr.sbin/ypldap/ypldap.c
+++ b/usr.sbin/ypldap/ypldap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypldap.c,v 1.14 2014/07/13 15:38:09 krw Exp $ */
+/* $OpenBSD: ypldap.c,v 1.15 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -17,9 +17,9 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
+#include <sys/signal.h>
#include <sys/tree.h>
#include <sys/wait.h>
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "ypldap.h"
diff --git a/usr.sbin/ypldap/ypldap.h b/usr.sbin/ypldap/ypldap.h
index 3a1bd17a776..177e8fda4f2 100644
--- a/usr.sbin/ypldap/ypldap.h
+++ b/usr.sbin/ypldap/ypldap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypldap.h,v 1.15 2014/11/03 20:15:31 bluhm Exp $ */
+/* $OpenBSD: ypldap.h,v 1.16 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -81,7 +81,7 @@ enum client_state {
struct idm {
TAILQ_ENTRY(idm) idm_entry;
u_int32_t idm_id;
- char idm_name[MAXHOSTNAMELEN];
+ char idm_name[HOST_NAME_MAX+1];
#define F_SSL 0x00100000
#define F_CONFIGURING 0x00200000
#define F_NEEDAUTH 0x00400000
@@ -155,7 +155,7 @@ struct env {
u_int32_t sc_maxid;
- char sc_domainname[MAXHOSTNAMELEN];
+ char sc_domainname[HOST_NAME_MAX+1];
struct timeval sc_conf_tv;
struct event sc_conf_ev;
TAILQ_HEAD(idm_list, idm) sc_idms;
diff --git a/usr.sbin/ypldap/ypldap_dns.c b/usr.sbin/ypldap/ypldap_dns.c
index 1e4aa6bb4b1..24483861715 100644
--- a/usr.sbin/ypldap/ypldap_dns.c
+++ b/usr.sbin/ypldap/ypldap_dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypldap_dns.c,v 1.7 2014/07/13 15:38:09 krw Exp $ */
+/* $OpenBSD: ypldap_dns.c,v 1.8 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org>
@@ -19,7 +19,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/tree.h>
#include <sys/queue.h>
@@ -37,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "ypldap.h"
diff --git a/usr.sbin/yppoll/yppoll.c b/usr.sbin/yppoll/yppoll.c
index 6cb4f4d4460..266f88b60cc 100644
--- a/usr.sbin/yppoll/yppoll.c
+++ b/usr.sbin/yppoll/yppoll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppoll.c,v 1.14 2013/04/16 19:24:55 deraadt Exp $ */
+/* $OpenBSD: yppoll.c,v 1.15 2015/01/16 06:40:22 deraadt Exp $ */
/* $NetBSD: yppoll.c,v 1.5 1996/05/13 02:46:36 thorpej Exp $ */
/*
@@ -31,7 +31,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
diff --git a/usr.sbin/ypserv/common/ypdb.c b/usr.sbin/ypserv/common/ypdb.c
index 3753cdcd9b8..c2e510b93d4 100644
--- a/usr.sbin/ypserv/common/ypdb.c
+++ b/usr.sbin/ypserv/common/ypdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypdb.c,v 1.11 2003/07/15 06:10:46 deraadt Exp $ */
+/* $OpenBSD: ypdb.c,v 1.12 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -36,7 +36,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
@@ -54,7 +53,7 @@ extern DBM *
ypdb_open(const char *file, int flags, int mode)
{
BTREEINFO info;
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
DBM *db;
memset(&info, 0, sizeof info);
diff --git a/usr.sbin/ypserv/common/yplib_host.c b/usr.sbin/ypserv/common/yplib_host.c
index 1d1ed503c5e..ddd1b207622 100644
--- a/usr.sbin/ypserv/common/yplib_host.c
+++ b/usr.sbin/ypserv/common/yplib_host.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yplib_host.c,v 1.17 2014/11/18 20:54:29 krw Exp $ */
+/* $OpenBSD: yplib_host.c,v 1.18 2015/01/16 06:40:22 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
@@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/file.h>
diff --git a/usr.sbin/ypserv/makedbm/db.c b/usr.sbin/ypserv/makedbm/db.c
index b57399f8280..9e27569e356 100644
--- a/usr.sbin/ypserv/makedbm/db.c
+++ b/usr.sbin/ypserv/makedbm/db.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db.c,v 1.8 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: db.c,v 1.9 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1997 Mats O Jansson <moj@stacken.kth.se>
@@ -30,7 +30,6 @@
#include <db.h>
#include <fcntl.h>
#include <stdio.h>
-#include <sys/param.h>
#include "db.h"
#include "ypdb.h"
@@ -45,7 +44,7 @@ db_hash_list_database(char *database)
DB *db;
int status;
DBT key, val;
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
snprintf(path, sizeof(path), "%s%s", database, ".db");
diff --git a/usr.sbin/ypserv/makedbm/makedbm.c b/usr.sbin/ypserv/makedbm/makedbm.c
index 98cfaf99997..5f373f5aad9 100644
--- a/usr.sbin/ypserv/makedbm/makedbm.c
+++ b/usr.sbin/ypserv/makedbm/makedbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: makedbm.c,v 1.31 2013/12/04 02:18:05 deraadt Exp $ */
+/* $OpenBSD: makedbm.c,v 1.32 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1994-97 Mats O Jansson <moj@stacken.kth.se>
@@ -31,7 +31,6 @@
#include <fcntl.h>
#include <ctype.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
@@ -162,13 +161,13 @@ create_database(char *infile, char *database, char *yp_input_file,
{
FILE *data_file;
char data_line[4096]; /* XXX: DB bsize = 4096 in ypdb.c */
- char myname[MAXHOSTNAMELEN];
+ char myname[HOST_NAME_MAX+1];
int line_no = 0, len;
char *p, *k, *v, *slash;
DBM *new_db;
static char mapname[] = "ypdbXXXXXXXXXX";
- char db_mapname[MAXPATHLEN], db_outfile[MAXPATHLEN];
- char db_tempname[MAXPATHLEN], empty_str[] = "";
+ char db_mapname[PATH_MAX], db_outfile[PATH_MAX];
+ char db_tempname[PATH_MAX], empty_str[] = "";
if (strcmp(infile,"-") == 0) {
data_file = stdin;
@@ -181,7 +180,7 @@ create_database(char *infile, char *database, char *yp_input_file,
}
}
- if (strlen(database) + strlen(YPDB_SUFFIX) > MAXPATHLEN) {
+ if (strlen(database) + strlen(YPDB_SUFFIX) > PATH_MAX) {
fprintf(stderr,"%s: %s: file name too long\n",
__progname, database);
exit(1);
@@ -197,7 +196,7 @@ create_database(char *infile, char *database, char *yp_input_file,
/* note: database is now directory where map goes ! */
if (strlen(database) + strlen(mapname) +
- strlen(YPDB_SUFFIX) > MAXPATHLEN) {
+ strlen(YPDB_SUFFIX) > PATH_MAX) {
fprintf(stderr,"%s: %s: directory name too long\n",
__progname, database);
exit(1);
diff --git a/usr.sbin/ypserv/mkalias/mkalias.c b/usr.sbin/ypserv/mkalias/mkalias.c
index 71e9470e2bb..e15b0388ae1 100644
--- a/usr.sbin/ypserv/mkalias/mkalias.c
+++ b/usr.sbin/ypserv/mkalias/mkalias.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkalias.c,v 1.26 2013/12/05 14:18:54 jca Exp $ */
+/* $OpenBSD: mkalias.c,v 1.27 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1997 Mats O Jansson <moj@stacken.kth.se>
@@ -33,7 +33,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
@@ -146,10 +145,10 @@ main(int argc, char *argv[])
datum key, val;
DBM *new_db = NULL;
static char mapname[] = "ypdbXXXXXXXXXX";
- char db_mapname[MAXPATHLEN], db_outfile[MAXPATHLEN];
- char db_tempname[MAXPATHLEN];
+ char db_mapname[PATH_MAX], db_outfile[PATH_MAX];
+ char db_tempname[PATH_MAX];
char user[4096], host[4096]; /* XXX: DB bsize = 4096 in ypdb.c */
- char myname[MAXHOSTNAMELEN], datestr[11], *slash;
+ char myname[HOST_NAME_MAX+1], datestr[11], *slash;
while ((ch = getopt(argc, argv, "Edensuv")) != -1)
switch (ch) {
@@ -196,7 +195,7 @@ main(int argc, char *argv[])
}
if (output != NULL) {
- if (strlen(output) + strlen(YPDB_SUFFIX) > MAXPATHLEN) {
+ if (strlen(output) + strlen(YPDB_SUFFIX) > PATH_MAX) {
errx(1, "%s: file name too long", output);
/* NOTREACHED */
}
@@ -213,7 +212,7 @@ main(int argc, char *argv[])
/* note: output is now directory where map goes ! */
if (strlen(output) + strlen(mapname) +
- strlen(YPDB_SUFFIX) > MAXPATHLEN) {
+ strlen(YPDB_SUFFIX) > PATH_MAX) {
errx(1, "%s: directory name too long", output);
/* NOTREACHED */
}
diff --git a/usr.sbin/ypserv/mknetid/mknetid.c b/usr.sbin/ypserv/mknetid/mknetid.c
index 60de4acf1f2..ec1b3b10af0 100644
--- a/usr.sbin/ypserv/mknetid/mknetid.c
+++ b/usr.sbin/ypserv/mknetid/mknetid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mknetid.c,v 1.20 2013/12/04 02:18:05 deraadt Exp $ */
+/* $OpenBSD: mknetid.c,v 1.21 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
@@ -36,6 +35,7 @@
#include <grp.h>
#include <err.h>
#include <netdb.h>
+#include <limits.h>
#include <rpcsvc/ypclnt.h>
@@ -44,7 +44,7 @@ struct user {
int usr_uid; /* user uid */
int usr_gid; /* user gid */
int gid_count; /* number of gids */
- int gid[NGROUPS]; /* additional gids */
+ int gid[NGROUPS_MAX]; /* additional gids */
struct user *prev, *next; /* links in read order */
struct user *hprev, *hnext; /* links in hash order */
};
@@ -155,7 +155,7 @@ add_group(char *username, char *gid)
if (strcmp(username, u->usr_name) == 0) {
if (g != u->usr_gid) {
u->gid_count++;
- if (u->gid_count < NGROUPS)
+ if (u->gid_count < NGROUPS_MAX)
u->gid[u->gid_count] = atoi(gid);
}
u = htail[idx];
diff --git a/usr.sbin/ypserv/yppush/yppush.c b/usr.sbin/ypserv/yppush/yppush.c
index f8fb6d38e11..c054a3bb9ac 100644
--- a/usr.sbin/ypserv/yppush/yppush.c
+++ b/usr.sbin/ypserv/yppush/yppush.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yppush.c,v 1.30 2014/11/04 16:16:03 deraadt Exp $ */
+/* $OpenBSD: yppush.c,v 1.31 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson <moj@stacken.kth.se>
@@ -52,7 +52,7 @@
#include "ypdb.h"
int Verbose = 0;
-char Domain[MAXHOSTNAMELEN], Map[255];
+char Domain[HOST_NAME_MAX+1], Map[255];
u_int32_t OrderNum;
char *master;
@@ -141,7 +141,7 @@ req_xfr(pid_t pid, u_int prog, SVCXPRT *transp, char *host, CLIENT *client)
static void
push(int inlen, char *indata)
{
- char host[MAXHOSTNAMELEN];
+ char host[HOST_NAME_MAX+1];
CLIENT *client;
SVCXPRT *transp;
int sock = RPC_ANYSOCK, status;
@@ -222,7 +222,7 @@ main(int argc, char *argv[])
int c, r, i;
char *ypmap = "ypservers";
CLIENT *client;
- static char map_path[MAXPATHLEN];
+ static char map_path[PATH_MAX];
struct stat finfo;
DBM *yp_databas;
char order_key[YP_LAST_LEN] = YP_LAST_KEY;
diff --git a/usr.sbin/ypserv/ypserv/ypserv_db.c b/usr.sbin/ypserv/ypserv/ypserv_db.c
index cbdf0f7125c..362816118d8 100644
--- a/usr.sbin/ypserv/ypserv/ypserv_db.c
+++ b/usr.sbin/ypserv/ypserv/ypserv_db.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypserv_db.c,v 1.28 2013/12/05 17:36:12 jca Exp $ */
+/* $OpenBSD: ypserv_db.c,v 1.29 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -37,7 +37,6 @@
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
@@ -197,7 +196,7 @@ DBM *
ypdb_open_db(domainname domain, mapname map, ypstat *status,
struct opt_map **map_info)
{
- char map_path[MAXPATHLEN];
+ char map_path[PATH_MAX];
static char *domain_key = YP_INTERDOMAIN_KEY;
static char *secure_key = YP_SECURE_KEY;
DBM *db;
@@ -369,8 +368,8 @@ lookup_host(int nametable, int host_lookup, DBM *db, char *keystr,
struct in_addr *addr_name;
struct in_addr addr_addr;
static char val[BUFSIZ+1]; /* match libc */
- static char hostname[MAXHOSTNAMELEN];
- char tmpbuf[MAXHOSTNAMELEN + 20], *v, *ptr;
+ static char hostname[HOST_NAME_MAX+1];
+ char tmpbuf[HOST_NAME_MAX+1 + 20], *v, *ptr;
size_t len;
int l;
diff --git a/usr.sbin/ypserv/ypserv/ypserv_proc.c b/usr.sbin/ypserv/ypserv/ypserv_proc.c
index de86b94d410..aa88455071d 100644
--- a/usr.sbin/ypserv/ypserv/ypserv_proc.c
+++ b/usr.sbin/ypserv/ypserv/ypserv_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypserv_proc.c,v 1.28 2014/02/24 06:45:56 jsg Exp $ */
+/* $OpenBSD: ypserv_proc.c,v 1.29 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,6 @@
#include <rpcsvc/ypclnt.h>
#include <sys/stat.h>
#include <sys/socket.h>
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "ypdb.h"
@@ -82,7 +81,7 @@ ypproc_domain_2_svc(domainname *argp, struct svc_req *rqstp)
{
struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt);
int ok = acl_check_host(&caller->sin_addr);
- static char domain_path[MAXPATHLEN];
+ static char domain_path[PATH_MAX];
static bool_t result;
struct stat finfo;
@@ -110,7 +109,7 @@ ypproc_domain_nonack_2_svc(domainname *argp, struct svc_req *rqstp)
static bool_t result; /* is domain served? */
struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt);
int ok = acl_check_host(&caller->sin_addr);
- static char domain_path[MAXPATHLEN];
+ static char domain_path[PATH_MAX];
struct stat finfo;
if (strchr(*argp, '/'))
@@ -440,7 +439,7 @@ ypproc_maplist_2_svc(domainname *argp, struct svc_req *rqstp)
static ypresp_maplist res;
struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt);
int ok = acl_check_host(&caller->sin_addr);
- static char domain_path[MAXPATHLEN];
+ static char domain_path[PATH_MAX];
struct stat finfo;
DIR *dirp = NULL;
struct dirent *dp;
@@ -539,7 +538,7 @@ ypoldproc_domain_1_svc(domainname *argp, struct svc_req *rqstp)
static bool_t result; /* is domain_served? */
struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt);
int ok = acl_check_host(&caller->sin_addr);
- static char domain_path[MAXPATHLEN];
+ static char domain_path[PATH_MAX];
struct stat finfo;
if (strchr(*argp, '/'))
@@ -567,7 +566,7 @@ ypoldproc_domain_nonack_1_svc(domainname *argp, struct svc_req *rqstp)
static bool_t result; /* is domain served? */
struct sockaddr_in *caller = svc_getcaller(rqstp->rq_xprt);
int ok = acl_check_host(&caller->sin_addr);
- static char domain_path[MAXPATHLEN];
+ static char domain_path[PATH_MAX];
struct stat finfo;
if (strchr(*argp, '/'))
diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c
index 6e2dc635679..61f208ed759 100644
--- a/usr.sbin/ypserv/ypxfr/ypxfr.c
+++ b/usr.sbin/ypserv/ypxfr/ypxfr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypxfr.c,v 1.37 2009/10/27 23:59:58 deraadt Exp $ */
+/* $OpenBSD: ypxfr.c,v 1.38 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -77,7 +77,7 @@ ypxfr_foreach(u_long status, char *keystr, int keylen, char *valstr, int vallen,
static int
get_local_ordernum(char *domain, char *map, u_int32_t *lordernum)
{
- char map_path[MAXPATHLEN], order[MAX_LAST_LEN+1];
+ char map_path[PATH_MAX], order[MAX_LAST_LEN+1];
char order_key[] = YP_LAST_KEY;
struct stat finfo;
datum k, v;
@@ -173,7 +173,7 @@ create_db(char *domain, char *map, char *temp_map)
static int
install_db(char *domain, char *map, char *temp_map)
{
- char db_name[MAXPATHLEN];
+ char db_name[PATH_MAX];
snprintf(db_name, sizeof db_name, "%s/%s/%s%s",
YP_DB_PATH, domain, map, YPDB_SUFFIX);
@@ -454,7 +454,7 @@ main(int argc, char *argv[])
}
if (status == YPPUSH_SUCC) {
- char tmpmapname[MAXPATHLEN];
+ char tmpmapname[PATH_MAX];
int fd;
/* Create temporary db */
diff --git a/usr.sbin/ypset/ypset.c b/usr.sbin/ypset/ypset.c
index 59d9736659b..ebd86597fa1 100644
--- a/usr.sbin/ypset/ypset.c
+++ b/usr.sbin/ypset/ypset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypset.c,v 1.19 2009/10/27 23:59:58 deraadt Exp $ */
+/* $OpenBSD: ypset.c,v 1.20 2015/01/16 06:40:23 deraadt Exp $ */
/* $NetBSD: ypset.c,v 1.8 1996/05/13 02:46:33 thorpej Exp $ */
/*
@@ -27,7 +27,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <err.h>
diff --git a/usr.sbin/ztsscale/ztsscale.c b/usr.sbin/ztsscale/ztsscale.c
index 8b6a2e094f9..394a123279b 100644
--- a/usr.sbin/ztsscale/ztsscale.c
+++ b/usr.sbin/ztsscale/ztsscale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ztsscale.c,v 1.17 2014/09/27 06:28:45 doug Exp $ */
+/* $OpenBSD: ztsscale.c,v 1.18 2015/01/16 06:40:23 deraadt Exp $ */
/*
* Copyright (c) 2005 Matthieu Herrb
@@ -16,7 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <machine/cpu.h>