Merge pull request #3 from yarikoptic/enh/use_dns

let's be consistent ;-)
pull/27/head
leeclemens 2012-01-10 16:32:22 -08:00
commit c429f5c91a
5 changed files with 13 additions and 13 deletions

View File

@ -65,7 +65,7 @@ class JailReader(ConfigReader):
["int", "maxretry", 3],
["int", "findtime", 600],
["int", "bantime", 600],
["string", "use_dns", "warn"],
["string", "usedns", "warn"],
["string", "failregex", None],
["string", "ignoreregex", None],
["string", "ignoreip", None],
@ -123,8 +123,8 @@ class JailReader(ConfigReader):
stream.append(["set", self.__name, "findtime", self.__opts[opt]])
elif opt == "bantime":
stream.append(["set", self.__name, "bantime", self.__opts[opt]])
elif opt == "use_dns":
stream.append(["set", self.__name, "use_dns", self.__opts[opt]])
elif opt == "usedns":
stream.append(["set", self.__name, "usedns", self.__opts[opt]])
elif opt == "failregex":
stream.append(["set", self.__name, "addfailregex", self.__opts[opt]])
elif opt == "ignoreregex":

View File

@ -62,7 +62,7 @@ protocol = [
["set <JAIL> delignoreregex <INDEX>", "removes the regular expression at <INDEX> for ignoreregex"],
["set <JAIL> findtime <TIME>", "sets the number of seconds <TIME> for which the filter will look back for <JAIL>"],
["set <JAIL> bantime <TIME>", "sets the number of seconds <TIME> a host will be banned for <JAIL>"],
["set <JAIL> use_dns <VALUE>", "sets the use_dns mode for <JAIL>"],
["set <JAIL> usedns <VALUE>", "sets the usedns mode for <JAIL>"],
["set <JAIL> banip <IP>", "manually Ban <IP> for <JAIL>"],
["set <JAIL> maxretry <RETRY>", "sets the number of failures <RETRY> before banning the host for <JAIL>"],
["set <JAIL> addaction <ACT>", "adds a new action named <NAME> for <JAIL>"],
@ -81,7 +81,7 @@ protocol = [
["get <JAIL> ignoreregex", "gets the list of regular expressions which matches patterns to ignore for <JAIL>"],
["get <JAIL> findtime", "gets the time for which the filter will look back for failures for <JAIL>"],
["get <JAIL> bantime", "gets the time a host is banned for <JAIL>"],
["get <JAIL> use_dns", "gets the use_dns setting for <JAIL>"],
["get <JAIL> usedns", "gets the usedns setting for <JAIL>"],
["get <JAIL> maxretry", "gets the number of failures allowed for <JAIL>"],
["get <JAIL> addaction", "gets the last action which has been added for <JAIL>"],
["get <JAIL> actionstart <ACT>", "gets the start command for the action <ACT> for <JAIL>"],

View File

@ -38,7 +38,7 @@ maxretry = 3
# pyinotify, gamin, polling.
backend = auto
# "use_dns" specifies if jails should trust hostnames in logs,
# "usedns" specifies if jails should trust hostnames in logs,
# warn when reverse DNS lookups are performed, or ignore all hostnames in logs
#
# yes: if a hostname is encountered, a reverse DNS lookup will be performed.
@ -46,7 +46,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.
use_dns = warn
usedns = warn
# This jail corresponds to the standard configuration in Fail2ban 0.6.

View File

@ -143,14 +143,14 @@ class Filter(JailThread):
##
# Set the Use DNS mode
# @param value the use_dns mode
# @param value the usedns mode
def setUseDns(self, value):
self.__useDns = value
##
# Get the use_dns mode
# @return the use_dns mode
# Get the usedns mode
# @return the usedns mode
def getUseDns(self):
return self.__useDns
@ -586,7 +586,7 @@ class DNSUtils:
if useDns == "no":
return None
else:
logSys.debug("use_dns = %s" % useDns)
logSys.debug("usedns = %s" % useDns)
ipList = list()
# Search for plain IP
plainIP = DNSUtils.searchIP(text)

View File

@ -154,7 +154,7 @@ class Transmitter:
value = int(command[2])
self.__server.delIgnoreRegex(name, value)
return self.__server.getIgnoreRegex(name)
elif command[1] == "use_dns":
elif command[1] == "usedns":
value = command[2]
self.__server.setUseDns(name, value)
return self.__server.getUseDns(name)
@ -235,7 +235,7 @@ class Transmitter:
return self.__server.getFailRegex(name)
elif command[1] == "ignoreregex":
return self.__server.getIgnoreRegex(name)
elif command[1] == "use_dns":
elif command[1] == "usedns":
return self.__server.getUseDns(name)
elif command[1] == "findtime":
return self.__server.getFindTime(name)