Commit 32ee23ef authored by Peter Müller's avatar Peter Müller

added files for v0.8.13

parents
# Fail2Ban IPv6 Patch
**Fail2Ban v0.8.13**
Mehr Informationen unter https://crycode.de/fail2ban-mit-ipv6/.
# Fail2Ban IPv6 Patch for Fail2Ban v0.8.13
--- 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)")
if regex.lstrip() == '':
raise RegexException("Cannot add empty regex")
try:
# Fail2Ban IPv6 Patch for Fail2Ban v0.8.13
--- filter.py.orig
+++ filter.py
@@ -655,6 +655,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):
@@ -678,19 +679,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
searchIP = staticmethod(searchIP)
#@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
isValidIP = staticmethod(isValidIP)
#@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