Commit 5ae11373 authored by Peter Müller's avatar Peter Müller

added files for v0.9.1

parents
# Fail2Ban IPv6 Patch
**Fail2Ban v0.9.1**
Mehr Informationen unter https://crycode.de/fail2ban-mit-ipv6/.
# Fail2Ban IPv6 Patch for Fail2Ban v0.9.1
--- failregex.py.orig
+++ failregex.py
@@ -41,7 +41,7 @@
self._matchCache = None
# Perform shortcuts expansions.
# Replace "<HOST>" with default regular expression for host.
- regex = regex.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>[\w\-.^_]*\w)")
+ regex = regex.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>[\w\-.^_:]*\w)")
# Replace "<SKIPLINES>" with regular expression for multiple lines.
regexSplit = regex.split("<SKIPLINES>")
regex = regexSplit[0]
# Fail2Ban IPv6 Patch for Fail2Ban v0.9.1
--- filter.py.orig
+++ filter.py
@@ -837,6 +837,7 @@
class DNSUtils:
IP_CRE = re.compile("^(?:\d{1,3}\.){3}\d{1,3}$")
+ IP_CRE6 = re.compile("^(?:[0-9:A-Fa-f]{3,})$")
@staticmethod
def dnsToIp(dns):
@@ -863,19 +864,21 @@
if match:
return match
else:
- return None
+ match = DNSUtils.IP_CRE6.match(text)
+ if match:
+ """ Right Here, we faced to a ipv6
+ """
+ return match
+ else:
+ return None
@staticmethod
def isValidIP(string):
""" Return true if str is a valid IP
+ We Consider that logfiles didn't make errors ;)
"""
- s = string.split('/', 1)
- try:
- socket.inet_aton(s[0])
- return True
- except socket.error:
- return False
+ return True
@staticmethod
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment