From: <los...@us...> - 2007-01-29 21:47:05
|
Revision: 535 http://svn.sourceforge.net/fail2ban/?rev=535&view=rev Author: lostcontrol Date: 2007-01-29 13:46:59 -0800 (Mon, 29 Jan 2007) Log Message: ----------- - Added IP list in "status <JAIL>". Thanks to Eric Gerbier Modified Paths: -------------- trunk/CHANGELOG trunk/README trunk/client/beautifier.py trunk/server/actions.py trunk/server/banmanager.py trunk/server/failmanager.py trunk/server/filter.py Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/CHANGELOG 2007-01-29 21:46:59 UTC (rev 535) @@ -18,6 +18,7 @@ - Added file support to fail2ban-regex. Benchmark feature has been removed - Added cacti script and template. +- Added IP list in "status <JAIL>". Thanks to Eric Gerbier ver. 0.7.6 (2007/01/04) - beta ---------- Modified: trunk/README =================================================================== --- trunk/README 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/README 2007-01-29 21:46:59 UTC (rev 535) @@ -73,7 +73,7 @@ Jonathan Kamens, Stephen Gildea, Markus Hoffmann, Mark Edgington, Patrick Börjesson, kojiro, zugeschmiert, Tyler, Nick Munger, Christoph Haas, Justin Shore, Joël Bertrand, -René Berber, mEDI, Axel Thimm +René Berber, mEDI, Axel Thimm, Eric Gerbier License: -------- Modified: trunk/client/beautifier.py =================================================================== --- trunk/client/beautifier.py 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/client/beautifier.py 2007-01-29 21:46:59 UTC (rev 535) @@ -70,11 +70,13 @@ if len(inC) > 1: msg = "Status for the jail: " + inC[1] + "\n" msg = msg + "|- " + response[0][0] + "\n" - msg = msg + "| |- " + response[0][1][0][0] + ":\t\t" + `response[0][1][0][1]` + "\n" - msg = msg + "| `- " + response[0][1][1][0] + ":\t\t" + `response[0][1][1][1]` + "\n" + msg = msg + "| |- " + response[0][1][0][0] + ":\t" + `response[0][1][0][1]` + "\n" + msg = msg + "| | `- " + response[0][1][2][0] + ":\t" + `response[0][1][2][1]` + "\n" + msg = msg + "| `- " + response[0][1][1][0] + ":\t" + `response[0][1][1][1]` + "\n" msg = msg + "`- " + response[1][0] + "\n" - msg = msg + " |- " + response[1][1][0][0] + ":\t\t" + `response[1][1][0][1]` + "\n" - msg = msg + " `- " + response[1][1][1][0] + ":\t\t" + `response[1][1][1][1]` + msg = msg + " |- " + response[1][1][0][0] + ":\t" + `response[1][1][0][1]` + "\n" + msg = msg + " | `- " + response[1][1][2][0] + ":\t" + `response[1][1][2][1]` + "\n" + msg = msg + " `- " + response[1][1][1][0] + ":\t" + `response[1][1][1][1]` else: msg = "Status\n" msg = msg + "|- " + response[0][0] + ":\t" + `response[0][1]` + "\n" Modified: trunk/server/actions.py =================================================================== --- trunk/server/actions.py 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/server/actions.py 2007-01-29 21:46:59 UTC (rev 535) @@ -189,6 +189,6 @@ def status(self): ret = [("Currently banned", self.__banManager.size()), - ("Total banned", self.__banManager.getBanTotal())] + ("Total banned", self.__banManager.getBanTotal()), + ("IP list", self.__banManager.getBanList())] return ret - \ No newline at end of file Modified: trunk/server/banmanager.py =================================================================== --- trunk/server/banmanager.py 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/server/banmanager.py 2007-01-29 21:46:59 UTC (rev 535) @@ -100,7 +100,19 @@ return self.__banTotal finally: self.__lock.release() + + ## + # Returns a copy of the IP list. + # + # @return IP list + def getBanList(self): + try: + self.__lock.acquire() + return list(self.__banList) + finally: + self.__lock.release() + ## # Create a ban ticket. # Modified: trunk/server/failmanager.py =================================================================== --- trunk/server/failmanager.py 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/server/failmanager.py 2007-01-29 21:46:59 UTC (rev 535) @@ -77,6 +77,18 @@ finally: self.__lock.release() + ## + # Returns a copy of the IP list. + # + # @return IP list + + def getBanList(self): + try: + self.__lock.acquire() + return list(self.__failList) + finally: + self.__lock.release() + def addFailure(self, ticket): self.__lock.acquire() ip = ticket.getIP() Modified: trunk/server/filter.py =================================================================== --- trunk/server/filter.py 2007-01-29 20:51:43 UTC (rev 534) +++ trunk/server/filter.py 2007-01-29 21:46:59 UTC (rev 535) @@ -463,7 +463,8 @@ def status(self): ret = [("Currently failed", self.failManager.size()), - ("Total failed", self.failManager.getFailTotal())] + ("Total failed", self.failManager.getFailTotal()), + ("IP List", self.failManager.getBanList())] return ret This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |