[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #22101 [Core Tor/Tor]: Can't have relative DataDirectory with CookieAuthentication enabled



#22101: Can't have relative DataDirectory with CookieAuthentication enabled
--------------------------+------------------------------------
 Reporter:  pastly        |          Owner:
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |        Version:  Tor: 0.3.0.6
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by Jigsaw52):

 I've looked into this for a bit and found the cause of the issue:

 In the function options_act (in config.c), finish_daemon is called and
 finish_daemon changes the current directory to the DataDirectory.

 Later on options_act, init_control_cookie_authentication is called, which
 will try to create the control_auth_cookie file inside the DataDirectory.

 Because DataDirectory is a relative path, it will try to create the
 control_auth_cookie file inside CURRENT_DIR/DataDirectory.

 The problem is that, because CURRENT_DIR was changed to DataDirectory by
 finish_daemon, it will try to create the control_auth_cookie file inside
 DataDirectory/DataDirectory which does not exist, resulting in the error
 we see on the logs.

 There may more bugs similar to this, as any call to get_datadir_fname
 after CURRENT_DIR is changed will result in the wrong path when a relative
 path is used for the DataDirectory.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22101#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs