diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-12-15 18:40:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-12-19 07:54:56 -0500 |
commit | 9082a6db3f31c768ba862ed22f0824e99b4e0e22 (patch) | |
tree | bd78488cd81b8f47c8984cd5c91cff49ad3fe2e0 /src/lib/confmgt/confmgt.c | |
parent | 5e2318165dba782f6daa6620b17e0fa1e72b4b11 (diff) | |
download | tor-9082a6db3f31c768ba862ed22f0824e99b4e0e22.tar.gz tor-9082a6db3f31c768ba862ed22f0824e99b4e0e22.zip |
Support a flag to indicate that a config var is disabled
Like "obsolete" variables, these variables produce a warning when
you try to set them, but the warning says that the relevant module
doesn't have support.
The confdecl macros now have a CONF_CONTEXT that you can define to
make all the modules in a given table disabled.
Diffstat (limited to 'src/lib/confmgt/confmgt.c')
-rw-r--r-- | src/lib/confmgt/confmgt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/confmgt/confmgt.c b/src/lib/confmgt/confmgt.c index c72efa847c..eaa4468d55 100644 --- a/src/lib/confmgt/confmgt.c +++ b/src/lib/confmgt/confmgt.c @@ -660,6 +660,9 @@ config_assign_value(const config_mgr_t *mgr, void *options, if (config_var_has_flag(var->cvar, CFLG_WARN_OBSOLETE)) { log_warn(LD_GENERAL, "Skipping obsolete configuration option \"%s\".", var->cvar->member.name); + } else if (config_var_has_flag(var->cvar, CFLG_WARN_DISABLED)) { + log_warn(LD_GENERAL, "This copy of Tor was built without support for " + "the option \"%s\". Skipping.", var->cvar->member.name); } return struct_var_kvassign(object, c, msg, &var->cvar->member); |