[tor-bugs] #1922 [Core Tor/Tor]: torrc.d-style configuration directories

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat May 20 23:47:07 UTC 2017


#1922: torrc.d-style configuration directories
-------------------------------------------------+-------------------------
 Reporter:  aa138346                             |          Owner:
                                                 |  Jigsaw52
     Type:  enhancement                          |         Status:
                                                 |  reopened
 Priority:  Low                                  |      Milestone:  Tor:
                                                 |  0.3.1.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-client, intro,                   |  Actual Points:
  tor-03-unspecified-201612                      |
Parent ID:                                       |         Points:  medium
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by Jigsaw52):

 I've identified the source of the problem:
 parse_config_line_from_str_verbose() calls unescape_string() when a
 configuration value starts with a quote. unescape_string() returns NULL
 for anything that is not a valid C escaped string, causing
 parse_config_line_from_str_verbose() to stop reading the configuration and
 return the error "Invalid escape sequence in quoted string".

 This problem is not specific to this feature. As it is currently
 implemented, the config parsing code assumes that any value enclosed by
 quotes is a valid C escaped string. If it is not, the configuration  will
 be invalid. Any configuration option that takes paths will have problems
 with paths containing backslashes that are enclosed in quotes.

 I'm unsure how to fix this. It is not feasible to make special cases for
 options that we know that take paths because the options parsing code is
 completely separate from the options validation code.

 Is there any option that actually benefits from allowing C escaped strings
 as values? I'm thinking that maybe this feature could be removed but that
 will cause backwards compatibility problems if someone decided to use it
 in their config files.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1922#comment:92>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list