diff options
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 568baec703..6349445bc1 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -428,6 +428,7 @@ static config_var_t option_vars_[] = { V(V3AuthNIntervalsValid, UINT, "3"), V(V3AuthUseLegacyKey, BOOL, "0"), V(V3BandwidthsFile, FILENAME, NULL), + V(GuardfractionFile, FILENAME, NULL), VAR("VersioningAuthoritativeDirectory",BOOL,VersioningAuthoritativeDir, "0"), V(VirtualAddrNetworkIPv4, STRING, "127.192.0.0/10"), V(VirtualAddrNetworkIPv6, STRING, "[FE80::]/10"), @@ -2787,6 +2788,17 @@ options_validate(or_options_t *old_options, or_options_t *options, if (options->V3BandwidthsFile && !old_options) { dirserv_read_measured_bandwidths(options->V3BandwidthsFile, NULL); } + /* same for guardfraction file */ + if (options->GuardfractionFile && !old_options) { + file_status_t fs = file_status(options->GuardfractionFile); + if (fs == FN_EMPTY) { + REJECT("GuardfractionFile set but it's an empty file? Failing"); + } else if (fs != FN_FILE) { + REJECT("GuardfractionFile set but not a file? Failing"); + } + + dirserv_read_guardfraction_file(options->GuardfractionFile, NULL); + } } if (options->AuthoritativeDir && !options->DirPort_set) |