Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #623 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] identity.from_host and identity.from_any_hosts() broken?

Reported by: Joost Owned by: anonymous
Priority: normal Milestone:
Component: Identity Version:
Severity: normal Keywords:
Cc: jeff


I know that IP based security is pretty bad but it is *really* convinient for small non-public tools that need to accept connections from other apps. Today I tried to use the identity.fom_host and identity.from_any_host predicates yet both seem to be broken. There aren't any testcases for these two predicates but I think this patch is ok. An attempt to add two additional testcases resulted in nothing but 404 errors though...

Index: conditions.py
--- conditions.py	(revision 841)
+++ conditions.py	(working copy)
@@ -200,7 +200,7 @@
         Match the visitor's host against the criteria.
         ip = _remoteHost()
-        if _match_ip( host, ip ):
+        if _match_ip( self.host, ip ): 
             return True
         self.append_error_message( errors )
         return False
@@ -214,7 +214,7 @@
     error_message= "Access from this host is not permitted."
     def __init__(self, hosts):
-        host_predicates= [require_host(h) for h in hosts]
+        host_predicates= [from_host(h) for h in hosts] 
         super(from_any_host,self).__init__( *host_predicates )

Change History

comment:1 Changed 13 years ago by simon

  • Cc jeff added

comment:2 Changed 13 years ago by Jeff Watkins

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r897. Stupid typos.

Note: See TracTickets for help on using tickets.