From 7d7250484c352c13830e63ae41ee8faae40a9bd5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 25 May 2008 17:30:43 +0000 Subject: First phase of conversion to dynamic limits on all the lengths, configured via the tag (the tag isnt there yet, these all just run on defaults in the class constructor) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9802 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/uid.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/modules/m_spanningtree/uid.cpp') diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 70f7b874c..d84ee2a04 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -48,9 +48,6 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque &pa time_t signon = ConvToInt(params[8]); 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 + 1}, {"GECOS", 9, MAXGECOS}, {"", 0, 0} }; - TreeServer* remoteserver = Utils->FindServer(source); if (!remoteserver) @@ -66,16 +63,6 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque &pa return true; } - for (size_t x = 0; valid[x].length; ++x) - { - if (params[valid[x].param].length() > valid[x].length) - { - this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (" + valid[x].item + " > " + ConvToStr(valid[x].length) + ")"); - return true; - } - } - - /* check for collision */ user_hash::iterator iter = this->Instance->Users->clientlist->find(params[2]); @@ -109,12 +96,12 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque &pa } (*(this->Instance->Users->clientlist))[params[2]] = _new; _new->SetFd(FD_MAGIC_NUMBER); - _new->nick.assign(params[2], 0, NICKMAX - 1); + _new->nick.assign(params[2], 0, MAXBUF); _new->host.assign(params[3], 0, 64); _new->dhost.assign(params[4], 0, 64); _new->server = this->Instance->FindServerNamePtr(remoteserver->GetName().c_str()); - _new->ident.assign(params[5], 0, IDENTMAX + 1); - _new->fullname.assign(params[9], 0, MAXGECOS); + _new->ident.assign(params[5], 0, MAXBUF); + _new->fullname.assign(params[9], 0, MAXBUF); _new->registered = REG_ALL; _new->signon = signon; _new->age = age_t; -- cgit v1.3.1-10-gc9f91