summaryrefslogtreecommitdiffstats
path: root/usr.sbin/kvm_mkdb
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/kvm_mkdb
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/kvm_mkdb')
-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
3 files changed, 7 insertions, 8 deletions
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>