diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-27 17:08:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-27 17:08:03 -0400 |
commit | c97072ef34c20fdf854444bb28446b53f67ba7bf (patch) | |
tree | 85efe9f94380c938a3842d843cbc93319d837f13 /src/or/config.c | |
parent | e3859615429ec8d3939e21cd65fa07cc56bb5d0c (diff) | |
parent | 6c5b9ba6258c8e79be9f96a3ec377600d0066356 (diff) | |
download | tor-c97072ef34c20fdf854444bb28446b53f67ba7bf.tar.gz tor-c97072ef34c20fdf854444bb28446b53f67ba7bf.zip |
Merge branch 'bug1751_enabling' into maint-0.2.2
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index 8febe7a56b..d66f9136b7 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -327,7 +327,7 @@ static config_var_t _option_vars[] = { V(RecommendedClientVersions, LINELIST, NULL), V(RecommendedServerVersions, LINELIST, NULL), OBSOLETE("RedirectExit"), - V(RefuseUnknownExits, BOOL, "0"), + V(RefuseUnknownExits, STRING, "auto"), V(RejectPlaintextPorts, CSV, ""), V(RelayBandwidthBurst, MEMUNIT, "0"), V(RelayBandwidthRate, MEMUNIT, "0"), @@ -1231,6 +1231,18 @@ options_act(or_options_t *old_options) if (accounting_is_enabled(options)) configure_accounting(time(NULL)); + /* parse RefuseUnknownExits tristate */ + if (!strcmp(options->RefuseUnknownExits, "0")) + options->RefuseUnknownExits_ = 0; + else if (!strcmp(options->RefuseUnknownExits, "1")) + options->RefuseUnknownExits_ = 1; + else if (!strcmp(options->RefuseUnknownExits, "auto")) + options->RefuseUnknownExits_ = -1; + else { + /* Should have caught this in options_validate */ + return -1; + } + /* Change the cell EWMA settings */ cell_ewma_set_scale_factor(options, networkstatus_get_latest_consensus()); @@ -2997,6 +3009,12 @@ options_validate(or_options_t *old_options, or_options_t *options, REJECT("Failed to resolve/guess local address. See logs for details."); } + if (strcmp(options->RefuseUnknownExits, "0") && + strcmp(options->RefuseUnknownExits, "1") && + strcmp(options->RefuseUnknownExits, "auto")) { + REJECT("RefuseUnknownExits must be 0, 1, or auto"); + } + #ifndef MS_WINDOWS if (options->RunAsDaemon && torrc_fname && path_is_relative(torrc_fname)) REJECT("Can't use a relative path to torrc when RunAsDaemon is set."); |