summaryrefslogtreecommitdiff
path: root/src/lib/confmgt
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-11-07 09:25:56 -0500
committerNick Mathewson <nickm@torproject.org>2019-11-07 11:01:25 -0500
commita08969e460af2834c037761e96e2c1e9fedf5b14 (patch)
treeda9f5a0402470aba73084635fee351eaa1124e39 /src/lib/confmgt
parent36af84ba5062b26d2ede647627e87f6ae74796cf (diff)
downloadtor-a08969e460af2834c037761e96e2c1e9fedf5b14.tar.gz
tor-a08969e460af2834c037761e96e2c1e9fedf5b14.zip
Refactor "OBSOLETE" type
It no longer warns, and is now defined in terms of an "IGNORE" type. (The "IGNORE" type is the same as "OBSOLETE", except that it is not reported as obsolete. It should be useful for disabled modules.) Closes ticket 32404.
Diffstat (limited to 'src/lib/confmgt')
-rw-r--r--src/lib/confmgt/type_defs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/confmgt/type_defs.c b/src/lib/confmgt/type_defs.c
index 0bf82ee934..7200218f74 100644
--- a/src/lib/confmgt/type_defs.c
+++ b/src/lib/confmgt/type_defs.c
@@ -682,17 +682,13 @@ static const var_type_fns_t linelist_s_fns = {
/////
// CONFIG_TYPE_ROUTERSET
//
-// XXXX This type is not implemented here, since routerset_t is not available
// XXXX to this module.
/////
/////
-// CONFIG_TYPE_OBSOLETE
+// CONFIG_TYPE_IGNORE
//
-// Used to indicate an obsolete option.
-//
-// XXXX This is not a type, and should be handled at a higher level of
-// XXXX abstraction.
+// Used to indicate an option that cannot be stored or encoded.
/////
static int
@@ -703,8 +699,6 @@ ignore_parse(void *target, const char *value, char **errmsg,
(void)value;
(void)errmsg;
(void)params;
- // XXXX move this to a higher level, once such a level exists.
- log_warn(LD_GENERAL, "Skipping obsolete configuration option.");
return 0;
}
@@ -774,6 +768,10 @@ const var_type_def_t LINELIST_S_type_defn = {
const var_type_def_t LINELIST_V_type_defn = {
.name="Virtual", .fns=&linelist_v_fns,
.flags=CFLG_NOREPLACE|CFLG_NOSET };
+const var_type_def_t IGNORE_type_defn = {
+ .name="Ignored", .fns=&ignore_fns,
+ .flags=CFLG_NOCOPY|CFLG_NOCMP|CFLG_NODUMP|CFLG_NOSET,
+};
const var_type_def_t OBSOLETE_type_defn = {
.name="Obsolete", .fns=&ignore_fns,
.flags=CFLG_GROUP_OBSOLETE,
@@ -800,6 +798,7 @@ static const var_type_def_t *type_definitions_table[] = {
[CONFIG_TYPE_LINELIST] = &LINELIST_type_defn,
[CONFIG_TYPE_LINELIST_S] = &LINELIST_S_type_defn,
[CONFIG_TYPE_LINELIST_V] = &LINELIST_V_type_defn,
+ [CONFIG_TYPE_IGNORE] = &IGNORE_type_defn,
[CONFIG_TYPE_OBSOLETE] = &OBSOLETE_type_defn,
};