Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c75745d3
Commit
c75745d3
authored
Sep 15, 1998
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug that prevented IP authorization from working if an IP spec with less
than 4 components was used.
parent
d1f34ac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+6
-7
No files found.
lib/python/AccessControl/User.py
View file @
c75745d3
"""Access control package"""
__version__
=
'$Revision: 1.5
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
8
$'
[
11
:
-
2
]
import
Globals
,
App
.
Undo
,
socket
,
regex
from
PersistentMapping
import
PersistentMapping
...
...
@@ -592,24 +592,25 @@ def manage_addUserFolder(self,dtself=None,REQUEST=None,**ignored):
addr_match
=
regex
.
compile
(
'[0-9
\
.
\
*]*'
).
match
host_match
=
regex
.
compile
(
'[A-Za-z0-9
\
.
\
*]*'
).
match
def
domainSpecMatch
(
spec
,
request
):
host
=
''
addr
=
''
if
request
.
has_key
(
'REMOTE_HOST'
):
host
=
request
[
'REMOTE_HOST'
]
else
:
host
=
''
if
request
.
has_key
(
'REMOTE_ADDR'
):
addr
=
request
[
'REMOTE_ADDR'
]
else
:
addr
=
''
if
not
host
and
not
addr
:
return
0
if
not
host
:
try
:
host
=
socket
.
gethostbyaddr
(
addr
)[
0
]
try
:
host
=
socket
.
gethostbyaddr
(
addr
)[
0
]
except
:
pass
if
not
addr
:
try
:
addr
=
socket
.
gethostbyname
(
host
)
try
:
addr
=
socket
.
gethostbyname
(
host
)
except
:
pass
_host
=
split
(
host
,
'.'
)
...
...
@@ -623,8 +624,6 @@ def domainSpecMatch(spec, request):
_sz
=
len
(
_ob
)
if
addr_match
(
ob
)
==
sz
:
if
_sz
!=
_alen
:
continue
fail
=
0
for
i
in
range
(
_sz
):
a
=
_addr
[
i
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment