]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_dnsbl: Add default duration and error message on invalid duration
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 23 May 2009 13:40:52 +0000 (13:40 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 23 May 2009 13:40:52 +0000 (13:40 +0000)
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

index 9122486fc86fd2e8953420453d596ffffb60c5a9..134406e02317d4c810ae6005004a087ab497a7e8 100644 (file)
@@ -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())