mirror of https://github.com/fail2ban/fail2ban
- Propagated patches from Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_6@449 a942ae1a-1317-0410-a47c-b1dcaea8d6050.6
parent
adf7827efd
commit
8a253db9b5
10
CHANGELOG
10
CHANGELOG
|
@ -4,12 +4,16 @@
|
|||
|_| \__,_|_|_/___|_.__/\__,_|_||_|
|
||||
|
||||
=============================================================
|
||||
Fail2Ban (version 0.6.?) 2006/??/??
|
||||
Fail2Ban (version 0.6.2) 2006/??/??
|
||||
=============================================================
|
||||
|
||||
ver. 0.6.? (2006/??/??) - ???
|
||||
ver. 0.6.2 (2006/??/??) - ???
|
||||
----------
|
||||
- Fixed UTF-8 log file parsing
|
||||
- Propagated patches introduced by Debian maintainer
|
||||
(Yaroslav Halchenko):
|
||||
* Made locale configurable
|
||||
* Fixed warning if ignoreip is empty
|
||||
|
||||
ver. 0.6.1 (2006/03/16) - stable
|
||||
----------
|
||||
|
@ -26,7 +30,7 @@ ver. 0.6.1 (2006/03/16) - stable
|
|||
- Added parsing of timestamp in TAI64N format (#1275325).
|
||||
Thanks to Mark Edgington
|
||||
- Added patch #1382936 (Default formatted syslog logging).
|
||||
Thanks to Patrick Börjesson
|
||||
Thanks to Patrick B<EFBFBD>rjesson
|
||||
- Removed 192.168.0.0/16 from ignoreip. Attacks could also
|
||||
come from the local network.
|
||||
- Robust startup: if iptables module does not get fully
|
||||
|
|
|
@ -11,6 +11,15 @@
|
|||
#
|
||||
background = false
|
||||
|
||||
# Option: locale
|
||||
# Notes.: global (cannot be redefined per section) locale to use for
|
||||
# timestamp pattern matching by changing LC_TIME for
|
||||
# fail2ban process. Empty entry sets locale to default one
|
||||
# (usually specified by LC_ALL environment variable).
|
||||
# Values: LOCALE Default:
|
||||
#
|
||||
locale =
|
||||
|
||||
# Option: logtargets
|
||||
# Notes.: log targets. Space separated list of logging targets.
|
||||
# Values: STDERR SYSLOG file Default: /var/log/fail2ban.log
|
||||
|
|
|
@ -11,6 +11,15 @@
|
|||
#
|
||||
background = false
|
||||
|
||||
# Option: locale
|
||||
# Notes.: global (cannot be redefined per section) locale to use for
|
||||
# timestamp pattern matching by changing LC_TIME for
|
||||
# fail2ban process. Empty entry sets locale to default one
|
||||
# (usually specified by LC_ALL environment variable).
|
||||
# Values: LOCALE Default:
|
||||
#
|
||||
locale =
|
||||
|
||||
# Option: logtargets
|
||||
# Notes.: log targets. Space separated list of logging targets.
|
||||
# Values: STDERR SYSLOG file Default: /var/log/fail2ban.log
|
||||
|
|
|
@ -11,6 +11,15 @@
|
|||
#
|
||||
background = false
|
||||
|
||||
# Option: locale
|
||||
# Notes.: global (cannot be redefined per section) locale to use for
|
||||
# timestamp pattern matching by changing LC_TIME for
|
||||
# fail2ban process. Empty entry sets locale to default one
|
||||
# (usually specified by LC_ALL environment variable).
|
||||
# Values: LOCALE Default:
|
||||
#
|
||||
locale =
|
||||
|
||||
# Option: logtargets
|
||||
# Notes.: log targets. Space separated list of logging targets.
|
||||
# Values: STDERR SYSLOG file Default: /var/log/fail2ban.log
|
||||
|
|
9
fail2ban
9
fail2ban
|
@ -26,14 +26,7 @@ __date__ = "$Date$"
|
|||
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
|
||||
__license__ = "GPL"
|
||||
|
||||
import sys, traceback, logging, locale
|
||||
|
||||
# Set the locale with the user's default setting
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
except Exception:
|
||||
print "Unable to set locale to " + `locale.getdefaultlocale()`
|
||||
sys.exit(-1)
|
||||
import sys, traceback, logging
|
||||
|
||||
# Inserts our own modules path first in the list
|
||||
# fix for bug #343821
|
||||
|
|
16
fail2ban.py
16
fail2ban.py
|
@ -25,7 +25,8 @@ __date__ = "$Date$"
|
|||
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
|
||||
__license__ = "GPL"
|
||||
|
||||
import time, sys, getopt, os, string, signal, logging, logging.handlers, copy
|
||||
import time, sys, getopt, os, string, signal, logging, logging.handlers, \
|
||||
copy, locale
|
||||
from ConfigParser import *
|
||||
|
||||
from version import version
|
||||
|
@ -217,6 +218,7 @@ def main():
|
|||
["str", "syslog-target", "/dev/log"],
|
||||
["int", "syslog-facility", 1],
|
||||
["str", "pidlock", "/var/run/fail2ban.pid"],
|
||||
["str", "locale", ""],
|
||||
["int", "maxfailures", 5],
|
||||
["int", "bantime", 600],
|
||||
["int", "findtime", 600],
|
||||
|
@ -236,6 +238,14 @@ def main():
|
|||
# PID lock
|
||||
pidLock.setPath(conf["pidlock"])
|
||||
|
||||
# Set the LC_TIME with the user's default setting
|
||||
try:
|
||||
logSys.info("Setting LC_TIME locale option to '%s'"%conf["locale"])
|
||||
locale.setlocale(locale.LC_TIME, conf["locale"])
|
||||
except Exception:
|
||||
logSys.error("Unable to set locale to '%s'"%conf["locale"])
|
||||
sys.exit(-1)
|
||||
|
||||
# Now we can kill properly a running instance if needed
|
||||
if conf["kill"]:
|
||||
pid = pidLock.exists()
|
||||
|
@ -326,7 +336,9 @@ def main():
|
|||
"ONLY DISPLAYED IN THE LOG MESSAGES")
|
||||
|
||||
# Ignores IP list
|
||||
ignoreIPList = conf["ignoreip"].split(' ')
|
||||
# and filter out empty entries. Otherwise
|
||||
# WARNING: is not a valid IP address
|
||||
ignoreIPList = filter(None, conf["ignoreip"].split(' '))
|
||||
|
||||
# Checks for root user. This is necessary because log files
|
||||
# are owned by root and firewall needs root access.
|
||||
|
|
Loading…
Reference in New Issue