[tor-bugs] #22731 [Core Tor/Tor]: Relative DataDirectory + RunAsDaemon = Tor can't read or write most of its datadirectory files

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jun 26 22:48:03 UTC 2017


#22731: Relative DataDirectory + RunAsDaemon = Tor can't read or write most of its
datadirectory files
------------------------------+--------------------------------
     Reporter:  arma          |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.2.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 Bug #22101 shows a case where if you start your Tor with a relative (non
 absolute) DataDirectory, and {{{RunAsDaemon 1}}}, and
 {{{CookieAuthentication 1}}} but no {{{CookieAuthFile}}}, then Tor will
 attempt to save your control_auth_cookie file to
 $datadir/$datadir/control_auth_cookie. (Yes, you read that correctly,
 $datadir/$datadir/.) The attempt will fail because Tor doesn't mkdir the
 $datadir/$datadir directory.

 If you start with a relative DataDirectory, and RunAsDaemon, but no
 CookieAuthentication, then your Tor will start, but it will attempt to
 (and fail to) write each of your datadirectory files -- state, cached-
 microdescriptors, etc, because it is trying to write them to
 $datadir/$datadir. I think that might be what teor saw in #20456, but he
 doesn't give us an actual torrc so I can't be sure.

 The bug is because we call get_datadir_fname(), which creates a filename
 that prepends $datadir, after we do the chdir($datadir) operation that
 comes with RunAsDaemon.

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


More information about the tor-bugs mailing list