[tor-bugs] #5557 [Tor Bridge]: Tor helpers' launch error message contains useless whitespace

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue Apr 3 12:25:04 UTC 2012


#5557: Tor helpers' launch error message contains useless whitespace
------------------------+---------------------------------------------------
 Reporter:  asn         |          Owner:                    
     Type:  defect      |         Status:  new               
 Priority:  normal      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Bridge  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
 While playing with #5099, I noticed that the spawn error message that Tor
 uses to denote "launch failure" usually looks like this:
 {{{
 ERR: Failed to spawn background process - code          9/2
 }}}

 The whitespace between 'code' and '9/2' occurs because
 `format_helper_exit_status()` writes the last part of that string in
 reverse order, after first populating it with whitespace.

 That is mainly an aesthetics issue but it also bugs `log_from_pipe()`
 since it uses `tor_sscanf()` to parse the error message, but without
 taking the whitespace into account:
 {{{
       retval = tor_sscanf(buf, SPAWN_ERROR_MESSAGE "%x/%x",
                           &child_state, &saved_errno);
 }}}

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


More information about the tor-bugs mailing list