2007-03-24 22:27:09 +00:00
|
|
|
#! /bin/sh /usr/share/dpatch/dpatch-run
|
|
|
|
## 00_close_log.dpatch by Yaroslav Halchenko <debian@onerussian.com>
|
|
|
|
##
|
|
|
|
## All lines beginning with `## DP:' are a description of the patch.
|
|
|
|
## DP: post release patches
|
|
|
|
|
|
|
|
@DPATCH@
|
2007-03-24 22:40:42 +00:00
|
|
|
diff -urNad fail2ban-0.7.8~/server/server.py fail2ban-0.7.8/server/server.py
|
|
|
|
--- fail2ban-0.7.8~/server/server.py 2007-02-07 14:22:44.000000000 -0500
|
|
|
|
+++ fail2ban-0.7.8/server/server.py 2007-03-24 18:39:32.000000000 -0400
|
2007-03-24 22:27:09 +00:00
|
|
|
@@ -326,15 +326,18 @@
|
|
|
|
else:
|
|
|
|
# Target should be a file
|
|
|
|
try:
|
|
|
|
- open(target, "a")
|
|
|
|
+ open(target, "a").close()
|
|
|
|
hdlr = logging.FileHandler(target)
|
|
|
|
except IOError:
|
|
|
|
logSys.error("Unable to log to " + target)
|
|
|
|
logSys.info("Logging to previous target " + self.__logTarget)
|
|
|
|
return False
|
|
|
|
self.__logTarget = target
|
|
|
|
- # Remove previous handler
|
|
|
|
- logging.getLogger("fail2ban").handlers = []
|
|
|
|
+ # Removes previous handlers
|
|
|
|
+ for handler in logging.getLogger("fail2ban").handlers:
|
|
|
|
+ # Closes the handler.
|
|
|
|
+ handler.close()
|
|
|
|
+ logging.getLogger("fail2ban").removeHandler(handler)
|
|
|
|
# set a format which is simpler for console use
|
|
|
|
formatter = logging.Formatter("%(asctime)s %(name)-16s: %(levelname)-6s %(message)s")
|
|
|
|
# tell the handler to use this format
|