Skip to content
Snippets Groups Projects
Commit 4dd8f613 authored by Kathleen Brade's avatar Kathleen Brade
Browse files

Bug 20185: Avoid using Unix domain socket paths that are too long

Enforce a maximum length of 100 for Unix domain socket paths.

If $XDG_RUNTIME_DIR is set, create a unique subdirectory within that
  directory and place the control and SOCKS sockets there if the
  resulting paths will not be too long
else if the length of <tor-data-dir>/control.socket is less than 100
  characters, place both sockets under <tor-data-dir> (this is compatible
  with the Tor Browser 6.5a3 behavior)
else create a unique subdirectory under /tmp and place the sockets there.

The unique subdirectory that is created under $XDG_RUNTIME_DIR or /tmp
will be named Tor if no such directory exists; otherwise, an integer
suffix will be appended until a new, uniquely named directory is found
such as /tmp/Tor-1.

Also, when starting tor, only include a SocksPort argument if a Unix
domain socket path or a host/port is available.
parent c12d5647
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment