From 8ec4e1189e0eb904473c1b7fcaa99e800e93911b Mon Sep 17 00:00:00 2001 From: sebres Date: Mon, 30 May 2016 15:34:21 +0200 Subject: [PATCH] use raw host (don't use textToIp) if usedns exactly `raw`, because `usedns = no` should ignore no ip failures --- config/jail.conf | 1 + fail2ban/server/filter.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/jail.conf b/config/jail.conf index cea9a06e..941737ff 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -94,6 +94,7 @@ backend = auto # but it will be logged as a warning. # no: if a hostname is encountered, will not be used for banning, # but it will be logged as info. +# raw: use raw value (no hostname), allow use it for no-host filters/actions (example user) usedns = warn # "logencoding" specifies the encoding of the log files handled by the jail diff --git a/fail2ban/server/filter.py b/fail2ban/server/filter.py index 1e751057..3901fae9 100644 --- a/fail2ban/server/filter.py +++ b/fail2ban/server/filter.py @@ -523,7 +523,7 @@ class Filter(JailThread): self.__lineBuffer = failRegex.getUnmatchedTupleLines() try: host = failRegex.getHost() - if returnRawHost or self.__useDns not in ("yes", "warn"): + if returnRawHost or self.__useDns == "raw": failList.append([failRegexIndex, host, date, failRegex.getMatchedLines()]) if not checkAllRegex: