]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Switch m_dnsbl to use its own snomask character.
authorPeter Powell <petpow@saberuk.com>
Tue, 7 Aug 2018 15:50:01 +0000 (16:50 +0100)
committerPeter Powell <petpow@saberuk.com>
Tue, 7 Aug 2018 15:50:01 +0000 (16:50 +0100)
docs/conf/helpop-full.conf.example
src/modules/m_dnsbl.cpp

index 6d0ea10e99d12c57bb08ff56bd095b214006b58a..840db56d543569801d7003c1560d2ca03cee2b10 100644 (file)
@@ -1047,6 +1047,8 @@ Note that all /STATS use is broadcast to online IRC operators.">
  A      Allows receipt of remote announcement messages.
  c      Allows receipt of local connect messages.
  C      Allows receipt of remote connect messages.
+ d      Allows recript of local DNSBL messages.
+ D      Allows recript of remote DNSBL messages.
  f      Allows receipt of flooding notices.
  g      Allows receipt of globops (requires the globops module).
  j      Allows receipt of channel creation notices (requires the chancreate module).
index e0a827f0442494080817fa98b111e37d5d492401..606feed1025c4d1203aef8d9b4625012a036e6ac 100644 (file)
@@ -74,7 +74,7 @@ class DNSBLResolver : public DNS::Request
                // All replies should be in 127.0.0.0/8
                if (ans_record->rdata.compare(0, 4, "127.") != 0)
                {
-                       ServerInstance->SNO->WriteGlobalSno('a', "DNSBL: %s returned address outside of acceptable subnet 127.0.0.0/8: %s", ConfEntry->domain.c_str(), ans_record->rdata.c_str());
+                       ServerInstance->SNO->WriteGlobalSno('d', "DNSBL: %s returned address outside of acceptable subnet 127.0.0.0/8: %s", ConfEntry->domain.c_str(), ans_record->rdata.c_str());
                        ConfEntry->stats_misses++;
                        return;
                }
@@ -200,7 +200,7 @@ class DNSBLResolver : public DNS::Request
                                        break;
                        }
 
-                       ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s%s detected as being on a DNS blacklist (%s) with result %d", them->nick.empty() ? "<unknown>" : "", them->GetFullRealHost().c_str(), ConfEntry->domain.c_str(), (ConfEntry->type==DNSBLConfEntry::A_BITMASK) ? bitmask : record);
+                       ServerInstance->SNO->WriteGlobalSno('d', "Connecting user %s%s detected as being on a DNS blacklist (%s) with result %d", them->nick.empty() ? "<unknown>" : "", them->GetFullRealHost().c_str(), ConfEntry->domain.c_str(), (ConfEntry->type==DNSBLConfEntry::A_BITMASK) ? bitmask : record);
                }
                else
                        ConfEntry->stats_misses++;
@@ -255,6 +255,11 @@ class ModuleDNSBL : public Module, public Stats::EventListener
        {
        }
 
+       void init() CXX11_OVERRIDE
+       {
+               ServerInstance->SNO->EnableSnomask('d', "DNSBL");
+       }
+
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides handling of DNS blacklists", VF_VENDOR);
@@ -302,29 +307,29 @@ class ModuleDNSBL : public Module, public Stats::EventListener
                        if ((e->bitmask <= 0) && (DNSBLConfEntry::A_BITMASK == e->type))
                        {
                                std::string location = tag->getTagLocation();
-                               ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): invalid bitmask", location.c_str());
+                               ServerInstance->SNO->WriteGlobalSno('d', "DNSBL(%s): invalid bitmask", location.c_str());
                        }
                        else if (e->name.empty())
                        {
                                std::string location = tag->getTagLocation();
-                               ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): Invalid name", location.c_str());
+                               ServerInstance->SNO->WriteGlobalSno('d', "DNSBL(%s): Invalid name", location.c_str());
                        }
                        else if (e->domain.empty())
                        {
                                std::string location = tag->getTagLocation();
-                               ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): Invalid domain", location.c_str());
+                               ServerInstance->SNO->WriteGlobalSno('d', "DNSBL(%s): Invalid domain", location.c_str());
                        }
                        else if (e->banaction == DNSBLConfEntry::I_UNKNOWN)
                        {
                                std::string location = tag->getTagLocation();
-                               ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): Invalid banaction", location.c_str());
+                               ServerInstance->SNO->WriteGlobalSno('d', "DNSBL(%s): Invalid banaction", location.c_str());
                        }
                        else
                        {
                                if (e->reason.empty())
                                {
                                        std::string location = tag->getTagLocation();
-                                       ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): empty reason, using defaults", location.c_str());
+                                       ServerInstance->SNO->WriteGlobalSno('d', "DNSBL(%s): empty reason, using defaults", location.c_str());
                                        e->reason = "Your IP has been blacklisted.";
                                }