mirror of https://github.com/fail2ban/fail2ban
pyinotify backend: guarantees initial scanning of log-file by start (retarded via pending event if filter not yet active)
parent
68f827e1f3
commit
bc2b81133c
|
@ -34,6 +34,7 @@ ver. 0.10.6-dev (20??/??/??) - development edition
|
||||||
### Fixes
|
### Fixes
|
||||||
* [stability] prevent race condition - no ban if filter (backend) is continuously busy if
|
* [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)
|
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)
|
* python 3.9 compatibility (and Travis CI support)
|
||||||
* restoring a large number (500+ depending on files ulimit) of current bans when using PyPy fixed
|
* 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)
|
* manual ban is written to database, so can be restored by restart (gh-2647)
|
||||||
|
|
|
@ -271,7 +271,13 @@ class FilterPyinotify(FileFilter):
|
||||||
|
|
||||||
def _addLogPath(self, path):
|
def _addLogPath(self, path):
|
||||||
self._addFileWatcher(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
|
# Delete a log path
|
||||||
|
|
Loading…
Reference in New Issue