[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs