diff --git a/UPDATING b/UPDATING index d3a6d569ebf3..604a90973d2c 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: : 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 7f16a8f1892a..56d361cd575b 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);