conf/85363: syntax error in /etc/rc.d/devfs
Peter Much
pmc at citylink.dinoex.sub.org
Sat Dec 24 15:20:06 PST 2005
The following reply was made to PR conf/85363; it has been noted by GNATS.
From: Peter Much <pmc at citylink.dinoex.sub.org>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: conf/85363: syntax error in /etc/rc.d/devfs
Date: Sat, 24 Dec 2005 23:58:10 +0100
Now I found time to analyze this thoroughly.
I found that I have made a mistake. It just does not work to name a
ruleset by its NUMBER in rc.conf, instead one must always name it by
its NAME. (And, btw, that name must not begin with a number!)
Now, ideally, if one mentions the number instead of the name in rc.conf,
the code should behave as if a nonexistent ruleset was mentioned -
i.e. do nothing or raise an error.
Practically it does behave undefined, that is, wrong rulesets will
silently be applied.
But, overall, this is one of the implicit weaknesses of shell
scripting, when strings that are to be freely defined by the installer
are used as variable names.
And as the thing is designed as it is, there is no easy solution
to make it better.
An improvement will be the usage of {} delimiters. A construct
like "eval rs=\$$1" will behave less undefined if it is written as
"eval rs=\${$1}". There is a couple of places in rc.subr where this
would be argueable.
PMc
More information about the freebsd-rc
mailing list