X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fxline.cpp;h=accffb8d0ebaf7ba0181f69b506ed3f2c2f59b86;hb=6a0155101e09ecf48858d73dab17400777cbe668;hp=fbb4f0c8b47aeb6045e77b56f74e979c5b83378d;hpb=9b25df31096f889e3653ab100493133014d4fe73;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index fbb4f0c8b..accffb8d0 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -446,9 +446,9 @@ void XLineManager::ExpireLine(ContainerIter container, LookupIter item, bool sil void XLineManager::ApplyLines() { const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); - for (UserManager::LocalList::const_iterator j = list.begin(); j != list.end(); ++j) + for (UserManager::LocalList::const_iterator j = list.begin(); j != list.end(); ) { - LocalUser* u = *j; + LocalUser* u = *j++; // Don't ban people who are exempt. if (u->exempt) @@ -458,7 +458,14 @@ void XLineManager::ApplyLines() { XLine *x = *i; if (x->Matches(u)) + { x->Apply(u); + + // If applying the X-line has killed the user then don't + // apply any more lines to them. + if (u->quitting) + break; + } } } @@ -560,7 +567,7 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache) if (bancache) { ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString()); - ServerInstance->BanCache.AddHit(u->GetIPString(), this->type, banReason, this->duration); + ServerInstance->BanCache.AddHit(u->GetIPString(), this->type, banReason, (this->duration > 0 ? (this->expiry - ServerInstance->Time()) : 0)); } }