summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-23 13:40:52 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-23 13:40:52 +0000
commit5f309503fa985faa5b255246fc0415455c1c65ee (patch)
treec32399ea9ac0cdf7cb231e6ebab1436a379f1ece /src/modules
parentfcb51634669e6ed588e42f2072c6f910e267126f (diff)
m_dnsbl: Add default duration and error message on invalid duration
Before, this caused DNSBL hits to take no action, as the zlines expired before being applied. The default duration of 60 seconds exists only to make the bans work; a longer duration is recommended to reduce log noise. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11387 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_dnsbl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 9122486fc..134406e02 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -259,7 +259,7 @@ class ModuleDNSBL : public Module
}
e->banaction = str2banaction(MyConf->ReadValue("dnsbl", "action", i));
- e->duration = ServerInstance->Duration(MyConf->ReadValue("dnsbl", "duration", i));
+ e->duration = ServerInstance->Duration(MyConf->ReadValue("dnsbl", "duration", "60", i));
/* Use portparser for record replies */
@@ -280,6 +280,10 @@ class ModuleDNSBL : public Module
{
ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(#%d): Invalid banaction", i);
}
+ else if (e->duration <= 0)
+ {
+ ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(#%d): Invalid duration", i);
+ }
else
{
if (e->reason.empty())