fix ban-time correction of restored tickets, could be set to persistent (-1) if increment allowed and no maxtime was specified.

pull/2125/merge
sebres 2018-07-06 15:53:42 +02:00
parent 9de1657aab
commit 6e40cb12ab
1 changed files with 1 additions and 1 deletions

View File

@ -806,7 +806,7 @@ class Fail2BanDb(object):
if bantime == -2: # todo: remove it in future version
bantime = jail.actions.getBanTime() if jail is not None else (
correctBanTime if correctBanTime else 600)
elif correctBanTime:
elif correctBanTime and correctBanTime >= 0:
# if persistent ban (or greater as max), use current max-bantime of the jail:
if bantime == -1 or bantime > correctBanTime:
bantime = correctBanTime