]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dnsbl.cpp
Fix REMOVE maxparams
[user/henk/code/inspircd.git] / src / modules / m_dnsbl.cpp
index f70496d687546221144edf4adec15c7c5a721bdd..a2964a0bd036e6d79dea66df57df56a154085438 100644 (file)
@@ -27,9 +27,9 @@
 class DNSBLConfEntry : public classbase
 {
        public:
-               enum EnumBanaction { I_UNKNOWN, I_KILL, I_ZLINE, I_KLINE, I_GLINE };
+               enum EnumBanaction { I_UNKNOWN, I_KILL, I_ZLINE, I_KLINE, I_GLINE, I_MARK };
                enum EnumType { A_RECORD, A_BITMASK };
-               std::string name, domain, reason;
+               std::string name, ident, host, domain, reason;
                EnumBanaction banaction;
                EnumType type;
                long duration;
@@ -107,6 +107,22 @@ class DNSBLResolver : public Resolver
                                                        ServerInstance->Users->QuitUser(them, std::string("Killed (") + reason + ")");
                                                        break;
                                                }
+                                               case DNSBLConfEntry::I_MARK:
+                                               {
+                                                       if (!ConfEntry->ident.empty())
+                                                       {
+                                                               them->WriteServ("304 " + them->nick + " :Your ident has been set to " + ConfEntry->ident + " because you matched " + reason);
+                                                               them->ChangeIdent(ConfEntry->ident.c_str());
+                                                       }
+
+                                                       if (!ConfEntry->host.empty())
+                                                       {
+                                                               them->WriteServ("304 " + them->nick + " :Your host has been set to " + ConfEntry->host + " because you matched " + reason);
+                                                               them->ChangeDisplayedHost(ConfEntry->host.c_str());
+                                                       }
+
+                                                       break;
+                                               }
                                                case DNSBLConfEntry::I_KLINE:
                                                {
                                                        KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
@@ -156,7 +172,7 @@ class DNSBLResolver : public Resolver
                                                break;
                                        }
 
-                                       ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost().c_str(), ConfEntry->name.c_str(), (ConfEntry->type==DNSBLConfEntry::A_BITMASK) ? bitmask : record);
+                                       ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost().c_str(), ConfEntry->domain.c_str(), (ConfEntry->type==DNSBLConfEntry::A_BITMASK) ? bitmask : record);
                                }
                                else
                                        ConfEntry->stats_misses++;
@@ -193,6 +209,8 @@ class ModuleDNSBL : public Module
                        return DNSBLConfEntry::I_ZLINE;
                if(action.compare("GLINE")==0)
                        return DNSBLConfEntry::I_GLINE;
+               if(action.compare("MARK")==0)
+                       return DNSBLConfEntry::I_MARK;
 
                return DNSBLConfEntry::I_UNKNOWN;
        }
@@ -236,6 +254,8 @@ class ModuleDNSBL : public Module
                        DNSBLConfEntry *e = new DNSBLConfEntry();
 
                        e->name = MyConf->ReadValue("dnsbl", "name", i);
+                       e->ident = MyConf->ReadValue("dnsbl", "ident", i);
+                       e->host = MyConf->ReadValue("dnsbl", "host", i);
                        e->reason = MyConf->ReadValue("dnsbl", "reason", i);
                        e->domain = MyConf->ReadValue("dnsbl", "domain", i);