From 99838440c8a7cb8c55d2479f6bf5fa32c8fc3640 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 28 Nov 2013 23:18:34 +1100 Subject: [PATCH] DOC: document rational behind 20 character jail name limit --- ChangeLog | 2 ++ server/jail.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58f8f84ae..e94a13382 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,8 @@ ver. 0.8.12 (2013/12/XX) - things-can-only-get-better - allow for ", referer ..." in apache-* filter for apache error logs. - allow for spaces at the beginning of kernel messages. Closes gh-448 - recidive jail to block all protocols. Closes gh-440. Thanks Ioan Indreias + - long names on jails documented based on iptables limit of 30 less + len("fail2ban-"). - New Features: diff --git a/server/jail.py b/server/jail.py index 5e60ec7fc..7ce12e468 100644 --- a/server/jail.py +++ b/server/jail.py @@ -102,9 +102,11 @@ class Jail: self.__filter = FilterPyinotify(self) def setName(self, name): + # 20 based on iptable chain name limit of 30 less len('fail2ban-') if len(name) >= 20: - logSys.warning("Jail name %r might be too long and some commands " - "might not function correctly. Please shorten" + logSys.warning("Jail name %r might be too long and some commands" + " (e.g. iptables) might not function correctly." + " Please shorten" % name) self.__name = name