Date: Wed, 6 Oct 2004 19:50:00 +0200 From: Jose M Rodriguez <josemi@freebsd.jazztel.es> To: freebsd-current@freebsd.org Cc: current@freebsd.org Subject: Re: IFS pollution from localpkg Message-ID: <200410061950.01434.josemi@freebsd.jazztel.es> In-Reply-To: <20041002151123.J37762@carver.gumbysoft.com> References: <20041002151123.J37762@carver.gumbysoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_JBDZBJP6ttllhYz Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 03 October 2004 00:18, Doug White wrote: > Hey folks, > > I ran into a build problem on my amd64 box today, where ar was being > fed output from a backtick operation but the carriage returns weren't > being converted to spaces. After some gdb digging in sh, I found > that the reason for the problem was that IFS=" " was set in my shell > environment. > > Since I don't touch IFS in any of my shell dotfiles, and the system > shellfiles don't either, I think this may be coming from > /etc/rc.d/localpkg. It sets IFS just before calling the start script > for scripts in /usr/local/etc/rc.d/ and friends. I start kdm out of a > script there, and it probably inherits the environment, and it > propagates all the way up to my Konsole session where I was trying to > build world. > > Unsetting IFS made the buildworld continue past the prior point of > trouble. > > I'm not quite sure why this is only a problem on the amd64 machine -- > it was running a September 23 world, but is running KDE 3.3 instead > of KDE 3.2 like the other machines I have here. The system was also > built from scratch about that time, and the others have been around > for 6 months or more. > > 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 :-/ If you are using KDE-3.3.0 an csh, this maybe your problem: http://www.freebsd.org/cgi/query-pr.cgi?pr=72388 Attached a simple patch agains Xsession -- josemi --Boundary-00=_JBDZBJP6ttllhYz Content-Type: text/x-diff; charset="iso-8859-1"; name="patch-Xsession" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-Xsession" --- /usr/local/share/config/kdm/Xsession Sun Oct 3 23:37:47 2004 +++ /etc//X11/xdm/Xsession Wed Oct 6 18:14:49 2004 @@ -30,7 +30,7 @@ # [t]cshrc is always sourced automatically. # Note that sourcing csh.login after .cshrc is non-standard. set -a - eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login > /dev/null; if (-f ~/.login) source ~/.login > /dev/null; /bin/sh -c set | egrep -v "^(BASH_VERSINFO|EUID|PPID|UID|GROUPS|SHELLOPTS|_)="'` + eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login >& /dev/null; if (-f ~/.login) source ~/.login >& /dev/null; /usr/bin/env | egrep -v "^(TERM|SHLVL)="'` set +a ;; *) # Plain sh, ksh, and anything we don't know. --Boundary-00=_JBDZBJP6ttllhYz--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410061950.01434.josemi>