Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #4456

Closed
Open
Created Nov 13, 2011 by Damian Johnson@atagar

TorCtl Misparsing Escaped Cookie Paths

The proper handling for the cookie file paths are actually kinda complicated since it can contain escape characters ("Controllers MUST handle escape sequences inside this string." [1]). Functionally this means that its been processed by tor's "esc_for_log" function in 'common/util.c'.

TorCtl not only doesn't unescape paths, but also chokes if there's an escaped quote within it. For instance...

atagar@morrigan:~/Desktop/arm/src$ cat ~/.tor/torrc 
SocksPort 0
ControlPort 9051
CookieAuthentication 1

DataDirectory /tmp/my data"dir/

atagar@morrigan:~/Desktop/arm/src$ python
>>> from TorCtl import TorCtl
>>> conn = TorCtl.connect()
INFO[Sat Oct 29 10:46:55 2011]:Event loop received close message.
INFO[Sat Oct 29 10:46:55 2011]:Event loop received close message.
NOTICE[Sat Oct 29 10:46:55 2011]:Tor closed control connection. Exiting event thread.
NOTICE[Sat Oct 29 10:46:55 2011]:Tor closed control connection. Exiting event thread.
Failed to read authentication cookie (file doesn't exist): /tmp/my data\

For stem's handling of this see the 'CONTROL_ESCAPES' uses in: https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/types.py#l39

Cheers! -Damian

[1] https://gitweb.torproject.org/torspec.git/blob/HEAD:/control-spec.txt#l960

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None