]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/uid.cpp
See this brain
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / uid.cpp
index 73648fb9d69b76996f2cebc8ded41b4a3b56d1e6..0d53701f2b22b319574d960c0e911a8eb366552f 100644 (file)
@@ -38,18 +38,19 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
         */
        if (params.size() != 10)
        {
-               this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction ("+params[0]+" with only "+
-                               ConvToStr(params.size())+" of 10 parameters?)");
+               if (!params.empty())
+                       this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction ("+params[0]+" with only "+
+                                       ConvToStr(params.size())+" of 10 parameters?)");
                return true;
        }
 
-       time_t age = ConvToInt(params[1]);
+       time_t age_t = ConvToInt(params[1]);
        time_t signon = ConvToInt(params[8]);
        const char* tempnick = params[2].c_str();
        std::string empty;
 
        /* XXX probably validate UID length too -- w00t */
-       cmd_validation valid[] = { {"Nickname", 2, NICKMAX}, {"Hostname", 3, 64}, {"Displayed hostname", 4, 64}, {"Ident", 5, IDENTMAX}, {"GECOS", 9, MAXGECOS}, {"", 0, 0} };
+       cmd_validation valid[] = { {"Nickname", 2, NICKMAX}, {"Hostname", 3, 64}, {"Displayed hostname", 4, 64}, {"Ident", 5, IDENTMAX + 1}, {"GECOS", 9, MAXGECOS}, {"", 0, 0} };
 
        TreeServer* remoteserver = Utils->FindServer(source);
 
@@ -60,7 +61,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
        }
 
        /* Check parameters for validity before introducing the client, discovered by dmb */
-       if (!age)
+       if (!age_t)
        {
                this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid TS?)");
                return true;
@@ -84,8 +85,8 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
                /*
                 * Nick collision.
                 */
-               Instance->Log(DEBUG,"*** Collision on %s", tempnick);
-               int collide = this->DoCollision(iter->second, age, params[5].c_str(), params[7].c_str(), params[0].c_str());
+               Instance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", tempnick);
+               int collide = this->DoCollision(iter->second, age_t, params[5].c_str(), params[7].c_str(), params[0].c_str());
 
                if (collide == 2)
                {
@@ -117,7 +118,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
        strlcpy(_new->fullname, params[9].c_str(),MAXGECOS);
        _new->registered = REG_ALL;
        _new->signon = signon;
-       _new->age = age;
+       _new->age = age_t;
 
        /* we need to remove the + from the modestring, so we can do our stuff */
        std::string::size_type pos_after_plus = params[6].find_first_not_of('+');