From owner-freebsd-current@FreeBSD.ORG Sat Oct 2 22:18:52 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 7DC6A16A4CE for ; Sat, 2 Oct 2004 22:18:52 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BB9543D2D for ; Sat, 2 Oct 2004 22:18:52 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 5484772DD4; Sat, 2 Oct 2004 15:18:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 4F2AF72DCB for ; Sat, 2 Oct 2004 15:18:52 -0700 (PDT) Date: Sat, 2 Oct 2004 15:18:52 -0700 (PDT) From: Doug White To: current@freebsd.org Message-ID: <20041002151123.J37762@carver.gumbysoft.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: 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: Sat, 02 Oct 2004 22:18:52 -0000 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 :-/ -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org