Check whether a client port is a Unix socket before using its IP addr

Bugfix on commit c1ac0695d5, not yet in any
release.  Fixes bug 4091; bug reported by SwissTorHelp.
This commit is contained in:
Robert Ransom 2011-10-20 03:17:23 -07:00
parent 0a083b0188
commit 9df99bbb91

View File

@ -5128,7 +5128,9 @@ static void
warn_nonlocal_client_ports(const smartlist_t *ports, const char *portname)
{
SMARTLIST_FOREACH_BEGIN(ports, const port_cfg_t *, port) {
if (!tor_addr_is_internal(&port->addr, 1)) {
if (port->is_unix_addr) {
/* Unix sockets aren't accessible over a network. */
} else if (!tor_addr_is_internal(&port->addr, 1)) {
log_warn(LD_CONFIG, "You specified a public address for %sPort. "
"Other people on the Internet might find your computer and "
"use it as an open proxy. Please don't allow this unless you "