[tor-bugs] #12114 [Tor]: Don't open DirPortFrontPage when not a relay or DirPort not set

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri May 23 22:20:46 UTC 2014


#12114: Don't open DirPortFrontPage when not a relay or DirPort not set
---------------------------+--------------------------------
     Reporter:  alphawolf  |      Owner:
         Type:  defect     |     Status:  new
     Priority:  normal     |  Milestone:  Tor: 0.2.5.x-final
    Component:  Tor        |    Version:  Tor: 0.2.5.4-alpha
   Resolution:             |   Keywords:  tor
Actual Points:             |  Parent ID:
       Points:             |
---------------------------+--------------------------------

Comment (by arma):

 Is this what you had in mind?
 {{{
 diff --git a/src/or/config.c b/src/or/config.c
 index 10df839..efd07de 100644
 --- a/src/or/config.c
 +++ b/src/or/config.c
 @@ -1825,7 +1825,7 @@ options_act(const or_options_t *old_options)
    /* Load the webpage we're going to serve every time someone asks for
 '/' on
       our DirPort. */
    tor_free(global_dirfrontpagecontents);
 -  if (options->DirPortFrontPage) {
 +  if (options->DirPort_set && options->DirPortFrontPage) {
      global_dirfrontpagecontents =
        read_file_to_str(options->DirPortFrontPage, 0, NULL);
      if (!global_dirfrontpagecontents) {
 }}}

 Why should we not open the file if we're not a relay but we set DirPort?
 Seems to me that if somebody sets DirPort and also sets DirPortFrontPage,
 then they want their DirPort to serve that string. (There is a use case,
 though it's probably rare, for one Tor client to serve a DirPort to a
 bunch of other local Tor clients, so they don't all load down the
 directory mirrors.)

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


More information about the tor-bugs mailing list