class DNSBLConfEntry : public classbase
{
public:
- enum EnumBanaction { I_UNKNOWN, I_KILL, I_ZLINE, I_KLINE, I_GLINE, I_CIDENT };
+ 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;
ServerInstance->Users->QuitUser(them, std::string("Killed (") + reason + ")");
break;
}
- case DNSBLConfEntry::I_CIDENT:
+ case DNSBLConfEntry::I_MARK:
{
- them->WriteServ("304 " + them->nick + " :Your ident has been set to " + ConfEntry->name + " because you matched " + reason);
- them->ChangeIdent(ConfEntry->name.c_str());
+ 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:
"*", them->GetIPString());
if (ServerInstance->XLines->AddLine(kl,NULL))
{
- ServerInstance->SNO->WriteToSnoMask('x',"m_dnsbl added K:line on *@%s to expire on %s (%s).",
+ ServerInstance->SNO->WriteGlobalSno('x',"K:line added due to DNSBL match on *@%s to expire on %s: %s",
them->GetIPString(), ServerInstance->TimeString(kl->expiry).c_str(), reason.c_str());
ServerInstance->XLines->ApplyLines();
}
"*", them->GetIPString());
if (ServerInstance->XLines->AddLine(gl,NULL))
{
- ServerInstance->SNO->WriteToSnoMask('x',"m_dnsbl added G:line on *@%s to expire on %s (%s).",
+ ServerInstance->SNO->WriteGlobalSno('x',"G:line added due to DNSBL match on *@%s to expire on %s: %s",
them->GetIPString(), ServerInstance->TimeString(gl->expiry).c_str(), reason.c_str());
ServerInstance->XLines->ApplyLines();
}
them->GetIPString());
if (ServerInstance->XLines->AddLine(zl,NULL))
{
- ServerInstance->SNO->WriteToSnoMask('x',"m_dnsbl added Z:line on *@%s to expire on %s (%s).",
+ ServerInstance->SNO->WriteGlobalSno('x',"Z:line added due to DNSBL match on *@%s to expire on %s: %s",
them->GetIPString(), ServerInstance->TimeString(zl->expiry).c_str(), reason.c_str());
ServerInstance->XLines->ApplyLines();
}
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++;
return DNSBLConfEntry::I_ZLINE;
if(action.compare("GLINE")==0)
return DNSBLConfEntry::I_GLINE;
- if(action.compare("IDENT")==0)
- return DNSBLConfEntry::I_CIDENT;
-
+ if(action.compare("MARK")==0)
+ return DNSBLConfEntry::I_MARK;
return DNSBLConfEntry::I_UNKNOWN;
}
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);