Re: IFS pollution from localpkg

From: Jose M Rodriguez <josemi_at_freebsd.jazztel.es>
Date: Wed, 6 Oct 2004 19:50:00 +0200
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


Received on Wed Oct 06 2004 - 15:50:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:15 UTC