[tor-bugs] #25140 [Core Tor/Tor]: Parse only .torrc files in torrc.d directory

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Feb 4 20:22:02 UTC 2018


#25140: Parse only .torrc files in torrc.d directory
--------------------------+------------------------------------
 Reporter:  iry           |          Owner:  (none)
     Type:  task          |         Status:  new
 Priority:  High          |      Milestone:
Component:  Core Tor/Tor  |        Version:  Tor: 0.3.3.1-alpha
 Severity:  Major         |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------
Changes (by iry):

 * cc: adrelanos, whonix-devel@… (added)
 * version:  Tor: unspecified => Tor: 0.3.3.1-alpha


Old description:

> Currently, when using a torrc.d directory, for example:
>
> {{{
> %include /etc/torrc.d/
> }}}
>

> Every file in the directory will be treated and parsed as a valid Tor
> configuration file. However, sometime, this may not be what users and
> developers want.
>
> For example, users may use /etc/torrc.d/50_user.torrc as the place to
> put their own torrc configurations. But sometimes, when they use a
> text editor to edit it, the text editor will leave a
> /etc/torrc.d/50_user.torrc~ file which will also be treated as a valid
> torrc file.
>
> Another example that also happens very frequently is, when dpkg does
> an update on /etc/torrc.d/30_distribution.torrc, users' previous
> configuration can be saved as
> /etc/torrc.d/30_distribution.torrc.dpkg-old which will also be parsed
> by Tor.
>
> In best case users will just be frustrated because Tor does not work
> as expected and in worst case this could be dangerous. This could be a
> severe problem especially because of the following reasons:
> 1. filename.torrc~ filename.torrc.dpkg-old has higher priority than
> filename.torrc when Tor does the parsing.
> 2. In most cases, this will happen without being noticed by the normal
> suer.
>
> Therefore, we should let Tor parse only the files whose names
> end with .torrc which "is standard behaviour among many tools".

New description:

 Currently, when using a torrc.d directory, for example:

 {{{
 %include /etc/torrc.d/
 }}}


 Every file in the directory will be treated and parsed as a valid Tor
 configuration file. However, sometime, this may not be what users and
 developers want.

 For example, users may use /etc/torrc.d/50_user.torrc as the place to
 put their own torrc configurations. But sometimes, when they use a
 text editor to edit it, the text editor will leave a
 /etc/torrc.d/50_user.torrc~ file which will also be treated as a valid
 torrc file.

 Another example that also happens very frequently is, when dpkg does
 an update on /etc/torrc.d/30_distribution.torrc, users' previous
 configuration can be saved as
 /etc/torrc.d/30_distribution.torrc.dpkg-old which will also be parsed
 by Tor.

 In best case users will just be frustrated because Tor does not work
 as expected and in worst case this could be dangerous. This could be a
 severe problem especially because of the following reasons:
 1. filename.torrc~ filename.torrc.dpkg-old has higher priority than
 filename.torrc when Tor does the parsing.
 2. In most cases, this will happen without being noticed by the normal
 suer.

 teor suggested on the tor-dev@:

 > To be more precise, most tools accept files ending in ".conf".
 > We might want tor to accept ".conf" for consistency.

 > I suggest we also accept files called "torrc", or ending in ".torrc".
 > This should probably also include files called literally ".torrc".

 Downstream discussion to link everything together:
 http://forums.dds6qkxpwdeubwucdiaord2xgbbeyds25rbsgr73tbfpqpt4a6vjwsyd.onion/t/torrc-d
 -is-comming/4041/20

--

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


More information about the tor-bugs mailing list