Opened 4 months ago

Closed 2 weeks ago

Last modified 12 days ago

#25512 closed defect (fixed)

Tor in-process restart fails to write auth cookie

Reported by: tla Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords: tor-mobile, auth cookie, restart, in-process, s8-api
Cc: Actual Points:
Parent ID: #25510 Points:
Reviewer: ahf Sponsor: Sponsor8

Description

I integrated latest Tor master on 2018-03-15 into Tor.framework resp. OnionBrowser 2. Shutdown with the improved SIGNAL SHUTDOWN seems to work just fine.

When restarting Tor, however, it turns out, that the auth cookie is not written to the file system on the second time. First time works, file obviously gets deleted on SHUTDOWN but is not recreated on second start.

There is an according log entry the first time:

[info] init_cookie_authentication: Generated auth cookie file in '"/var/mobile/Containers/Data/Application/0653FD89-2D17-477A-B541-FC53F1A29EBD/Library/Caches/tor/control_auth_cookie"'.

This is not appearing on restart.

Child Tickets

Change History (13)

comment:1 Changed 4 months ago by nickm

Keywords: s8-api added
Sponsor: Sponsor8

comment:2 Changed 4 months ago by tla

Just checked usage with HashedControlPassword instead of cookie file: *that* works! So, great! We can work around this issue for now. Nevertheless - this should be fixed!

comment:3 Changed 4 months ago by nickm

ahf: this fix is probably as simple as making sure we clear authentication_cookie_is_set and authentication_cookie on control_free_all()

comment:4 Changed 4 months ago by nickm

Owner: changed from ahf to nickm
Status: assignedaccepted

comment:5 Changed 4 months ago by nickm

Status: acceptedneeds_review

Possible fix in branch bug25512

comment:6 Changed 4 months ago by asn

Reviewer: ahf

comment:7 Changed 4 months ago by ahf

Status: needs_reviewmerge_ready

LGTM.

comment:8 Changed 4 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged to master!

comment:9 Changed 3 weeks ago by tla

Parent ID: #23684#25510
Resolution: fixed
Status: closedreopened

Sorry. Just tried with Tor 0.3.3.7. The mentioned log message is not to be seen anymore, but the cookie file still won't be written on the second time.

Not sure, how I can help you with testing. Are you able to run Tor as a thread and restart it in-process?

It's a little cumbersome to get it running on OnionBrowser/Tor.framework.

Can you confirm, that it's working in your setup? If so, what is your setup? Or was this shotgun debugging?

comment:10 Changed 2 weeks ago by nickm

IIRC I was testing with --enable-restart-debugging and the TOR_DEBUG_RESTART envvar. I'll try to reproduce, though, if it isn't working for you.

comment:11 Changed 2 weeks ago by nickm

Status: reopenedaccepted

comment:12 Changed 2 weeks ago by nickm

Milestone: Tor: 0.3.4.x-finalTor: 0.3.3.x-final

Hang on -- you said that you were testing 0.3.3.7; this bug has only been fixed in 0.3.4, and not backported to 0.3.3.

It's a safe backport though, so I'll cherry-pick it to 0.3.3.

comment:13 Changed 2 weeks ago by nickm

Resolution: fixed
Status: acceptedclosed

Cherry-picked into 0.3.3; fix should be in the next maint-0.3.3 release.

Note: See TracTickets for help on using tickets.