]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Some more safety checks to catch out invalid client introductions (e.g. from atheme...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 5 Oct 2008 00:42:36 +0000 (00:42 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 5 Oct 2008 00:42:36 +0000 (00:42 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10623 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/uid.cpp

index 0aaabfd81a0077a5c98f722fde0f12baae31268a..9ddc154c6c4e697f13ef0fe45d7a99e6445629c9 100644 (file)
@@ -48,13 +48,22 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &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]);