[tor-bugs] #4647 [Tor]: Tor needs to parse its command line exactly once

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu May 2 01:26:12 UTC 2013


#4647: Tor needs to parse its command line exactly once
------------------------+---------------------------------------------------
 Reporter:  rransom     |          Owner:                    
     Type:  defect      |         Status:  needs_revision    
 Priority:  major       |      Milestone:  Tor: 0.2.5.x-final
Component:  Tor         |        Version:                    
 Keywords:  tor-client  |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
Changes (by nickm):

  * status:  needs_review => needs_revision


Comment:

 I don't see how this code matches the description above.  Where  is the
 part that looks for a "-" character?  (Also, that's not really a great
 idea.  It is *okay* for a filename to start with a - character.)

 It looks like you've removed support for logging "configuration file not
 present; using reasonable defaults.".

 Minor issue: have a look at the diff, or how it appears in
 https://trac.torproject.org/projects/tor/attachment/ticket/4647/4647.diff
 : the indentation is mismatched in places, there are lines split for no
 reason, and there are new blank lines added for no reason.

 Finally, as written, this doesn't actually work.  If I say "tor
 --ControlPortWriteToFile -f --ControlPort auto", then the key-value pairs
 should be ControlPortWriteToFile="-f" and ControlPort="auto", even if
 there *is* a file named ControlPort.

 The right thing to do here is probably something like changing the way
 that config_get_commandlines() works so that instead of only returning a
 linked list of options in <b>result</b>, it *also* returns a list of the
 things that it currently skips.  That way both torrc-option-on-the-
 commandline parsing (which uses config_get_commandlines), and commandline-
 only parsing (currently done in find_torrc_fname and elsewhere) would use
 the same rules for deciding what is an option and what is an argument.

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


More information about the tor-bugs mailing list