Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
7ca8ce6d
Commit
7ca8ce6d
authored
Mar 16, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Mar 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(proxy) better match url overlaps in acl,
https://github.com/opnsense/core/issues/824
(cherry picked from commit
b1034aab
)
parent
7e5b2b1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
fetchACLs.py
src/opnsense/scripts/proxy/fetchACLs.py
+8
-3
No files found.
src/opnsense/scripts/proxy/fetchACLs.py
View file @
7ca8ce6d
...
...
@@ -159,7 +159,12 @@ class DomainSorter(object):
"""
line
=
data
.
strip
()
.
lower
()
if
len
(
line
)
>
0
:
self
.
add
(
line
[::
-
1
],
line
)
# Calculate sort key, which is the reversed url with dots (.) replaced by spaces.
# We need to replace dots (.) here to avoid having a wrong sorting order when dashes
# or similar characters are used inside the url.
# (The process writing out the domains checks for domain overlaps)
sort_key
=
line
[::
-
1
]
.
replace
(
'.'
,
' '
)
self
.
add
(
sort_key
,
line
)
def
add
(
self
,
key
,
value
):
""" spool data to temp
...
...
@@ -218,8 +223,8 @@ class DomainSorter(object):
# duplicate, skip
continue
if
self
.
is_domain
(
line
):
# prefix domain,
but only if the chances are very small it will overlap
if
prev_line
is
None
or
line
not
in
prev_line
:
# prefix domain,
if this domain is different then the previous one
if
prev_line
is
None
or
'.
%
s'
%
line
not
in
prev_line
:
f_out
.
write
(
'.'
)
f_out
.
write
(
line
)
prev_line
=
line
...
...
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