[tor-bugs] #4647 [Tor]: Tor needs to parse its command line exactly once
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Sep 3 21:43:51 UTC 2013
#4647: Tor needs to parse its command line exactly once
-------------------------+--------------------------------
Reporter: rransom | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: Tor: 0.2.5.x-final
Component: Tor | Version:
Resolution: | Keywords: tor-client
Actual Points: | Parent ID:
Points: |
-------------------------+--------------------------------
Comment (by nickm):
I asked ctoader to have a look, and he said:
>I told you I'd email back about #4647, I went through it again with the
debugger and it looks good as it is. I wrote just a few notes on how I
think things would be more robust.
>
>The only drawback is that you cannot recover from a bad command such as
"asdasd" which is treated as a command which also takes an argument so
"asdad -f something.cfg" would pair the first 2 as key-value which would
mess up the whole thing. Could be fixed, but most likely is not worth the
effort, if config_parse_commandline() also validates each command, instead
of having the commands validated in options_init_from_string(). This would
also have to be done to options in conf files as well (in
load_torrc_from_disk() maybe).
>
>Also config_parse_commandline() can be called just once in tor_init() and
have options_init_from_torrc() use the global_cmdline_options and
cmdline_only_only set in tor_init(). In case SIGHUP is caught,
options_init_from_torrc() doesn't need to re-parse the commandline, but it
could if you check for argv == NULL.
>
>I hope this helps, even if I didn't find any real issues!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4647#comment:16>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list