diff options
author | David Goulet <dgoulet@torproject.org> | 2017-04-25 15:14:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-09 10:30:52 -0400 |
commit | b867295ffd75c4ab930a8e59a1302ffd2b289bc7 (patch) | |
tree | 767573845086fc3a57d35133bea1bdfe39f81c27 /src/or/config.c | |
parent | 7f95ef6e66754112e7a84e4da83ed754b1dc9626 (diff) | |
download | tor-b867295ffd75c4ab930a8e59a1302ffd2b289bc7.tar.gz tor-b867295ffd75c4ab930a8e59a1302ffd2b289bc7.zip |
config: Parse ports at the start of options_validate()
There was a bug that got exposed with the removal of ORListenAddress. Within
server_mode(), we now only check ORPort_set which is set in parse_ports().
However, options_validate() is using server_mode() at the start to check if we
need to look at the uname but then the ORPort_set is unset at that point
because the port parsing was done just after. This commit fixes that.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/config.c b/src/or/config.c index c8b6e5beb1..1b40561db0 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2947,6 +2947,10 @@ options_validate(or_options_t *old_options, or_options_t *options, tor_assert(msg); *msg = NULL; + if (parse_ports(options, 1, msg, &n_ports, + &world_writable_control_socket) < 0) + return -1; + /* Set UseEntryGuards from the configured value, before we check it below. * We change UseEntryGuards when it's incompatible with other options, * but leave UseEntryGuards_option with the original value. @@ -2965,10 +2969,6 @@ options_validate(or_options_t *old_options, or_options_t *options, "for details.", uname); } - if (parse_ports(options, 1, msg, &n_ports, - &world_writable_control_socket) < 0) - return -1; - if (parse_outbound_addresses(options, 1, msg) < 0) return -1; |