Bug #2641
closedsilent fail on misspelled option name
Description
When an incorrect option line of the form
foobar = 42
is included in the config file, no warning or error is given.
This is potentially dangerous as an option is silently ignored if the dot character is accidentally omitted or mistyped, e.g.:
$HTTP["url"] =~ "/dangerousstuff" {
url-access-deny = ( "" )
}
Expected Behaviour¶
As for an unrecognised command
foobar
or a non-existent name
foo.bar = 42
the described problem should lead to a warning, or better yet an error, to avoid silent failure in case of a typo.
It also violates the BNF given in the docs Docs_Configuration.
Is this simply a bug in the syntax checker or am I missing something?
I tested with 1.4.35
Updated by odoto about 10 years ago
darix wrote:
you are forgetting variables.
aren't variables handled by using "var" as the module, like so:
var.foobar = 42
?
Updated by stbuehler about 10 years ago
- Status changed from New to Wontfix
If a variable name doesn't contain a dot (".") lighttpd will prepend "var." to the name, and there are no "unused variable" warnings for "var.*" variables.
This probably wasn't the best choice, but changing it now is not really an option.
Updated by odoto about 10 years ago
I agree that the behaviour retrospectively doesn't seem like an ideal choice, but I can totally see how it would be quite problematic to change ;)
May I suggest to add a note about this to the documentation though?
Also available in: Atom