summaryrefslogtreecommitdiff
path: root/include/fts.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-05-15 21:14:40 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-05-15 21:14:40 +0000
commit702c312cb2831ffe553edec88356e10045e393dc (patch)
tree4a2502c33d39858af039f48178358183b02c5015 /include/fts.h
parent58f7e38be96df800e8b4421a044937182e3679b5 (diff)
Make path length variables size_t. This fixes the problem where
things like rm can't remove files with ridiculously long path names that were created by some script kiddie trying in vain to exploit something. Previously, the length was effectively constrained to USHRT_MAX due to one of the internal structs. Also, nuke FTS_CHDIRROOT since it never worked correctly and hasn't been documented for a long time.
Diffstat (limited to 'include/fts.h')
-rw-r--r--include/fts.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/fts.h b/include/fts.h
index fdb89c58c1e..eb40c7a14d9 100644
--- a/include/fts.h
+++ b/include/fts.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.h,v 1.5 1999/10/03 20:39:52 millert Exp $ */
+/* $OpenBSD: fts.h,v 1.6 2001/05/15 21:14:37 millert Exp $ */
/* $NetBSD: fts.h,v 1.5 1994/12/28 01:41:50 mycroft Exp $ */
/*
@@ -46,7 +46,7 @@ typedef struct {
dev_t fts_dev; /* starting device # */
char *fts_path; /* path for this descent */
int fts_rfd; /* fd for root */
- int fts_pathlen; /* sizeof(path) */
+ size_t fts_pathlen; /* sizeof(path) */
int fts_nitems; /* elements in the sort array */
int (*fts_compar)(); /* compare function */
@@ -58,8 +58,7 @@ typedef struct {
#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
#define FTS_XDEV 0x0040 /* don't cross devices */
#define FTS_WHITEOUT 0x0080 /* return whiteout information */
-#define FTS_CHDIRROOT 0x0100 /* chdir to root of tree not orig cwd */
-#define FTS_OPTIONMASK 0x0fff /* valid user option mask */
+#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
#define FTS_NAMEONLY 0x1000 /* (private) child names only */
#define FTS_STOP 0x2000 /* (private) unrecoverable error */
@@ -76,8 +75,8 @@ typedef struct _ftsent {
char *fts_path; /* root path */
int fts_errno; /* errno for this node */
int fts_symfd; /* fd for symlink */
- u_short fts_pathlen; /* strlen(fts_path) */
- u_short fts_namelen; /* strlen(fts_name) */
+ size_t fts_pathlen; /* strlen(fts_path) */
+ size_t fts_namelen; /* strlen(fts_name) */
ino_t fts_ino; /* inode */
dev_t fts_dev; /* device */