- Fixed some bugs

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@363 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.x
Cyril Jaquier 2006-09-17 22:31:55 +00:00
parent f3a90b9021
commit 2bcf1bb359
2 changed files with 7 additions and 11 deletions

View File

@ -131,7 +131,7 @@ class BanManager:
def addBanTicket(self, ticket):
try:
self.lock.acquire()
if not self.inBanList(ticket):
if not self.__inBanList(ticket):
self.banList.append(ticket)
self.banTotal += 1
return True
@ -168,15 +168,11 @@ class BanManager:
# @param ticket the ticket
# @return True if a ticket already exists
def inBanList(self, ticket):
try:
self.lock.acquire()
for i in self.banList:
if ticket.getIP() == i.getIP():
return True
return False
finally:
self.lock.release()
def __inBanList(self, ticket):
for i in self.banList:
if ticket.getIP() == i.getIP():
return True
return False
##
# Get the list of IP address to unban.

View File

@ -118,7 +118,7 @@ class FailManager:
for ip in self.failList:
data = self.failList[ip]
if data.getRetry() >= self.maxRetry:
self.delFailure(ip)
self.__delFailure(ip)
# Create a FailTicket from BanData
failTicket = FailTicket(ip, data.getLastTime())
failTicket.setAttempt(data.getRetry())