summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
committersjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
commit62bb1062226d3ce6a2350808256a25508978352d (patch)
tree22b131dceb13c3df96da594fbaadb693504797c7 /usr.bin/find
parent72ab90509b3a51ab361bf710338f2ef44a4e360d (diff)
parent04932445481c2cb89ff69a83b961bdef3d64757e (diff)
downloadFreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.zip
FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.tar.gz
Merge from head
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/Makefile2
-rw-r--r--usr.bin/find/function.c3
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);
OpenPOWER on IntegriCloud