mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-05-14 06:56:47 +00:00
BF: fail2ban-regex adding duplicate lines with each regex
This issue was caused by the fact that every "line" is processed for each regex, meaning each line was duplicated for every regex. This caused duplicate fail matches and the buffer filling too quickly and possibly missing failures.
This commit is contained in:
parent
6a380139bd
commit
e73b3dd53e
1 changed files with 5 additions and 0 deletions
|
|
@ -277,7 +277,12 @@ class Fail2banRegex:
|
|||
return False
|
||||
finally:
|
||||
self.__filter.delFailRegex(0)
|
||||
try:
|
||||
del self.__filter._Filter__lineBuffer[-1]
|
||||
except IndexError:
|
||||
pass
|
||||
logging.getLogger("fail2ban").setLevel(logging.CRITICAL)
|
||||
self.__filter.processLine(line)
|
||||
for regex in self.__ignoreregex:
|
||||
self.__filter.delIgnoreRegex(0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue