summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.sbin/config
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.sbin/config')
-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
11 files changed, 18 insertions, 32 deletions
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>