Correctly handle files with IFS characters (spaces) in their names when

cleaning up temporary files.

Submitted by:	Mike Makonnen <mtm@identd.net>
Approved by:	re
This commit is contained in:
tjr 2002-12-09 02:22:50 +00:00
parent 4e69cf34a4
commit c8d9479442

View File

@ -33,7 +33,7 @@ ATJOBDIR="/var/at/jobs"
CRONJOBDIR="/var/cron/tabs"
MAILSPOOL="/var/mail"
SIGKILL="-KILL"
TEMPDIRS="/tmp /var/tmp /var/tmp/vi.recover"
TEMPDIRS="/tmp /var/tmp"
THISCMD=`/usr/bin/basename $0`
# err msg
@ -57,12 +57,8 @@ rm_files() {
continue
fi
echo -n "Removing files owned by ($login) in $_dir:"
filecount=0
_ownedfiles=`find 2>/dev/null $_dir -maxdepth 1 -user $login -print`
for _file in $_ownedfiles ; do
rm -fd $_file
filecount=`expr $filecount + 1`
done
filecount=`find 2>/dev/null "$_dir" -user "$login" -delete -print | \
wc -l | sed 's/ *//'`
echo " $filecount removed."
done
}