From owner-cvs-src@FreeBSD.ORG Sat Aug 2 06:07:24 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3E1037B401; Sat, 2 Aug 2003 06:07:24 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17C2243FBF; Sat, 2 Aug 2003 06:07:23 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id XAA03855; Sat, 2 Aug 2003 23:07:16 +1000 Date: Sat, 2 Aug 2003 23:07:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Mike Makonnen In-Reply-To: <20030731155730.GA23825@kokeb.ambesa.net> Message-ID: <20030802223548.O612@gamplex.bde.org> References: <200307301853.h6UIrxY4063377@repoman.freebsd.org> <20030731155730.GA23825@kokeb.ambesa.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/etc/rc.d hostname ipfilter ipsec netif ttys X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2003 13:07:25 -0000 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