Opened 5 years ago

Closed 5 years ago

#15261 closed defect (not a bug)

torrc's SocksSocket breaks tor-service-defaults-torrc's SocksPort

Reported by: proper Owned by:
Priority: Medium Milestone: Tor: 0.2.6.x-final
Component: Core Tor/Tor Version: Tor: 0.2.6.4-rc
Severity: Keywords:
Cc: dgoulet, andrea, intrigeri, mcs, gk, proper, ioerror, rl1987, anon, yawning, nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Related:
#12585


Operating system:
Debian wheezy


Version:

Tor v0.2.6.4-rc (git-b7090ba4fb85d8ac) running on Linux with Libevent 2.0.19-stable, OpenSSL 1.0.1e and Zlib 1.2.7.

This is my /usr/share/tor/tor-service-defaults-torrc:

DataDirectory /var/lib/tor
PidFile /var/run/tor/tor.pid
RunAsDaemon 1
User debian-tor

ControlSocket /var/run/tor/control
ControlSocketsGroupWritable 1

CookieAuthentication 1
CookieAuthFileGroupReadable 1
CookieAuthFile /var/run/tor/control.authcookie

Log notice file /var/log/tor/log

## (A) not working
SocksPort 9102

All instances are defaults that come with Debian. Only SocksPort 9102 was added by me.


This is my very minimal /etc/tor/torrc to keep this report simple:

## (B) works
#SocksPort 9102

## (C)
SocksSocketsGroupWritable 1
## (D)
SocksPort unix:/var/run/tor/socket

Legend:

  • enabled -> commented in
  • disabled -> commented out

Result:

When (A) SocksPort 9102 is enabled, and (D) SocksPort unix:/var/run/tor/socket is disabled, then 127.0.0.1 9102 is reachable.

When (A) SocksPort 9102 is enabled, and (B) SocksPort 9102 is disabled, and (D) SocksPort unix:/var/run/tor/socket is enabled, then 127.0.0.1 9102 is unreachable.

When (A) and (B) SocksPort 9102 is enabled, and (D) SocksPort unix:/var/run/tor/socket is enabled, then 127.0.0.1 9102 is reachable.


Expected result:

If SocksPort 9102 is set in /usr/share/tor/tor-service-defaults-torrc and SocksPort unix:/var/run/tor/socket is set in /etc/tor/torrc, then the SocksSocket should not interfere with SocksPort 9102.

Child Tickets

Change History (2)

comment:1 Changed 5 years ago by nickm

Check out this part of the manpage:

By default, an option on the command line overrides an option found in the
configuration file, and an option in a configuration file overrides one in
the defaults file.

This rule is simple for options that take a single value, but it can become
complicated for options that are allowed to occur more than once: if you
specify four SOCKSPorts in your configuration file, and one more SOCKSPort on
the command line, the option on the command line will replace __all__ of the
SOCKSPorts in the configuration file.  If this isn't what you want, prefix
the option name with a plus sign, and it will be appended to the previous set
of options instead.

So to make sure that the SocksPort in the torrc does what you want, write it as +SocksPort .

comment:2 Changed 5 years ago by proper

Resolution: not a bug
Status: newclosed
Note: See TracTickets for help on using tickets.