]> git.ipfire.org Git - thirdparty/squid.git/commit
Reject config with unknown directives before committing to it (#1897)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 28 Aug 2024 21:01:15 +0000 (21:01 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 31 Aug 2024 20:07:10 +0000 (20:07 +0000)
commited8b040461bc6916d2acc96c2e6dd86c89de0110
treecde14dc0a4cf66fb3f915895bf95189c77636f36
parent060e9c03d1434e266c85101a677f6e49ba910b32
Reject config with unknown directives before committing to it (#1897)

Ideally, we want to reject configurations with unknown directives before
applying any configuration changes that correspond to known directives,
but current apply-as-you-parse architecture makes that impractical.
Pending smooth reconfiguration refactoring will make that possible, but
we can make a step towards that ideal future now.

Rejecting bad configurations before calling configDoConfigure() reduces
the set of configuration errors that Squid can detect in one execution
(because configDoConfigure() error-checking code is not reached), but
that small reduction is a lesser evil compared to running
configDoConfigure() with a clearly broken config, especially when we are
going to kill Squid anyway. While many legacy parse_foo() functions do
apply significant changes before configDoConfigure(), we cannot easily
prevent that (for now). We can easily prevent configDoConfigure().
src/cache_cf.cc