Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Apr 2000 10:29:14 -0500
From:      Richard Wackerbarth <rkw@dataplex.net>
To:        nbm@mithrandr.moria.org
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Safe sourcing of rc files
Message-ID:  <00041910291400.27893@nomad.dataplex.net>
In-Reply-To: <20000419165123.A59794@mithrandr.moria.org>
References:  <38F17E7A.5892318A@gorean.org> <20000419165123.A59794@mithrandr.moria.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00041910291400.27893>