mirror of https://github.com/fail2ban/fail2ban
- Try to match the regex even if the line does not contain a valid date/time. Described in Debian #491253. Thanks to Yaroslav Halchenko.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@712 a942ae1a-1317-0410-a47c-b1dcaea8d605_tent/ipv6_via_aInfo
parent
8db3e1f74a
commit
6ee4843d11
|
@ -12,7 +12,11 @@ ver. 0.8.4 (2008/??/??) - stable
|
||||||
- Merged patches from Debian package. Thanks to Yaroslav
|
- Merged patches from Debian package. Thanks to Yaroslav
|
||||||
Halchenko.
|
Halchenko.
|
||||||
- Use current day and month instead of Jan 1st if both are
|
- Use current day and month instead of Jan 1st if both are
|
||||||
not available in the log. Thanks to Andreas Itzchak Rehberg
|
not available in the log. Thanks to Andreas Itzchak
|
||||||
|
Rehberg.
|
||||||
|
- Try to match the regex even if the line does not contain a
|
||||||
|
valid date/time. Described in Debian #491253. Thanks to
|
||||||
|
Yaroslav Halchenko.
|
||||||
|
|
||||||
ver. 0.8.3 (2008/07/17) - stable
|
ver. 0.8.3 (2008/07/17) - stable
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -241,15 +241,16 @@ class Filter(JailThread):
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
l = line
|
l = line
|
||||||
timeMatch = self.dateDetector.matchTime(l)
|
timeMatch = self.dateDetector.matchTime(l)
|
||||||
if not timeMatch:
|
if timeMatch:
|
||||||
# There is no valid time in this line
|
# Lets split into time part and log part of the line
|
||||||
return []
|
timeLine = timeMatch.group()
|
||||||
# Lets split into time part and log part of the line
|
# Lets leave the beginning in as well, so if there is no
|
||||||
timeLine = timeMatch.group()
|
# anchore at the beginning of the time regexp, we don't
|
||||||
# Lets leave the beginning in as well, so if there is no
|
# at least allow injection. Should be harmless otherwise
|
||||||
# anchore at the beginning of the time regexp, we don't
|
logLine = l[:timeMatch.start()] + l[timeMatch.end():]
|
||||||
# at least allow injection. Should be harmless otherwise
|
else:
|
||||||
logLine = l[:timeMatch.start()] + l[timeMatch.end():]
|
timeLine = l
|
||||||
|
logLine = l
|
||||||
return self.findFailure(timeLine, logLine)
|
return self.findFailure(timeLine, logLine)
|
||||||
|
|
||||||
def processLineAndAdd(self, line):
|
def processLineAndAdd(self, line):
|
||||||
|
|
Loading…
Reference in New Issue