From owner-freebsd-hackers Wed Apr 19 10:14:18 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ewok.creative.net.au (fuzzy.aussie.com.au [203.30.44.82]) by hub.freebsd.org (Postfix) with SMTP id 3336B37BCE5 for ; Wed, 19 Apr 2000 10:14:13 -0700 (PDT) (envelope-from adrian@creative.net.au) Received: (qmail 81506 invoked by uid 1001); 19 Apr 2000 17:14:08 -0000 Date: Thu, 20 Apr 2000 01:14:08 +0800 From: Adrian Chadd To: Neil Blakey-Milner Cc: Doug Barton , freebsd-hackers@freebsd.org, adrian@creative.net.au Subject: Re: Safe sourcing of rc files Message-ID: <20000420011407.A81472@ewok.creative.net.au> References: <38F17E7A.5892318A@gorean.org> <20000419165123.A59794@mithrandr.moria.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <20000419165123.A59794@mithrandr.moria.org>; from Neil Blakey-Milner on Wed, Apr 19, 2000 at 04:51:24PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Apr 19, 2000, Neil Blakey-Milner wrote: > On Mon 2000-04-10 (00:10), Doug Barton wrote: > > +if [ -z "${sourcercs_defined}" ]; then > > + sourcercs_defined=yes > > + sourcercs ( ) { > > + local sourced_files > > + for i in ${rc_conf_files}; do > > + case "${sourced_files}" in > > + *:$i:*) > > + ;; > > + *) > > + sourced_files="${sourced_files}:$i:" > > + if [ -r $i ]; then > > + . $i > > + fi > > + ;; > > + esac > > + done > > + } > > +fi > > 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: Yup, thats what I proposed, and this code is basically what I had hacked at my end. :) Adrian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message