Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2003 11:57:31 -0400
From:      Mike Makonnen <mtm@identd.net>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/etc/rc.d hostname ipfilter ipsec netif ttys
Message-ID:  <20030731155730.GA23825@kokeb.ambesa.net>
In-Reply-To: <20030731191020.Q642@gamplex.bde.org>
References:  <200307301853.h6UIrxY4063377@repoman.freebsd.org> <20030731191020.Q642@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Jul 31, 2003 at 07:17:19PM +1000, Bruce Evans wrote:
> On Wed, 30 Jul 2003, Mike Makonnen wrote:
> 
> > mtm         2003/07/30 11:53:59 PDT
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     etc/rc.d             hostname ipfilter ipsec netif ttys
> >   Log:
> >   tty whacking should occur early, but not so early that the
> >   required commands are not on a mounted file system.
> >
> >   Noticed by: bde
> 
> 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 ?

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm@identd.net | D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9
mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon!

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="id.diff"

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

--qDbXVdCdHGoSgWSk--



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