From 897fa5791128a9797157584a04af9b7a66924655 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 5 Oct 2008 00:42:36 +0000 Subject: Some more safety checks to catch out invalid client introductions (e.g. from atheme when its too old (for some reason its no longer checking the protocol ID for this)) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10623 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/uid.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 0aaabfd81..9ddc154c6 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -48,13 +48,22 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque &pa this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Unknown server "+source+")"); return true; } - /* Check parameters for validity before introducing the client, discovered by dmb */ - if (!age_t) + else if (!age_t) { this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid TS?)"); return true; } + else if (!signon) + { + this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid signon?)"); + return true; + } + else if (params[8][0] != '+') + { + this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Malformed MODE sequence?)"); + return true; + } /* check for collision */ user_hash::iterator iter = this->ServerInstance->Users->clientlist->find(params[2]); -- cgit v1.2.3