diff --git a/CHANGELOG b/CHANGELOG index d954dec9..fa723d04 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ ver. 0.3.0 (02/??/2005) - alpha - Re-writting of parts of the code in order to handle several log files with different rules - Removed sshd.py because it is no more needed +- Fixed a bug when exiting with IP in the ban list ver. 0.1.2 (11/21/2004) - beta ---------- diff --git a/fail2ban.py b/fail2ban.py index a7adfd2d..3270a67b 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -43,8 +43,8 @@ from firewall.iptables import Iptables from firewall.ipfw import Ipfw from firewall.ipfwadm import Ipfwadm from logreader.logreader import LogReader -from version import version from confreader.configreader import ConfigReader +from version import version def usage(): print "Usage: fail2ban.py [OPTIONS]" @@ -173,7 +173,6 @@ if __name__ == "__main__": conf["background"] = False conf["debug"] = False conf["conffile"] = "/etc/fail2ban.conf" - conf["apachefile"] = "log-test/current" conf["logging"] = False conf["logfile"] = "/var/log/fail2ban.log" conf["maxretry"] = 3 @@ -360,7 +359,7 @@ if __name__ == "__main__": # Reads the config file and create a LogReader instance for # each log file to check. - confReader = ConfigReader(conf["conffile"]); + confReader = ConfigReader(logSys, conf["conffile"]); confReader.openConf() logList = list() for t in confReader.getSections(): @@ -399,9 +398,11 @@ if __name__ == "__main__": # last time, we sleep for 1 second. This is active # polling so not very effective. isModified = False + modList = list() for element in logList: if element.isModified(): isModified = True + modList.append(element) if not isModified: time.sleep(conf["polltime"]) @@ -409,7 +410,7 @@ if __name__ == "__main__": # Gets the failure list from the log file. failList = dict() - for element in logList: + for element in modList: failList.update(element.getFailures()) # We iterate the failure list and ban IP that make