Opened 2 years ago

Closed 2 years ago

#22283 closed defect (fixed)

Linux 7.0a4 broken after update: "Directory /run/user/$uid/Tor does not exist."

Reported by: mcs Owned by: mcs
Priority: Medium Milestone:
Component: Applications/Tor Launcher Version:
Severity: Normal Keywords: TorBrowserTeam201705R
Cc: brade, gk, boklm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

After Tor Browser 7.0a3 is updated to 7.0a4 on Linux, it fails to start up. The problem is that the code we wrote for #20761 to remove ControlPort and SocksPort lines from the user's torrc only removes Unix domain socket lines if the browser is configured to use Unix domain sockets, which it is not in 7.0a4. This means that after updating to 7.0a4, Tor Launcher starts tor so that TCP is used for the control port and SOCKS port, but lines like the following are left behind in torrc:

ControlPort unix:/run/user/1001/Tor/control.socket
SocksPort unix:/run/user/1001/Tor/socks.socket IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth

Unfortunately, the parent directory (in this example, /run/user/1001/Tor) does not exist because Tor Launcher removes it when it exits and does not create it because it does not think Unix domain sockets are being used.

A similar problem occurs on OSX, but the parent directory is always .../TorBrowser-Data/Tor which happens to exist for other reasons (i.e., that's where torrc is located), so on OSX Tor Browser starts up and there are both TCP and Unix domain socket listeners.

One workaround is for users to edit their torrc and remove the ControlPort and SocksPort lines manually.

Child Tickets

Change History (6)

comment:1 Changed 2 years ago by mcs

To prevent this problem, we can modify the code that removes lines from torrc to remove Unix domain socket lines even when Tor Launcher is going to use TCP for the ControlPort and SocksPort. To try to avoid removing torrc lines that the user may have added themselves, the code should check that the path in the ControlPort and SocksPort lines matches what Tor Launcher would use if it were configured to use Unix domain sockets by default.

comment:2 in reply to:  1 ; Changed 2 years ago by mcs

Status: newneeds_information

Replying to mcs:

To try to avoid removing torrc lines that the user may have added themselves, the code should check that the path in the ControlPort and SocksPort lines matches what Tor Launcher would use if it were configured to use Unix domain sockets by default.

Because of the way the code is organized inside Tor Launcher, checking the path will be messier than Kathy and I would like. We can do it if necessary, but would it be acceptable to remove all of the Unix domain socket ControlPort and SocksPort lines if Tor Launcher is now using TCP for those things? The risk is that we would remove extra Unix domain socket ControlPort and SocksPort lines that were added by a user. But I suspect very few people have done that, and we could ensure that the extra cleanup we do would only affect alpha users.

Another question: will 7.0a5 use Unix domain sockets by default or TCP? If the answer is Unix domain sockets, then we have another transition back from TCP to Unix domain sockets to worry about. I think we will be okay with the existing code in that case, except we will want to ensure that the "one time" (ha) torrc cleanup code runs a second time on the alpha channel.

comment:3 in reply to:  2 ; Changed 2 years ago by gk

Replying to mcs:

Replying to mcs:

To try to avoid removing torrc lines that the user may have added themselves, the code should check that the path in the ControlPort and SocksPort lines matches what Tor Launcher would use if it were configured to use Unix domain sockets by default.

Because of the way the code is organized inside Tor Launcher, checking the path will be messier than Kathy and I would like. We can do it if necessary, but would it be acceptable to remove all of the Unix domain socket ControlPort and SocksPort lines if Tor Launcher is now using TCP for those things? The risk is that we would remove extra Unix domain socket ControlPort and SocksPort lines that were added by a user. But I suspect very few people have done that, and we could ensure that the extra cleanup we do would only affect alpha users.

That's fine with me.

Another question: will 7.0a5 use Unix domain sockets by default or TCP? If the answer is Unix domain sockets, then we have another transition back from TCP to Unix domain sockets to worry about. I think we will be okay with the existing code in that case, except we will want to ensure that the "one time" (ha) torrc cleanup code runs a second time on the alpha channel.

Why is that an issue? There are no ControlPort or SocksPort lines written to torrc anymore thanks to __ControlPort and __SocksPort being used. So, switching back and forth should be no problem anymore. Or are you envision some corner cases here due to the bug in the patch for #20761?

comment:4 in reply to:  3 Changed 2 years ago by mcs

Replying to gk:

Why is that an issue? There are no ControlPort or SocksPort lines written to torrc anymore thanks to __ControlPort and __SocksPort being used. So, switching back and forth should be no problem anymore. Or are you envision some corner cases here due to the bug in the patch for #20761?

The latter. Because we did not successfully remove all of the problematic ControlPort and SocksPort lines, we need to perform the cleanup one more time (with patched code, coming soon). So I think we are all in agreement here.

comment:5 Changed 2 years ago by mcs

Keywords: TorBrowserTeam201705R added
Status: needs_informationneeds_review

comment:6 Changed 2 years ago by gk

Resolution: fixed
Status: needs_reviewclosed

Looks good to me. commit 123a3ed987bef91c006957394da0465132954b3f on master has the fix.

Note: See TracTickets for help on using tickets.