From owner-freebsd-hackers Thu Apr 27 0:43:38 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from dt051n0b.san.rr.com (dt051n0b.san.rr.com [204.210.32.11]) by hub.freebsd.org (Postfix) with ESMTP id B3E7937B5BD for ; Thu, 27 Apr 2000 00:43:35 -0700 (PDT) (envelope-from DougB@gorean.org) Received: from gorean.org (master [10.0.0.2]) by dt051n0b.san.rr.com (8.9.3/8.9.3) with ESMTP id AAA54514; Thu, 27 Apr 2000 00:43:23 -0700 (PDT) (envelope-from DougB@gorean.org) Message-ID: <3907EFA1.3D31D221@gorean.org> Date: Thu, 27 Apr 2000 00:43:29 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Neil Blakey-Milner Cc: Doug Barton , freebsd-hackers@freebsd.org, adrian@creative.net.au Subject: Re: Safe sourcing of rc files References: <38F17E7A.5892318A@gorean.org> <20000419165123.A59794@mithrandr.moria.org> <20000426223127.A20023@mithrandr.moria.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Neil Blakey-Milner wrote: > > 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. Please don't take this the wrong way, but commit what exactly? All you've described is an idea. Before anyone could even test your idea, you'd have to have much more concrete work to share. Have you done any actual testing of your concept? Do you have a patchset that others can test in varying conditions? I haven't commented further on your idea because without some solid implementation details it's impossible to discuss further. I think there are some holes in your concept of being able to redefine $rc_conf_files for one thing. Keep in mind that you have to source /etc/defaults/rc.conf first, then do whatever gymnastics you want to do with the other files. Can you demonstrate a mechanism that accomplishes this? As for comments in general, I do not see the value in making a seperate script file out of the bit that does the sourcing of the rc.conf files for the current implementation. I have heard several vague plans for some future uses of rc.conf, but those are hard to evaluate in the absence of detail as well. :) Doug To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message