summaryrefslogtreecommitdiffstats
path: root/usr.sbin/adduser
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-12-09 02:22:50 +0000
committertjr <tjr@FreeBSD.org>2002-12-09 02:22:50 +0000
commitc8d94794427fb5d1f2f6d5ebaf123a54d0f59abc (patch)
tree3db2a72faf7480777e1df0c1c0ee5ee4a242c7a5 /usr.sbin/adduser
parent4e69cf34a4f45e0b5c740dd1600038beb7f74860 (diff)
downloadFreeBSD-src-c8d94794427fb5d1f2f6d5ebaf123a54d0f59abc.zip
FreeBSD-src-c8d94794427fb5d1f2f6d5ebaf123a54d0f59abc.tar.gz
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
Diffstat (limited to 'usr.sbin/adduser')
-rw-r--r--usr.sbin/adduser/rmuser.sh10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.sbin/adduser/rmuser.sh b/usr.sbin/adduser/rmuser.sh
index afc978c..67c9a83 100644
--- a/usr.sbin/adduser/rmuser.sh
+++ b/usr.sbin/adduser/rmuser.sh
@@ -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
}
OpenPOWER on IntegriCloud