From owner-freebsd-hackers Wed Apr 26 13:31:52 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ns1.sunesi.net (ns1.sunesi.net [196.15.192.194]) by hub.freebsd.org (Postfix) with ESMTP id 969A237B904 for ; Wed, 26 Apr 2000 13:31:47 -0700 (PDT) (envelope-from nbm@sunesi.net) Received: from nbm by ns1.sunesi.net with local (Exim 3.03 #1) id 12kYT1-0005FB-00; Wed, 26 Apr 2000 22:31:27 +0200 Date: Wed, 26 Apr 2000 22:31:27 +0200 From: Neil Blakey-Milner To: Doug Barton Cc: freebsd-hackers@freebsd.org, adrian@creative.net.au Subject: Re: Safe sourcing of rc files Message-ID: <20000426223127.A20023@mithrandr.moria.org> References: <38F17E7A.5892318A@gorean.org> <20000419165123.A59794@mithrandr.moria.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000419165123.A59794@mithrandr.moria.org>; from nbm@mithrandr.moria.org on Wed, Apr 19, 2000 at 04:51:24PM +0200 Organization: Sunesi Clinical Systems X-Operating-System: FreeBSD 3.3-RELEASE i386 X-URL: http://rucus.ru.ac.za/~nbm/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed 2000-04-19 (16:51), Neil Blakey-Milner wrote: > I have another idea: We make a sh script named "rcsource" or whatever, > which we source when we want to have the rc environment, stealing your > code maliciously: > > /-- > sourcercs_sourced_files= > sourcercs ( ) { > local rc_conf_files > for i in $*; do > case "${sourcercs_sourced_files}" in > *:$i:*) > ;; > *) > sourcercs_sourced_files="${sourcercs_sourced_files}:$i:" > echo $i > if [ -r $i ]; then > . $i > sourcercs ${rc_conf_files} > fi > ;; > esac > done > } > sourcercs /etc/defaults/rc.conf > \-- Unless someone comes back with negative feedback, I'll be pushing for a commit for this (and all that depend on this change) on the weekend. Consider this a request for review and comment. Neil -- Neil Blakey-Milner Hacker In Chief, Sunesi Clinical Systems nbm@mithrandr.moria.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message