mirror of https://github.com/fail2ban/fail2ban
* Updated copyright to include current year * Removed patches absorbed upstreampull/3/head debian/0.7.9-1
parent
5dcec130f6
commit
d15f9d0206
@ -1,32 +0,0 @@
|
||||
#! /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@
|
||||
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
|
||||
@@ -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
|
@ -1,26 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 00_gamin_cleanup.dpatch by Yaroslav Halchenko <debian@onerussian.com>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: No description.
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad fail2ban-0.7.8~/server/filtergamin.py fail2ban-0.7.8/server/filtergamin.py
|
||||
--- fail2ban-0.7.8~/server/filtergamin.py 2006-11-06 17:47:30.000000000 -0500
|
||||
+++ fail2ban-0.7.8/server/filtergamin.py 2007-03-24 18:40:13.000000000 -0400
|
||||
@@ -117,5 +117,15 @@
|
||||
time.sleep(self.getSleepTime())
|
||||
else:
|
||||
time.sleep(self.getSleepTime())
|
||||
+ # Cleanup Gamin
|
||||
+ self.__cleanup()
|
||||
logSys.debug(self.jail.getName() + ": filter terminated")
|
||||
return True
|
||||
+
|
||||
+ ##
|
||||
+ # Desallocates the resources used by Gamin.
|
||||
+
|
||||
+ def __cleanup(self):
|
||||
+ for path in Filter.getLogPath(self):
|
||||
+ self.monitor.stop_watch(path)
|
||||
+ del self.monitor
|
@ -1,121 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 00_reload.dpatch by Yaroslav Halchenko <debian@onerussian.com>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: No description.
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad fail2ban-0.7.8~/server/actions.py fail2ban-0.7.8/server/actions.py
|
||||
--- fail2ban-0.7.8~/server/actions.py 2007-03-07 15:54:33.000000000 -0500
|
||||
+++ fail2ban-0.7.8/server/actions.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -125,10 +125,10 @@
|
||||
# @return True when the thread exits nicely
|
||||
|
||||
def run(self):
|
||||
+ self.setActive(True)
|
||||
for action in self.__actions:
|
||||
action.execActionStart()
|
||||
- self.setActive(True)
|
||||
- while self.isActive():
|
||||
+ while self._isActive():
|
||||
if not self.getIdle():
|
||||
#logSys.debug(self.jail.getName() + ": action")
|
||||
ret = self.__checkBan()
|
||||
diff -urNad fail2ban-0.7.8~/server/filter.py fail2ban-0.7.8/server/filter.py
|
||||
--- fail2ban-0.7.8~/server/filter.py 2007-02-01 15:50:16.000000000 -0500
|
||||
+++ fail2ban-0.7.8/server/filter.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -385,7 +385,7 @@
|
||||
self.__setFilePos()
|
||||
lastLine = None
|
||||
for line in self.__crtHandler:
|
||||
- if not self.isActive():
|
||||
+ if not self._isActive():
|
||||
# The jail has been stopped
|
||||
break
|
||||
try:
|
||||
diff -urNad fail2ban-0.7.8~/server/filtergamin.py fail2ban-0.7.8/server/filtergamin.py
|
||||
--- fail2ban-0.7.8~/server/filtergamin.py 2007-03-26 17:43:18.000000000 -0400
|
||||
+++ fail2ban-0.7.8/server/filtergamin.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
def run(self):
|
||||
self.setActive(True)
|
||||
- while self.isActive():
|
||||
+ while self._isActive():
|
||||
if not self.getIdle():
|
||||
# We cannot block here because we want to be able to
|
||||
# exit.
|
||||
diff -urNad fail2ban-0.7.8~/server/filterpoll.py fail2ban-0.7.8/server/filterpoll.py
|
||||
--- fail2ban-0.7.8~/server/filterpoll.py 2006-12-23 11:37:21.000000000 -0500
|
||||
+++ fail2ban-0.7.8/server/filterpoll.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
def run(self):
|
||||
self.setActive(True)
|
||||
- while self.isActive():
|
||||
+ while self._isActive():
|
||||
if not self.getIdle():
|
||||
# Get file modification
|
||||
for f in self.getLogPath():
|
||||
diff -urNad fail2ban-0.7.8~/server/jail.py fail2ban-0.7.8/server/jail.py
|
||||
--- fail2ban-0.7.8~/server/jail.py 2006-11-06 17:48:53.000000000 -0500
|
||||
+++ fail2ban-0.7.8/server/jail.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -89,10 +89,10 @@
|
||||
self.__filter.join()
|
||||
self.__action.join()
|
||||
|
||||
- def isActive(self):
|
||||
- isActive0 = self.__filter.isActive()
|
||||
- isActive1 = self.__action.isActive()
|
||||
- return isActive0 or isActive1
|
||||
+ def isAlive(self):
|
||||
+ isAlive0 = self.__filter.isAlive()
|
||||
+ isAlive1 = self.__action.isAlive()
|
||||
+ return isAlive0 or isAlive1
|
||||
|
||||
def setIdle(self, value):
|
||||
self.__filter.setIdle(value)
|
||||
diff -urNad fail2ban-0.7.8~/server/jailthread.py fail2ban-0.7.8/server/jailthread.py
|
||||
--- fail2ban-0.7.8~/server/jailthread.py 2006-10-24 15:38:42.000000000 -0400
|
||||
+++ fail2ban-0.7.8/server/jailthread.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -105,7 +105,7 @@
|
||||
# Check if the filter thread is running.
|
||||
# @return True if the thread is running
|
||||
|
||||
- def isActive(self):
|
||||
+ def _isActive(self):
|
||||
return self.__isRunning
|
||||
|
||||
##
|
||||
diff -urNad fail2ban-0.7.8~/server/server.py fail2ban-0.7.8/server/server.py
|
||||
--- fail2ban-0.7.8~/server/server.py 2007-03-26 17:43:18.000000000 -0400
|
||||
+++ fail2ban-0.7.8/server/server.py 2007-03-26 17:43:24.000000000 -0400
|
||||
@@ -96,7 +96,7 @@
|
||||
def startJail(self, name):
|
||||
try:
|
||||
self.__lock.acquire()
|
||||
- if not self.isActive(name):
|
||||
+ if not self.isAlive(name):
|
||||
self.__jails.get(name).start()
|
||||
finally:
|
||||
self.__lock.release()
|
||||
@@ -104,7 +104,7 @@
|
||||
def stopJail(self, name):
|
||||
try:
|
||||
self.__lock.acquire()
|
||||
- if self.isActive(name):
|
||||
+ if self.isAlive(name):
|
||||
self.__jails.get(name).stop()
|
||||
self.delJail(name)
|
||||
finally:
|
||||
@@ -118,8 +118,8 @@
|
||||
finally:
|
||||
self.__lock.release()
|
||||
|
||||
- def isActive(self, name):
|
||||
- return self.__jails.get(name).isActive()
|
||||
+ def isAlive(self, name):
|
||||
+ return self.__jails.get(name).isAlive()
|
||||
|
||||
def setIdleJail(self, name, value):
|
||||
self.__jails.get(name).setIdle(value)
|
Loading…
Reference in new issue