[tor-bugs] #16582 [Tor]: Distinguish ENOENT from other error cases when loading keys.

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jul 14 14:32:27 UTC 2015


#16582: Distinguish ENOENT from other error cases when loading keys.
------------------------+--------------------------------
     Reporter:  nickm   |      Owner:
         Type:  defect  |     Status:  new
     Priority:  major   |  Milestone:  Tor: 0.2.7.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:
Actual Points:          |  Parent ID:  #16530
       Points:          |
------------------------+--------------------------------

Comment (by teor):

 This affects the `file_status` function. I last worked on `file_status` in
 #13111 to resolve an issue where tor wouldn't start if key files were
 present but zero-length.

 I've just reviewed all the key-loading code which uses `file_status`
 again.

 I can't see how this abberant overwriting behaviour occurs, based on
 reading the latest code. Keys are only replaced on `FN_NOENT` (`ENOENT`),
 and, in many cases, `FN_EMPTY` (a zero-length file).

 But if `EMFILE` occurs (or any errno other than `ENOENT`), `file_status`
 returns `FN_ERROR`, and key loading fails. Nothing is read, generated, or
 overwritten.

 Are we loading keys without checking `file_status`?
 Which particular key-loading code or type of key exhibits this issue?

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


More information about the tor-bugs mailing list