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

Re: [tor-bugs] #933 [Tor Client]: MapAddress for domains?



#933: MapAddress for domains?
--------------------------+-------------------------------------------------
  Reporter:  Aleph0       |       Owner:  mwenge            
      Type:  enhancement  |      Status:  needs_review      
  Priority:  minor        |   Milestone:  Tor: 0.2.3.x-final
 Component:  Tor Client   |     Version:  0.2.0.33          
Resolution:  None         |    Keywords:                    
    Parent:               |  
--------------------------+-------------------------------------------------

Comment(by mwenge):

 Replying to [comment:4 nickm]:
 > Looks neat!  Will we ever want to match anything in a form other than
 "Replace a suffix starting with a dot with this other suffix starting with
 a dot?"  I don't think so.
 >
 > The doxygen comment on addressmap_match_superdomains() doesn't actually
 say what it does with the match if it finds one.  It should take a const
 char *, not a char *.  Also, it should probably return 0 rather than 1.

 I fixed this. But am not passing address as const - since I now need to
 alter it if the from and to addresses are wildcarded.

 >
 > The check for ".exit" in addressmap_rewrite seems off.  There is no real
 reason to disallow "MapAddress .com .com.big-web-cache.com", even if "big-
 web-cache.com" doesn't end in exit.

 Yes, got rid of this.

 > Also, Why not allow "MapAddress . .everythinggoesoverthis.exit" ?

 Mm, missed this. My feeling was that this configuration is more likely to
 be a typo than anything else.

 > IOW, I am proposing that the option syntaxes should be more like:
 >
 > MapAddress a.b.c   d.e.f  # This is what we have now
 > MapAddress .a.b.c  d.e.f  # Replaces any address ending with .a.b.c with
 d.e.f
 > MapAddress .a.b.c .d.e.f  # Replaces the .a.b.c at the end of any addr
 with .d.e.f
 >

 Implemented this.

 > So in the first case, "x.a.b.c" is unaffected, in the second case
 "x.a.b.c" turns into "d.e.f", and in the third case "x.a.b.c" turns into
 "x.d.e.f".  No special handling for .exit is needed.
 >
 > Parenthetically, do you think this "prefix dot" business is too subtle?
 Maybe the syntax should be "*.a.b.c" instead of ".a.b.c".  Do you think
 that would confuse people less?

 Syntax now allows a wildcard.

 >
 > Throughout the code, it seems fragile to have the strings in
 addressmap_entry_t have a special meaning when the key/value starts with
 ".".  Maybe it would be better to strip the "." when generating them and
 instead have a flag field added to addressmap_entry_t to indicate whether
 it should be a suffix match or an exact match?

 I kind of did this. I haven't stripped the leading '.' from the 'to'
 mapping but do use an is_wildcard flag to avoid repeated byte-compares.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/933#comment:7>
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