Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 2003 23:07:15 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mike Makonnen <mtm@identd.net>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/etc/rc.d hostname ipfilter ipsec netif ttys
Message-ID:  <20030802223548.O612@gamplex.bde.org>
In-Reply-To: <20030731155730.GA23825@kokeb.ambesa.net>
References:  <200307301853.h6UIrxY4063377@repoman.freebsd.org> <20030731155730.GA23825@kokeb.ambesa.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 31 Jul 2003, Mike Makonnen wrote:

> On Thu, Jul 31, 2003 at 07:17:19PM +1000, Bruce Evans wrote:
> > Thanks.  Now `id' is the only command used before its file system
> > is mounted on my nfs clients.  id seems to be used only in rc.subr.
>
> What do you think of the following ?

I tested that it works for me.

% Index: etc/rc.subr
% ===================================================================
% RCS file: /home/ncvs/src/etc/rc.subr,v
% retrieving revision 1.14
% diff -u -r1.14 rc.subr
% --- etc/rc.subr	24 Jul 2003 18:17:21 -0000	1.14
% +++ etc/rc.subr	31 Jul 2003 15:54:58 -0000
% @@ -47,6 +47,8 @@
%  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 @@
%  	    _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

I would put all the logic inline (id is only used once...).

${name}_user is documented to require /usr mounted.  Apparently something
is breaking the rules by setting it early.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030802223548.O612>