summaryrefslogtreecommitdiff
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /usr.sbin/mtree
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.sbin/mtree')
-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
4 files changed, 14 insertions, 14 deletions
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);