From 5f309503fa985faa5b255246fc0415455c1c65ee Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 23 May 2009 13:40:52 +0000 Subject: [PATCH] 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 --- src/modules/m_dnsbl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()) -- 2.39.5