summaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-06-03 12:52:34 +0200
committerSebastian Hahn <sebastian@torproject.org>2010-06-07 12:44:25 +0200
commit10fdb9ee0a1605050f2a91f84f88397881cfd83a (patch)
tree94185f68cf5f7a37cf92adae3d1d48f995f93d28 /src/or/buffers.c
parentfaf51fa52a7462e356927ac521ff4e6ee0703d7c (diff)
downloadtor-10fdb9ee0a1605050f2a91f84f88397881cfd83a.tar.gz
tor-10fdb9ee0a1605050f2a91f84f88397881cfd83a.zip
Add option to not warn when getting an IP instead of hostname
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 4dbd9a7a0b..970c1888c1 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1402,19 +1402,21 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
if (req->command != SOCKS_COMMAND_RESOLVE_PTR &&
!addressmap_have_mapping(req->address,0) &&
!have_warned_about_unsafe_socks) {
- log_warn(LD_APP,
- "Your application (using socks5 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", req->port,
- safe_socks ? " Rejecting." : "");
- /*have_warned_about_unsafe_socks = 1;*/
+ if (get_options()->WarnUnsafeSocks) {
+ log_warn(LD_APP,
+ "Your application (using socks5 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", req->port,
+ safe_socks ? " Rejecting." : "");
+ /*have_warned_about_unsafe_socks = 1;*/
/*(for now, warn every time)*/
control_event_client_status(LOG_WARN,
"DANGEROUS_SOCKS PROTOCOL=SOCKS5 ADDRESS=%s:%d",
req->address, req->port);
+ }
if (safe_socks)
return -1;
}
@@ -1516,7 +1518,8 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
if (socks4_prot != socks4a &&
!addressmap_have_mapping(tmpbuf,0) &&
!have_warned_about_unsafe_socks) {
- log_warn(LD_APP,
+ if (get_options()->WarnUnsafeSocks) {
+ log_warn(LD_APP,
"Your application (using socks4 to port %d) is giving Tor "
"only an IP address. Applications that do DNS resolves "
"themselves may leak information. Consider using Socks4A "
@@ -1524,10 +1527,12 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
"please see https://wiki.torproject.org/TheOnionRouter/"
"TorFAQ#SOCKSAndDNS.%s", req->port,
safe_socks ? " Rejecting." : "");
- /*have_warned_about_unsafe_socks = 1;*/ /*(for now, warn every time)*/
- control_event_client_status(LOG_WARN,
+ /*have_warned_about_unsafe_socks = 1;*/
+ /*(for now, warn every time)*/
+ control_event_client_status(LOG_WARN,
"DANGEROUS_SOCKS PROTOCOL=SOCKS4 ADDRESS=%s:%d",
tmpbuf, req->port);
+ }
if (safe_socks)
return -1;
}