|
@@ -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.");
|