Since id(1) is in /usr, it may not be available until after filesystem

mounting.

Reminded by: bde
This commit is contained in:
Mike Makonnen 2004-01-22 08:46:03 +00:00
parent bbe8270c50
commit a039fbbf8c

View File

@ -47,6 +47,8 @@ SYSCTL="/sbin/sysctl"
SYSCTL_N="${SYSCTL} -n"
CMD_OSTYPE="${SYSCTL_N} kern.ostype"
OSTYPE=`${CMD_OSTYPE}`
ID="/usr/bin/id"
IDCMD="if [ -x $ID ]; then $ID -un; fi"
case ${OSTYPE} in
FreeBSD)
@ -504,7 +506,7 @@ run_rc_command()
_group=\$${name}_group _groups=\$${name}_groups
if [ -n "$_user" ]; then # unset $_user if running as that user
if [ "$_user" = "$(id -un)" ]; then
if [ "$_user" = "$(eval $IDCMD)" ]; then
unset _user
fi
fi