Since id(1) is in /usr, it may not be available until after filesystem
mounting. Reminded by: bde
This commit is contained in:
parent
e92e448982
commit
c26bf60f1e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user