summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/ufs.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-08-29 21:10:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-08-29 21:10:21 +0000
commit8d99b6464763de8f71728b10171c26c0f68bd6cc (patch)
treee6af26a3ff4db271474c703c8540b758386bcf37 /usr.sbin/vmd/ufs.c
parentcd86de26d227088c4f271f8bd65b803be31f698b (diff)
quarterly rescan of the tree: remove unneccessary sys/param.h, and
annotate the ones which are needed.
Diffstat (limited to 'usr.sbin/vmd/ufs.c')
-rw-r--r--usr.sbin/vmd/ufs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/vmd/ufs.c b/usr.sbin/vmd/ufs.c
index 2faa44572cf..a9967c15f3a 100644
--- a/usr.sbin/vmd/ufs.c
+++ b/usr.sbin/vmd/ufs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs.c,v 1.4 2016/11/25 17:03:59 reyk Exp $ */
+/* $OpenBSD: ufs.c,v 1.5 2017/08/29 21:10:20 deraadt Exp $ */
/* $NetBSD: ufs.c,v 1.16 1996/09/30 16:01:22 ws Exp $ */
/*-
@@ -63,13 +63,15 @@
* Stand-alone file reading package.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* DEV_BSIZE MAXBSIZE */
#include <sys/time.h>
#include <sys/stat.h>
#include <ufs/ffs/fs.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
+#include <limits.h>
+
#include "vmboot.h"
/* Used in the kernel by libsa */
@@ -364,7 +366,7 @@ search_directory(char *name, struct open_file *f, ufsino_t *inumber_p)
int
ufs_open(char *path, struct open_file *f)
{
- char namebuf[MAXPATHLEN+1], *cp, *ncp, *buf = NULL;
+ char namebuf[PATH_MAX+1], *cp, *ncp, *buf = NULL;
ufsino_t inumber, parent_inumber;
int rc, c, nlinks = 0;
struct file *fp;
@@ -475,8 +477,8 @@ ufs_open(char *path, struct open_file *f)
len = strlen(cp);
- if (link_len + len > MAXPATHLEN ||
- ++nlinks > MAXSYMLINKS) {
+ if (link_len + len > PATH_MAX ||
+ ++nlinks > SYMLOOP_MAX) {
rc = ENOENT;
goto out;
}