1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 05:33:12 +02:00

Correctly assign nicks to their respective host servers

Use the "server token" parameter of NICK commands to find the host server and
correctly assign the nick name to this server.

This allows Anope to correctly free all nick names again when (remote) servers
leave the network, which fixes arbitrary "KILL attacks" when such nick names
reconnect later on.

Initial debugging and patch by DukePyrolator, thanks a lot!
This commit is contained in:
Alexander Barton
2014-11-30 21:50:11 +01:00
parent 95684187b6
commit d4732faf41
+8 -1
View File
@@ -448,7 +448,14 @@ struct IRCDMessageNick : IRCDMessage
else if (params.size() == 7)
{
// a new user is connecting to the network
User::OnIntroduce(params[0], params[2], params[3], "", "", source.GetServer(), params[6], Anope::CurTime, params[5], "", NULL);
Server *s = Server::Find(params[4]);
if (s == NULL)
{
Log(LOG_DEBUG) << "User " << params[0] << " introduced from nonexistant server " << params[4] << "?";
return;
}
User::OnIntroduce(params[0], params[2], params[3], "", "", s, params[6], Anope::CurTime, params[5], "", NULL);
Log(LOG_DEBUG) << "Registered nick \"" << params[0] << "\" on server " << s->GetName() << ".";
}
else
{