[tor-bugs] #31241 [Core Tor/Tor]: Refactor config validation
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Jul 24 19:34:31 UTC 2019
#31241: Refactor config validation
-------------------------------+-----------------------------------------
Reporter: nickm | Owner: nickm
Type: task | Status: assigned
Priority: Medium | Milestone: Tor: 0.4.2.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Keywords: network-team-roadmap-august
Actual Points: | Parent ID: #29211
Points: 1.5 | Reviewer:
Sponsor: Sponsor31-can |
-------------------------------+-----------------------------------------
Here's the signature for the callback for validating a configuration
object:
{{{
typedef int (*validate_fn_t)(void*,void*,void*,int,char**);
}}}
This is not a great interface. For example, takes three copies of the
configuration object. One is the object it's validating; one is the
previous value of the object (to see if we're making a bad transition);
and the last one is the default values for the object (to see if we have
changed anything we weren't allowed to change).
We should divide this callback into separate pieces, and fix everything
that users options_validate() directly to instead call a config_validate()
wrapper function.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31241>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list