Date: Sat, 24 Dec 2005 23:20:05 GMT From: Peter Much <pmc@citylink.dinoex.sub.org> To: freebsd-rc@FreeBSD.org Subject: Re: conf/85363: syntax error in /etc/rc.d/devfs Message-ID: <200512242320.jBONK5W2087250@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/85363; it has been noted by GNATS. From: Peter Much <pmc@citylink.dinoex.sub.org> To: bug-followup@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512242320.jBONK5W2087250>