if (ELines.empty())
return;
- for (std::vector<LocalUser*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ for (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
{
User* u = (User*)(*u2);
}
else
{
- n.first = "";
+ n.first.clear();
n.second = ident_and_host;
}
LookupIter i = x->second.find(line->Displayable());
if (i != x->second.end())
{
- return false;
+ // XLine propagation bug was here, if the line to be added already exists and
+ // it's expired then expire it and add the new one instead of returning false
+ if ((!i->second->duration) || (ServerInstance->Time() < i->second->expiry))
+ return false;
+
+ ExpireLine(x, i);
}
}
void ELine::Unset()
{
/* remove exempt from everyone and force recheck after deleting eline */
- for (std::vector<LocalUser*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ for (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
{
User* u = (User*)(*u2);
u->exempt = false;
// applies lines, removing clients and changing nicks etc as applicable
void XLineManager::ApplyLines()
{
- std::vector<LocalUser*>::reverse_iterator u2 = ServerInstance->Users->local_users.rbegin();
+ LocalUserList::reverse_iterator u2 = ServerInstance->Users->local_users.rbegin();
while (u2 != ServerInstance->Users->local_users.rend())
{
User* u = *u2++;
for(unsigned int i=0; i < sizeof(gekqz); i++)
{
XLineFactory* xlf = GetFactory(std::string(1, gekqz[i]));
- if (xlf)
- UnregisterFactory(xlf);
delete xlf;
}
{
delete j->second;
}
- i->second.clear();
}
- lookup_lines.clear();
-
}
void XLine::Apply(User* u)
if (bancache)
{
- ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString());
+ ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString());
if (this->duration > 0)
ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason, this->duration);
else
void ELine::OnAdd()
{
/* When adding one eline, only check the one eline */
- for (std::vector<LocalUser*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ for (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
{
User* u = (User*)(*u2);
if (this->Matches(u))