summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2015-04-09 16:37:33 +1000
committerteor <teor2345@gmail.com>2015-04-23 00:16:04 +1000
commit027f73f70ef49859d5c6b7dc2a231b3f78dafd10 (patch)
treeb9434f8c1c3e94f2a39dac08debaec58800ea154
parent06939551f4c081c46a09864465a4989ca8bb2e42 (diff)
downloadtor-027f73f70ef49859d5c6b7dc2a231b3f78dafd10.tar.gz
tor-027f73f70ef49859d5c6b7dc2a231b3f78dafd10.zip
Disable default fallback directories when other directories are set
Only add the default fallback directories when the DirAuthorities, AlternateDirAuthority, and FallbackDir directory config options are set to their defaults. The default fallback directory list is currently empty, this fix will only change tor's behaviour when it has default fallback directories. Fixes bug 15642; bugfix on 90f6071d8dc0 in 0.2.4.7-alpha. Patch by "teor".
-rw-r--r--changes/bug-15642-default-fallback-default-dirs8
-rw-r--r--src/or/config.c13
2 files changed, 17 insertions, 4 deletions
diff --git a/changes/bug-15642-default-fallback-default-dirs b/changes/bug-15642-default-fallback-default-dirs
new file mode 100644
index 0000000000..3864cf373c
--- /dev/null
+++ b/changes/bug-15642-default-fallback-default-dirs
@@ -0,0 +1,8 @@
+ o Minor bugfixes (configuration):
+ - Only add the default fallback directories when the DirAuthorities,
+ AlternateDirAuthority, and FallbackDir directory config options
+ are set to their defaults.
+ The default fallback directory list is empty, this fix will only
+ change tor's behaviour when it has default fallback directories.
+ Fixes bug 15642; bugfix on 90f6071d8dc0 in 0.2.4.7-alpha.
+ Patch by "teor".
diff --git a/src/or/config.c b/src/or/config.c
index d7444d52f6..d48d57f733 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -985,17 +985,22 @@ consider_adding_dir_servers(const or_options_t *options,
if (!options->DirAuthorities) {
/* then we may want some of the defaults */
dirinfo_type_t type = NO_DIRINFO;
- if (!options->AlternateBridgeAuthority)
+ if (!options->AlternateBridgeAuthority) {
type |= BRIDGE_DIRINFO;
- if (!options->AlternateDirAuthority)
+ }
+ if (!options->AlternateDirAuthority) {
type |= V3_DIRINFO | EXTRAINFO_DIRINFO | MICRODESC_DIRINFO;
+ /* Only add the default fallback directories when the DirAuthorities,
+ * AlternateDirAuthority, and FallbackDir directory config options
+ * are set to their defaults. */
+ if (!options->FallbackDir)
+ add_default_fallback_dir_servers();
+ }
/* if type == NO_DIRINFO, we don't want to add any of the
* default authorities, because we've replaced them all */
if (type != NO_DIRINFO)
add_default_trusted_dir_authorities(type);
}
- if (!options->FallbackDir)
- add_default_fallback_dir_servers();
for (cl = options->DirAuthorities; cl; cl = cl->next)
if (parse_dir_authority_line(cl->value, NO_DIRINFO, 0)<0)