From owner-freebsd-hackers Wed Apr 19 8:29:29 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.ddg.com (eunuch.ddg.com [216.30.58.66]) by hub.freebsd.org (Postfix) with ESMTP id 645D837BCE1 for ; Wed, 19 Apr 2000 08:29:26 -0700 (PDT) (envelope-from rkw@dataplex.net) Received: from nomad.dataplex.net (24.28.73.209) by mail.ddg.com with SMTP (Eudora Internet Mail Server 2.1); Wed, 19 Apr 2000 10:29:15 -0500 From: Richard Wackerbarth To: nbm@mithrandr.moria.org Subject: Re: Safe sourcing of rc files Date: Wed, 19 Apr 2000 10:29:14 -0500 X-Mailer: KMail [version 1.1.40] Content-Type: text/plain Cc: freebsd-hackers@FreeBSD.ORG References: <38F17E7A.5892318A@gorean.org> <20000419165123.A59794@mithrandr.moria.org> In-Reply-To: <20000419165123.A59794@mithrandr.moria.org> MIME-Version: 1.0 Message-Id: <00041910291400.27893@nomad.dataplex.net> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 19 Apr 2000, 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, [snip] > One possible extension may be a specifier of a preprocessor for a file: > > preprocessor__etc_defaults_rc.conf='cpp' will be checked if sourcercs is > run on /etc/defaults/rc.conf, and it will be passed through cpp before > trying to understand it. This should be extensible enough to avoid the > need of sh-script to get a value for a variable. > > Any more ideas? I was in complete agreement with you until you got to the preprocessor. (I've previously advocated something similar) However, IMHO, even considering using cpp as a preprocessor will never fly. The configuration mechanism MUST be small and simple. cpp isn't even available when you start. (You only get things in /bin and /sbin, and cpp certainly has no place there) If you want a preprocessor, I suggest the sendmail approach where you write the definitions in some meta-language and preprocess that into simple sh definitions. That way, you don't need the preprocessor at run time. Besides, if people would learn the language, 'sh' is really quite powerful. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message