From 28344b74babe762089ff702450ad2b418ae25b33 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 22 Jun 2017 00:28:31 +0000 Subject: [PATCH 1/2] config: Fix duplicate error message for nonlocal SocksPorts. If `validate_only` is true, then just validate the configuration without warning about it. This way, we only emit warnings when the listener is actually opened. (Otherwise, every time we parse the config we will might re-warn and we would need to keep state; whereas the listeners are only opened once.) * FIXES #4019. --- src/or/config.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/or/config.c b/src/or/config.c index 7d2ebbdd03..a1bd835220 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -6251,8 +6251,9 @@ port_cfg_free(port_cfg_t *port) /** Warn for every port in ports of type listener_type that is * on a publicly routable address. */ static void -warn_nonlocal_client_ports(const smartlist_t *ports, const char *portname, - int listener_type) +warn_nonlocal_client_ports(const smartlist_t *ports, + const char *portname, + const int listener_type) { SMARTLIST_FOREACH_BEGIN(ports, const port_cfg_t *, port) { if (port->type != listener_type) @@ -6936,7 +6937,8 @@ parse_ports(or_options_t *options, int validate_only, options->SocksPort_lines, "Socks", CONN_TYPE_AP_LISTENER, "127.0.0.1", 9050, - CL_PORT_WARN_NONLOCAL|CL_PORT_TAKES_HOSTNAMES|gw_flag) < 0) { + ((validate_only ? 0 : CL_PORT_WARN_NONLOCAL) + | CL_PORT_TAKES_HOSTNAMES | gw_flag)) < 0) { *msg = tor_strdup("Invalid SocksPort configuration"); goto err; } From 424c4586df8edf33d249f3bc1614f07e293b6fe0 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Fri, 23 Jun 2017 18:31:16 +0000 Subject: [PATCH 2/2] Add changes file for bug4019. --- changes/bug4019 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changes/bug4019 diff --git a/changes/bug4019 b/changes/bug4019 new file mode 100644 index 0000000000..fef736ff66 --- /dev/null +++ b/changes/bug4019 @@ -0,0 +1,4 @@ + o Minor bugfixes (logging): + - Remove duplicate log messages regarding opening non-local SocksPorts + upon parsing config and opening listeners at startup. Fixes bug 4019; + bugfix on tor-0.2.3.3-alpha.