Browse Source

pyinotify backend: guarantees initial scanning of log-file by start (retarded via pending event if filter not yet active)

pull/2689/head
sebres 5 years ago
parent
commit
bc2b81133c
  1. 1
      ChangeLog
  2. 8
      fail2ban/server/filterpyinotify.py

1
ChangeLog

@ -34,6 +34,7 @@ ver. 0.10.6-dev (20??/??/??) - development edition
### Fixes
* [stability] prevent race condition - no ban if filter (backend) is continuously busy if
too many messages will be found in log, e. g. initial scan of large log-file or journal (gh-2660)
* pyinotify-backend sporadically avoided initial scanning of log-file by start
* python 3.9 compatibility (and Travis CI support)
* restoring a large number (500+ depending on files ulimit) of current bans when using PyPy fixed
* manual ban is written to database, so can be restored by restart (gh-2647)

8
fail2ban/server/filterpyinotify.py

@ -271,7 +271,13 @@ class FilterPyinotify(FileFilter):
def _addLogPath(self, path):
self._addFileWatcher(path)
self._process_file(path)
# initial scan:
if self.active:
# we can execute it right now:
self._process_file(path)
else:
# retard until filter gets started:
self._addPending(path, ('INITIAL', path))
##
# Delete a log path

Loading…
Cancel
Save