[tor-bugs] #25140 [Core Tor/Tor]: Parse only .torrc files in torrc.d directory
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Sep 16 20:07:19 UTC 2019
#25140: Parse only .torrc files in torrc.d directory
-------------------------------------------------+-------------------------
Reporter: iry | Owner:
| Jigsaw52
Type: task | Status:
| needs_revision
Priority: High | Milestone: Tor:
| 0.4.2.x-final
Component: Core Tor/Tor | Version: Tor:
| 0.3.3.1-alpha
Severity: Major | Resolution:
Keywords: 034-triage-20180328, | Actual Points:
035-removed-20180711 |
Parent ID: | Points:
Reviewer: ahf | Sponsor:
-------------------------------------------------+-------------------------
Changes (by ahf):
* status: needs_review => needs_revision
Comment:
Hey!
My apologies for the delay with this one. I still have no idea why Trac
ate my comment after our meeting. The comment I wrote back then is the
following according to my notes:
We are concerned right now about the complexity of these patches,
particularly around the `glob()` implementation, but also the size of the
changes to the `conffile.c` file.
Nick and I discussed the patches and came up with the following rather
radical suggestions to make the code simpler:
- Switch to use `fnmatch()` on the platforms where that function is
available.
This would allow you to implement more or less the same functionality in
a simpler way using `fnmatch()` and `listdir()` while simplifying the code
rather a lot and reducing the overall size of the patches.
- For platforms that DOES NOT support `fnmatch()`, we bundle an
implementation from another project (with a similar license as Tor) in the
`src/ext/'. This could for example be this one from Git (which they took
from the OpenBSD project):
https://github.com/libgit2/libgit2/blob/master/src/fnmatch.c
You can see how we do this with other functions by looking at the other
code imports found in the `src/ext` directory tree.
This would make the code more edible for us and overall much less complex
than before. `fnmatch()` and `listdir()` would not support the same amount
of features as a real `glob()` implementation would, but do we really need
those features?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25140#comment:47>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list