Opened 8 years ago

Last modified 3 years ago

#3698 assigned defect

Multi-line torrc options conflict with Windows paths

Reported by: karsten Owned by: Jigsaw52
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: windows tor-relay torrc tor-client needs-design
Cc: danielpinto52@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I set up a relay on Windows with these two lines as the first lines in my torrc:

DataDirectory C:\Users\karsten\tor\
Log notice file notice.log

Guess what happens? My DataDirectory is now in "C:\Users\karsten\torLog notice file notice.log" and I don't have a log file.

While this makes sense to me now, I was quite surprised. Not sure if there's an easy fix to this or if it's worth fixing at all.

Child Tickets

Change History (9)

comment:1 Changed 8 years ago by nickm

Milestone: Tor: 0.2.3.x-final

If we can come up with a real design for a fix, I'd like to get this nailed down to do something more sensible instead.

comment:2 Changed 8 years ago by asn

Keywords: windows added

comment:3 Changed 8 years ago by nickm

Do we have any actual design here? I'm not sure at all what the right behavior would be. If the right behavior is very different from the current behavior, we should defer.

comment:4 Changed 8 years ago by nickm

Milestone: Tor: 0.2.3.x-finalTor: 0.2.4.x-final

comment:5 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:6 Changed 7 years ago by nickm

Component: Tor RelayTor

comment:7 Changed 7 years ago by nickm

Milestone: Tor: 0.2.4.x-finalTor: unspecified

comment:8 Changed 3 years ago by Jigsaw52

Cc: danielpinto52@… added
Keywords: torrc added
Owner: set to Jigsaw52
Severity: Normal
Status: newassigned

I ran into a problem similar to this while implementing #1922.

Currently there are two syntaxes for configuration values on torrc:

  • values enclosed by double quotes are read as C escaped strings
  • values not enclosed by quotes are read as is and a backslash can be used as a line continuation character

Neither are good for Windows paths ending with a backslash and those are useful because they provide an easy way to tell the path is a directory.

I thought of adding a third syntax: values enclosed in single quotes would be read as is, without any escaping. The changes needed to support this are fairly simple and I do not think this would break any existing torrc.

What do you guys think?

Last edited 3 years ago by Jigsaw52 (previous) (diff)

comment:9 Changed 3 years ago by nickm

Keywords: tor-client needs-design added

So, there are two existing options that do work pretty well for windows paths, I believe.

  • Unless I'm mistaken, you can just use forward-slashes instead of backslashes, and everything will work out.
  • You can put a space at the end of the line after your path, and the backslash won't be interpreted as a line continuation.

Personally, I think that adding yet another key/value syntax is something we shouldn't do without a lot of thought and design, since our syntax is already more complicated than it should be.

Note: See TracTickets for help on using tickets.