mirror of https://github.com/fail2ban/fail2ban
meantime commit: code review, simplification, pythonization, etc.
parent
01e1383c9b
commit
1308744348
|
@ -433,7 +433,7 @@ class Filter(JailThread):
|
||||||
logSys.debug("Ignore line since time %s < %s - %s",
|
logSys.debug("Ignore line since time %s < %s - %s",
|
||||||
unixTime, MyTime.time(), self.getFindTime())
|
unixTime, MyTime.time(), self.getFindTime())
|
||||||
break
|
break
|
||||||
if self.inIgnoreIPList(ip.ntoa(), log_ignore=True):
|
if self.inIgnoreIPList(ip, log_ignore=True):
|
||||||
continue
|
continue
|
||||||
logSys.info(
|
logSys.info(
|
||||||
"[%s] Found %s - %s", self.jail.name, ip, datetime.datetime.fromtimestamp(unixTime).strftime("%Y-%m-%d %H:%M:%S")
|
"[%s] Found %s - %s", self.jail.name, ip, datetime.datetime.fromtimestamp(unixTime).strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
@ -530,8 +530,7 @@ class Filter(JailThread):
|
||||||
try:
|
try:
|
||||||
host = failRegex.getHost()
|
host = failRegex.getHost()
|
||||||
if returnRawHost:
|
if returnRawHost:
|
||||||
ipaddr = IPAddr(host)
|
failList.append([failRegexIndex, IPAddr(host), date,
|
||||||
failList.append([failRegexIndex, ipaddr, date,
|
|
||||||
failRegex.getMatchedLines()])
|
failRegex.getMatchedLines()])
|
||||||
if not checkAllRegex:
|
if not checkAllRegex:
|
||||||
break
|
break
|
||||||
|
@ -539,9 +538,8 @@ class Filter(JailThread):
|
||||||
ipMatch = DNSUtils.textToIp(host, self.__useDns)
|
ipMatch = DNSUtils.textToIp(host, self.__useDns)
|
||||||
if ipMatch:
|
if ipMatch:
|
||||||
for ip in ipMatch:
|
for ip in ipMatch:
|
||||||
ipaddr = IPAddr(ip)
|
failList.append([failRegexIndex, ip, date,
|
||||||
failList.append([failRegexIndex, ipaddr,
|
failRegex.getMatchedLines()])
|
||||||
date, failRegex.getMatchedLines()])
|
|
||||||
if not checkAllRegex:
|
if not checkAllRegex:
|
||||||
break
|
break
|
||||||
except RegexException, e: # pragma: no cover - unsure if reachable
|
except RegexException, e: # pragma: no cover - unsure if reachable
|
||||||
|
|
Loading…
Reference in New Issue