|
@@ -1505,22 +1505,19 @@ log_unsafe_socks_warning(int socks_protocol, const char *address,
|
|
|
static ratelim_t socks_ratelim = RATELIM_INIT(SOCKS_WARN_INTERVAL);
|
|
|
|
|
|
const or_options_t *options = get_options();
|
|
|
- char *m = NULL;
|
|
|
if (! options->WarnUnsafeSocks)
|
|
|
return;
|
|
|
- if (safe_socks || (m = rate_limit_log(&socks_ratelim, approx_time()))) {
|
|
|
- log_warn(LD_APP,
|
|
|
+ if (safe_socks) {
|
|
|
+ log_fn_ratelim(&socks_ratelim, LOG_WARN, LD_APP,
|
|
|
"Your application (using socks%d to port %d) is giving "
|
|
|
"Tor only an IP address. Applications that do DNS resolves "
|
|
|
"themselves may leak information. Consider using Socks4A "
|
|
|
"(e.g. via privoxy or socat) instead. For more information, "
|
|
|
"please see https://wiki.torproject.org/TheOnionRouter/"
|
|
|
- "TorFAQ#SOCKSAndDNS.%s%s",
|
|
|
+ "TorFAQ#SOCKSAndDNS.%s",
|
|
|
socks_protocol,
|
|
|
(int)port,
|
|
|
- safe_socks ? " Rejecting." : "",
|
|
|
- m ? m : "");
|
|
|
- tor_free(m);
|
|
|
+ safe_socks ? " Rejecting." : "");
|
|
|
}
|
|
|
control_event_client_status(LOG_WARN,
|
|
|
"DANGEROUS_SOCKS PROTOCOL=SOCKS%d ADDRESS=%s:%d",
|