[tor-bugs] #29144 [Core Tor/Tor]: Log the correct "auto" port number for listening sockets

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jan 21 19:07:42 UTC 2019


#29144: Log the correct "auto" port number for listening sockets
--------------------+------------------------------
 Reporter:  kjak    |          Owner:  (none)
     Type:  defect  |         Status:  new
 Priority:  Medium  |      Component:  Core Tor/Tor
  Version:          |       Severity:  Normal
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
 Reviewer:          |        Sponsor:
--------------------+------------------------------
 When `auto` is used for the port number for a listening socket, the
 message that gets logged after opening the socket incorrectly says port 0
 instead of the actual port being used.

 A contrived config like this

 {{{
 ControlPort auto
 SocksPort 127.0.0.1:auto
 ORPort 127.0.0.1:auto
 ORPort [::1]:auto
 }}}

 gives log messages like this


   Jan 21 12:38:05.741 [notice] Opening Socks listener on 127.0.0.1:0
   Jan 21 12:38:05.741 [notice] Socks listener listening on port 22840.
   '''Jan 21 12:38:05.741 [notice] Opened Socks listener on 127.0.0.1:0'''
   Jan 21 12:38:05.741 [notice] Opening Control listener on 127.0.0.1:0
   Jan 21 12:38:05.741 [notice] Control listener listening on port 14414.
   '''Jan 21 12:38:05.741 [notice] Opened Control listener on
 127.0.0.1:0'''
   Jan 21 12:38:05.741 [notice] Opening OR listener on 127.0.0.1:0
   Jan 21 12:38:05.741 [notice] OR listener listening on port 19719.
   '''Jan 21 12:38:05.741 [notice] Opened OR listener on 127.0.0.1:0'''
   Jan 21 12:38:05.741 [notice] Opening OR listener on [::1]:0
   Jan 21 12:38:05.742 [notice] OR listener listening on port 4298.
   '''Jan 21 12:38:05.742 [notice] Opened OR listener on [::1]:0'''

 An upcoming PR will fix this so that the log messages will have the actual
 port numbers like this

   Jan 21 12:38:57.709 [notice] Opening Socks listener on 127.0.0.1:0
   Jan 21 12:38:57.709 [notice] Socks listener listening on port 5236.
   '''Jan 21 12:38:57.709 [notice] Opened Socks listener on
 127.0.0.1:5236'''
   Jan 21 12:38:57.709 [notice] Opening Control listener on 127.0.0.1:0
   Jan 21 12:38:57.709 [notice] Control listener listening on port 14584.
   '''Jan 21 12:38:57.709 [notice] Opened Control listener on
 127.0.0.1:14584'''
   Jan 21 12:38:57.709 [notice] Opening OR listener on 127.0.0.1:0
   Jan 21 12:38:57.709 [notice] OR listener listening on port 15220.
   '''Jan 21 12:38:57.709 [notice] Opened OR listener on 127.0.0.1:15220'''
   Jan 21 12:38:57.709 [notice] Opening OR listener on [::1]:0
   Jan 21 12:38:57.709 [notice] OR listener listening on port 36901.
   '''Jan 21 12:38:57.709 [notice] Opened OR listener on [::1]:36901'''

 This was introduced by commit 27c868eff19dbcc208f6db66ec3e2de2104fa754 and
 occurs in 0.3.5.1-alpha.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29144>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list