mirror of https://github.com/fail2ban/fail2ban
fixed issue with crashing on wrong log file
added a cleanup of firewall on emergency exitdebian-releases/etch debian/0.5.4-5.14
parent
e9792f95f6
commit
51d453a3d2
|
@ -1,4 +1,4 @@
|
|||
fail2ban (0.5.4-5.13) unstable; urgency=low
|
||||
fail2ban (0.5.4-5.14) unstable; urgency=low
|
||||
|
||||
* Added a notification regarding the importance of 0.5.4-5 change of
|
||||
failregex in the config file.
|
||||
|
@ -20,6 +20,10 @@ fail2ban (0.5.4-5.13) unstable; urgency=low
|
|||
within sections.
|
||||
* Added -e command line parameter to provide enabled sections from command
|
||||
line.
|
||||
* Added a cleanup of firewall rules on emergency shutdown when unknown
|
||||
exception is catched.
|
||||
* Fail2ban should not crash now if a wrong file name is specified in
|
||||
config.
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Mon, 3 Oct 2005 22:26:28 -1000
|
||||
|
||||
|
|
6
fail2ban
6
fail2ban
|
@ -55,6 +55,12 @@ except Exception, e:
|
|||
logSys.error("Type: " + `type.__name__` + "\n" +
|
||||
"Value: " + `e.args` + "\n" +
|
||||
"TB: " + `tbStack`)
|
||||
# Try to clean up after ourselves
|
||||
# just for extreme caution - wrapping with try
|
||||
try:
|
||||
fail2ban.restoreFwRules()
|
||||
except Exception:
|
||||
pass
|
||||
# Remove the PID lock file. Should close #1239562
|
||||
pidLock.remove()
|
||||
logging.shutdown()
|
||||
|
|
|
@ -97,8 +97,6 @@ class LogReader:
|
|||
"""
|
||||
try:
|
||||
self.logStats = os.stat(self.logPath)
|
||||
except OSError:
|
||||
logSys.error("Unable to get stat on "+self.logPath)
|
||||
|
||||
if self.lastModTime == self.logStats.st_mtime:
|
||||
return False
|
||||
|
@ -106,6 +104,10 @@ class LogReader:
|
|||
logSys.debug(self.logPath+" has been modified")
|
||||
self.lastModTime = self.logStats.st_mtime
|
||||
return True
|
||||
except OSError:
|
||||
logSys.error("Unable to get stat on "+self.logPath)
|
||||
return False
|
||||
|
||||
|
||||
def setFilePos(self, file):
|
||||
""" Sets the file position. We must take care of log file rotation
|
||||
|
|
Loading…
Reference in New Issue