mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
BF: fail2ban-regex adding duplicate lines with each regex
This is another fix on top of e73b3dd to correctly resolve this issue
This commit is contained in:
parent
123ec3da13
commit
f87c53fa52
1 changed files with 4 additions and 5 deletions
|
|
@ -250,6 +250,7 @@ class Fail2banRegex(object):
|
|||
found = False
|
||||
for regex in self._ignoreregex:
|
||||
self._filter.addIgnoreRegex(regex.getFailRegex())
|
||||
orgLineBuffer = self._filter._Filter__lineBuffer
|
||||
for regex in self._failregex:
|
||||
try:
|
||||
self._filter.addFailRegex(regex.getFailRegex())
|
||||
|
|
@ -271,11 +272,9 @@ class Fail2banRegex(object):
|
|||
return False
|
||||
finally:
|
||||
self._filter.delFailRegex(0)
|
||||
try:
|
||||
del self._filter._Filter__lineBuffer[-1]
|
||||
except IndexError:
|
||||
pass
|
||||
self._filter.processLine(line)
|
||||
self._filter._Filter__lineBuffer = orgLineBuffer
|
||||
if not found:
|
||||
self._filter.processLine(line)
|
||||
for regex in self._ignoreregex:
|
||||
self._filter.delIgnoreRegex(0)
|
||||
return found
|
||||
|
|
|
|||
Loading…
Reference in a new issue