diff options
Diffstat (limited to 'usr.bin/find')
-rw-r--r-- | usr.bin/find/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/find/function.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/find/Makefile b/usr.bin/find/Makefile index 0c7bb70..cd10f12 100644 --- a/usr.bin/find/Makefile +++ b/usr.bin/find/Makefile @@ -6,4 +6,6 @@ SRCS= find.c function.c ls.c main.c misc.c operator.c option.c \ getdate.y YFLAGS= +NO_WMISSING_VARIABLE_DECLARATIONS= + .include <bsd.prog.mk> diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 7f16a8f..56d361c 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -442,7 +442,8 @@ f_delete(PLAN *plan __unused, FTSENT *entry) errx(1, "-delete: forbidden when symlinks are followed"); /* Potentially unsafe - do not accept relative paths whatsoever */ - if (strchr(entry->fts_accpath, '/') != NULL) + if (entry->fts_level > FTS_ROOTLEVEL && + strchr(entry->fts_accpath, '/') != NULL) errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); |