aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-09 10:55:09 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-09 10:55:09 -0400
commite5f9f287ced36e18241e250d4b63603b9c4f006f (patch)
tree6577917d3432883bf7c43bb6a2e615a006fbce8c /src/or/config.c
parentcc5571e1f1e4d61d584fe20959b686d798bb7691 (diff)
parent31bf8f26907945b8f26a7543e42ce0e92dd4918f (diff)
downloadtor-e5f9f287ced36e18241e250d4b63603b9c4f006f.tar.gz
tor-e5f9f287ced36e18241e250d4b63603b9c4f006f.zip
Merge remote-tracking branch 'teor/bug-13163-AlternateAuthorities-type-handling-fixed'
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 3b37a123af..5555a2eb3b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -818,7 +818,9 @@ escaped_safe_str(const char *address)
}
/** Add the default directory authorities directly into the trusted dir list,
- * but only add them insofar as they share bits with <b>type</b>. */
+ * but only add them insofar as they share bits with <b>type</b>.
+ * Each authority's bits are restricted to the bits shared with <b>type</b>.
+ * If <b>type</b> is ALL_DIRINFO or NO_DIRINFO (zero), add all authorities. */
static void
add_default_trusted_dir_authorities(dirinfo_type_t type)
{
@@ -960,7 +962,10 @@ consider_adding_dir_servers(const or_options_t *options,
type |= BRIDGE_DIRINFO;
if (!options->AlternateDirAuthority)
type |= V3_DIRINFO | EXTRAINFO_DIRINFO | MICRODESC_DIRINFO;
- add_default_trusted_dir_authorities(type);
+ /* 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();
@@ -5192,8 +5197,9 @@ parse_server_transport_line(const or_options_t *options,
/** Read the contents of a DirAuthority line from <b>line</b>. If
* <b>validate_only</b> is 0, and the line is well-formed, and it
* shares any bits with <b>required_type</b> or <b>required_type</b>
- * is 0, then add the dirserver described in the line (minus whatever
- * bits it's missing) as a valid authority. Return 0 on success,
+ * is NO_DIRINFO (zero), then add the dirserver described in the line
+ * (minus whatever bits it's missing) as a valid authority.
+ * Return 0 on success or filtering out by type,
* or -1 if the line isn't well-formed or if we can't add it. */
static int
parse_dir_authority_line(const char *line, dirinfo_type_t required_type,