Don't cross mount boundaries when cleaning tmp files.

Mounting something in /tmp such as a build jail with nullfs mounts for
some directories can result in very surprising results the next day.

MFC after:	2 weeks
Relnotes:	yes
This commit is contained in:
Bryan Drewery 2014-09-09 17:03:58 +00:00
parent 2e779f745b
commit 07509279d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271321

View File

@ -45,8 +45,8 @@ case "$daily_clean_tmps_enable" in
rc=$(for dir in $daily_clean_tmps_dirs
do
[ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && {
find -d . -type f $args -delete $print
find -d . ! -name . -type d $dargs -delete $print
find -x -d . -type f $args -delete $print
find -x -d . ! -name . -type d $dargs -delete $print
} | sed "s,^\\., $dir,"
done | tee /dev/stderr | wc -l)
[ -z "$print" ] && rc=0