Re: conf/85363: syntax error in /etc/rc.d/devfs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: conf/85363: syntax error in /etc/rc.d/devfs

Peter Much
The following reply was made to PR conf/85363; it has been noted by GNATS.

From: Peter Much <[hidden email]>
To: [hidden email]
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
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[hidden email]"