UserFolder doman spec with wildcards

Bug #141665 reported by Toby Dickenson
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Medium
Unassigned

Bug Description

UserFolder's domainSpecMatch allows wilcards in its domain specification, but a recent change to domainSpecValidate, which validates user input when changing the domain spec, rejects * characters.

Revision history for this message
Toby Dickenson (htrd) wrote :
Revision history for this message
Toby Dickenson (htrd) wrote :

Andreas asked:

<pre>
> Can you give an example ?
</pre>

From the Zope book at http://www.zope.org/Members/michel/ZB/Security.dtml:

<pre>
> You can also use IP numbers with asterisks to indicate wild card
> instead of domain names to specify domains. For example,
> "209.67.167.*" will match all IP addresses that start with
> "209.67.167".
</pre>

Im sure the old adminstrators guide documented that it worked with domain names too.

Also, it is also suprisingly useful to be able to specify a match-everything pattern that is simply "*". In the old collector, item 2002 was a patch to add an optimisation for this case, and documentation about *why* it is useful. Brian merged this patch in User.py revision 1.133.2.7.

Revision history for this message
Andreas Jung (ajung) wrote :

Status: Pending => Resolved

I rewrote all regular expressions and the domainsSpecValidate()
function on my own. The fixes are in the CVS trunk and the
behaviour reflects the explanation in the Zope book.

Andreas Jung
Zope Corportation

Revision history for this message
Toby Dickenson (htrd) wrote :

The patch comitted by Andreas in November allows only the first three of the following patterns. I think the fourth one is valid too.
1.1.1.*
1.1.*
1.*
*

I propose:

Index: lib/python/AccessControl/User.py
===================================================================
RCS file: /cvs-repository/Zope/lib/python/AccessControl/User.py,v
retrieving revision 1.168
diff -c -0 -r1.168 User.py
*** lib/python/AccessControl/User.py 1 Mar 2002 20:03:34 -0000 1.168
--- lib/python/AccessControl/User.py 7 Mar 2002 08:34:02 -0000
***************
*** 1100 ****
! addr_match=re.compile(r'((\d{1,3}\.){1,3}\*)|((\d{1,3}\.){3}\d{1,3})').match
--- 1100 ----
! addr_match=re.compile(r'((\d{0,3}\.){1,3}\*)|((\d{1,3}\.){3}\d{1,3})').match

Revision history for this message
Toby Dickenson (htrd) wrote :

Waaaaah - I was testing the wrong branch when I thought that andreas patch was flawed. Everything looks good now. Sorry for the confusion.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.