diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-06 08:48:50 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-06 08:48:50 +0200 |
commit | 258a481bface1b98f93699d292805c11f0e6d898 (patch) | |
tree | 2b81a0479f865f6ac227507ed14c59d9a3c1bd1d | |
parent | 0e118bb789b8830af06842d715d5206554b6e0d9 (diff) |
m_spanningtree Forward NICK messages when they cause a collision with the new nick param rewritten to the uuid
Suppressing these messages meant that we relied on an appropriate NICK to
come from the direction the SAVE was sent to; this left all servers behind
us uninformed until the target server of the SAVE reacted with a nick change
to uuid.
This was problematic because someone can legitimately change nick to the
past nick of the SAVEd user on a server that already has the SAVEd user
with the uuid nick and that nick change message can reach servers that
haven't yet seen the nick change to uuid of the SAVEd user.
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 5007fe921..a2ae1aad0 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -445,6 +445,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, * On nick messages, check that the nick doesnt already exist here. * If it does, perform collision logic. */ + bool callfnc = true; User* x = ServerInstance->FindNickOnly(params[0]); if ((x) && (x != who)) { @@ -453,15 +454,14 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, collideret = this->DoCollision(x, who->age, who->ident, who->GetIPString(), who->uuid); if (collideret != 1) { - /* - * Remote client lost, or both lost, parsing or passing on this - * nickchange would be pointless, as the incoming client's server will - * soon recieve SVSNICK to change its nick to its UID. :) -- w00t - */ - return; + // Remote client lost, or both lost, rewrite this nick change as a change to uuid before + // forwarding and don't call ForceNickChange() because DoCollision() has done it already + params[0] = who->uuid; + callfnc = false; } } - who->ForceNickChange(params[0].c_str()); + if (callfnc) + who->ForceNickChange(params[0].c_str()); Utils->RouteCommand(route_back_again, command, params, who); } else |