aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-27 17:52:20 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-27 17:52:20 -0400
commitaf7fab020accd31f95ba2037ccd25c65e3290571 (patch)
treeece006ac592b5d153e173332d6489acc22f98058 /src/or/config.c
parent5c83c06c985d314f31c72d3fb5a29c1c2f396f66 (diff)
parent8df3a909466217d6738d6fe4f7555f569b2a4cb7 (diff)
downloadtor-af7fab020accd31f95ba2037ccd25c65e3290571.tar.gz
tor-af7fab020accd31f95ba2037ccd25c65e3290571.zip
Merge remote branch 'origin/maint-0.2.2'
Conflicts: src/or/config.c
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index fa2eb73beb..6d8addeb2d 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"),
@@ -1242,6 +1242,18 @@ options_act(or_options_t *old_options)
connection_bucket_init();
#endif
+ /* 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());
@@ -3008,6 +3020,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.");