Merge branch 'master' of https://github.com/fail2ban/fail2ban into ban-time-incr

pull/716/head
sebres 2014-06-06 19:46:38 +02:00
commit 70080b112a
3 changed files with 8 additions and 6 deletions

View File

@ -28,6 +28,8 @@ ver. 0.9.1 (2014/xx/xx) - better, faster, stronger
* Recursive action tags now fully processed. Fixes issue with bsd-ipfw * Recursive action tags now fully processed. Fixes issue with bsd-ipfw
action action
* Correct times for non-timezone date times formats - Thanks sebres * Correct times for non-timezone date times formats - Thanks sebres
* Fixed TypeError with "ipfailures" and "ipjailfailures" action tags.
Thanks Serg G. Brester
- New features: - New features:
- Added monit filter thanks Jason H Martin. - Added monit filter thanks Jason H Martin.

View File

@ -271,11 +271,9 @@ class Actions(JailThread, Mapping):
# [todo] move merging to observer - here we could read already merged info from database (faster); # [todo] move merging to observer - here we could read already merged info from database (faster);
if self._jail.database is not None: if self._jail.database is not None:
aInfo["ipmatches"] = lambda jail=self._jail: "\n".join( aInfo["ipmatches"] = lambda jail=self._jail: "\n".join(
jail.database.getBansMerged(ip=ip).getMatches() jail.database.getBansMerged(ip=ip).getMatches())
)
aInfo["ipjailmatches"] = lambda jail=self._jail: "\n".join( aInfo["ipjailmatches"] = lambda jail=self._jail: "\n".join(
jail.database.getBansMerged(ip=ip, jail=jail).getMatches() jail.database.getBansMerged(ip=ip, jail=jail).getMatches())
)
aInfo["ipfailures"] = lambda jail=self._jail: \ aInfo["ipfailures"] = lambda jail=self._jail: \
jail.database.getBansMerged(ip=ip).getAttempt() jail.database.getBansMerged(ip=ip).getAttempt()
aInfo["ipjailfailures"] = lambda jail=self._jail: \ aInfo["ipjailfailures"] = lambda jail=self._jail: \

View File

@ -795,8 +795,10 @@ class FileContainer:
try: try:
line = line.decode(self.getEncoding(), 'strict') line = line.decode(self.getEncoding(), 'strict')
except UnicodeDecodeError: except UnicodeDecodeError:
logSys.warning("Error decoding line from '%s' with '%s': %s" % logSys.warning(
(self.getFileName(), self.getEncoding(), `line`)) "Error decoding line from '%s' with '%s'. Continuing "
" to process line ignoring invalid characters: %r" %
(self.getFileName(), self.getEncoding(), line))
if sys.version_info >= (3,): # In python3, must be decoded if sys.version_info >= (3,): # In python3, must be decoded
line = line.decode(self.getEncoding(), 'ignore') line = line.decode(self.getEncoding(), 'ignore')
return line return line