[tor-bugs] #9578 [Tor]: Tor obeys --quiet, --hush, etc without regard for argument order

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Aug 24 10:17:37 UTC 2013


#9578: Tor obeys --quiet, --hush, etc without regard for argument order
------------------------+---------------------------------------------------
 Reporter:  arma        |          Owner:                    
     Type:  defect      |         Status:  new               
 Priority:  normal      |      Milestone:  Tor: 0.2.5.x-final
Component:  Tor         |        Version:                    
 Keywords:  tor-client  |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
 When you run
 {{{
 $ src/or/tor contactinfo "--quiet"
 }}}
 it is not supposed to set your contactinfo to "--quiet" while at the same
 time telling Tor to change its default log setting.

 The problem comes from
 {{{
   /* We search for the "quiet" option first, since it decides whether we
    * will log anything at all to the command line. */
   for (i=1;i<argc;++i) {
     if (!strcmp(argv[i], "--hush"))
       quiet = 1;
     if (!strcmp(argv[i], "--quiet"))
       quiet = 2;
     /* --version implies --quiet */
     if (!strcmp(argv[i], "--version"))
       quiet = 2;
   }
 }}}

 We just paw through the arg list without paying attention to syntax of
 other arguments.

 Surely there's a better way. :)

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


More information about the tor-bugs mailing list