From 8e2f50ab779bcd903dbe46a5f11c4ee5ceb0730b Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 8 Dec 2005 20:21:43 +0000 Subject: [PATCH] Added 'fake direction' check git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2278 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index ce2843d18..a98e90add 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1629,6 +1629,23 @@ class TreeSocket : public InspSocket // This is the 'authenticated' state, when all passwords // have been exchanged and anything past this point is taken // as gospel. + + if (prefix != "") + { + std::string direction = prefix; + userrec* t = Srv->FindNick(prefix); + if (t) + { + direction = t->server; + } + TreeServer* route_back_again = BestRouteTo(direction); + if ((!route_back_again) || (back_again->GetSocket() != this)) + { + WriteOpers("*** \2WARNING\2! Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName()); + return true; + } + } + if (command == "SVSMODE") { /* Services expects us to implement -- 2.39.5