#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <stdint.h>
#endif
/* $ModDesc: Provides handling of DNS blacklists */
case DNSBLConfEntry::I_KLINE:
{
std::string ban = std::string("*@") + them->GetIPString();
+ if (show)
+ ServerInstance->XLines->apply_lines(APPLY_KLINES);
show = ServerInstance->XLines->add_kline(ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), ban.c_str());
FOREACH_MOD(I_OnAddKLine,OnAddKLine(ConfEntry->duration, NULL, reason, ban));
break;
{
std::string ban = std::string("*@") + them->GetIPString();
show = ServerInstance->XLines->add_gline(ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), ban.c_str());
+ if (show)
+ ServerInstance->XLines->apply_lines(APPLY_GLINES);
FOREACH_MOD(I_OnAddGLine,OnAddGLine(ConfEntry->duration, NULL, reason, ban));
break;
}
case DNSBLConfEntry::I_ZLINE:
{
show = ServerInstance->XLines->add_zline(ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), them->GetIPString());
+ if (show)
+ ServerInstance->XLines->apply_lines(APPLY_ZLINES);
FOREACH_MOD(I_OnAddZLine,OnAddZLine(ConfEntry->duration, NULL, reason, them->GetIPString()));
break;
}
}
if (show)
+ {
ServerInstance->WriteOpers("*** Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask);
+ }
}
else
ConfEntry->stats_misses++;
e->reason = MyConf->ReadValue("dnsbl", "reason", i);
e->domain = MyConf->ReadValue("dnsbl", "domain", i);
e->banaction = str2banaction(MyConf->ReadValue("dnsbl", "action", i));
- e->duration = ServerInstance->Duration(MyConf->ReadValue("dnsbl", "duration", i).c_str());
+ e->duration = ServerInstance->Duration(MyConf->ReadValue("dnsbl", "duration", i));
e->bitmask = MyConf->ReadInteger("dnsbl", "bitmask", i, false);
/* yeah, logic here is a little messy */
{
ServerInstance->WriteOpers("*** DNSBL(#%d): invalid bitmask",i);
}
- else if (e->name == "")
+ else if (e->name.empty())
{
ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid name",i);
}
- else if (e->domain == "")
+ else if (e->domain.empty())
{
ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid domain",i);
}
}
else
{
- if (e->reason == "")
+ if (e->reason.empty())
{
ServerInstance->WriteOpers("*** DNSBL(#%d): empty reason, using defaults",i);
e->reason = "Your IP has been blacklisted.";