From 9082a6db3f31c768ba862ed22f0824e99b4e0e22 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 15 Dec 2019 18:40:12 -0500 Subject: 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. --- src/lib/confmgt/confmgt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib/confmgt') 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); -- cgit v1.2.3-54-g00ecf