summaryrefslogtreecommitdiffstats
path: root/adduser/rmuser.sh
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-07-30 18:37:21 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-07-30 18:37:21 +0000
commit9eeff78f2b54bf8f0329ab99d434e7bbe94bf071 (patch)
tree99424c2c13b952f3cfd49c0097a5009bd241b7ad /adduser/rmuser.sh
parent27d1f2fdfd1933e2cfa1606d459fc44db28f379c (diff)
downloadpw-darwin-9eeff78f2b54bf8f0329ab99d434e7bbe94bf071.tar.gz
pw-darwin-9eeff78f2b54bf8f0329ab99d434e7bbe94bf071.tar.zst
pw-darwin-9eeff78f2b54bf8f0329ab99d434e7bbe94bf071.zip
The original adduser/rmuser scripts in Perl used to modify the PATH
setting. When the scripts were converted to Bourne shell, this was removed. The adduser script was changed to use an explicit path for the pw(8) command so that /usr/sbin did not have to be in the user's PATH. The rmuser script continued to assume that /usr/sbin was in the user's path, however. This fixes the rmuser script to use an explicit path for pw(8) similar to adduser. MFC after: 2 weeks
Diffstat (limited to 'adduser/rmuser.sh')
-rw-r--r--adduser/rmuser.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/adduser/rmuser.sh b/adduser/rmuser.sh
index d263217..6b09225 100644
--- a/adduser/rmuser.sh
+++ b/adduser/rmuser.sh
@@ -33,6 +33,7 @@ MAILSPOOL="/var/mail"
SIGKILL="-KILL"
TEMPDIRS="/tmp /var/tmp"
THISCMD=`/usr/bin/basename $0`
+PWCMD="${PWCMD:-/usr/sbin/pw}"
# err msg
# Display $msg on stderr.
@@ -178,7 +179,7 @@ rm_user() {
}
! verbose && echo -n " passwd"
verbose && echo -n " from the system:"
- pw userdel -n $login $pw_rswitch
+ ${PWCMD} userdel -n $login $pw_rswitch
verbose && echo ' Done.'
}
@@ -343,7 +344,7 @@ for _user in $userlist ; do
fi
# Disable any further attempts to log into this account
- pw 2>/dev/null lock $_user
+ ${PWCMD} 2>/dev/null lock $_user
# Remove crontab, mail spool, etc. Then obliterate the user from
# the passwd and group database.