summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--UPDATING13
-rw-r--r--usr.bin/find/function.c3
2 files changed, 15 insertions, 1 deletions
diff --git a/UPDATING b/UPDATING
index d3a6d56..604a909 100644
--- a/UPDATING
+++ b/UPDATING
@@ -31,6 +31,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20130802:
+ find -delete can now delete the pathnames given as arguments,
+ instead of only files found below them or if the pathname did
+ not contain any slashes. Formerly, the following error message
+ would result:
+
+ find: -delete: <path>: relative path potentially not safe
+
+ Deleting the pathnames given as arguments can be prevented
+ without error messages using -mindepth 1 or by changing
+ directory and passing "." as argument to find. This works in the
+ old as well as the new version of find.
+
20130726:
Behavior of devfs rules path matching has been changed.
Pattern is now always matched against fully qualified devfs
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