From owner-freebsd-current@FreeBSD.ORG Sun Oct 3 09:19:27 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC6F416A4CE for ; Sun, 3 Oct 2004 09:19:27 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A444B43D53 for ; Sun, 3 Oct 2004 09:19:25 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.144] (HELO rogue.acs.lan) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP id 58891421; Sun, 03 Oct 2004 12:12:14 +0300 Received: by rogue.acs.lan (Postfix, from userid 1000) id D17DFB830; Sun, 3 Oct 2004 12:19:13 +0300 (EAT) Date: Sun, 3 Oct 2004 12:19:13 +0300 From: Mike Makonnen To: Doug White Message-ID: <20041003091913.GA1720@rogue.acs.lan> References: <20041002151123.J37762@carver.gumbysoft.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <20041002151123.J37762@carver.gumbysoft.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/6.0-CURRENT (i386) cc: current@freebsd.org Subject: Re: IFS pollution from localpkg X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 09:19:27 -0000 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 02, 2004 at 03:18:52PM -0700, Doug White wrote: > I guess no one changes the script_name_sep rc.conf variable to something > more dangerous than the default space... > > Anyway, I think we should investigate running local package scripts with > IFS (and other hazardous variables) stripped using env. Or perhaps not > play with IFS at all unless the user sets script_name_sep, and change the > default accordingly. > > I'm not sure why this doesn't mess more stuff up :-/ It looks like this particular bug has been around since that feature was introduced in rev. 1.272 way back in July 2001. I guess people don't use it that much. Does the following patch fix your problem? Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=diff Index: etc/rc.d/localpkg =================================================================== RCS file: /home/ncvs/src/etc/rc.d/localpkg,v retrieving revision 1.4 diff -u -r1.4 localpkg --- etc/rc.d/localpkg 28 Jul 2004 00:09:18 -0000 1.4 +++ etc/rc.d/localpkg 3 Oct 2004 09:12:25 -0000 @@ -40,7 +40,7 @@ if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 - ${script} start) + /bin/env IFS="${script_save_sep}" ${script} start) elif [ -f "${script}" -o -L "${script}" ]; then echo -n " (skipping ${script##*/}, not executable)" fi @@ -77,7 +77,7 @@ if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 - ${script} stop) + /bin/env IFS="${script_save_sep}" ${script} stop) fi done IFS="${script_save_sep}" --X1bOJ3K7DJ5YkBrT--