]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ident.cpp
m_kicknorejoin Store and compare uuids instead pointers
[user/henk/code/inspircd.git] / src / modules / m_ident.cpp
index e8f3144641b931b70f487dd0748c506867163bcf..f1c3b81fdebadb6e415533d47afe17b325c6815f 100644 (file)
@@ -235,14 +235,20 @@ class IdentRequestSocket : public EventHandler
                 */
                ibuf[recvresult] = '\0';
                std::string buf(ibuf);
-               std::string::size_type lastcolon = buf.rfind(':');
-               if (lastcolon == std::string::npos)
+
+               /* <2 colons: invalid
+                *  2 colons: reply is an error
+                * >3 colons: there is a colon in the ident
+                */
+               if (std::count(buf.begin(), buf.end(), ':') != 3)
                        return;
 
+               std::string::size_type lastcolon = buf.rfind(':');
+
                /* Truncate the ident at any characters we don't like, skip leading spaces */
                for (std::string::const_iterator i = buf.begin()+lastcolon+1; i != buf.end(); ++i)
                {
-                       if (result.size()+1 == ServerInstance->Config->Limits.IdentMax)
+                       if (result.size() == ServerInstance->Config->Limits.IdentMax)
                                /* Ident is getting too long */
                                break;
 
@@ -274,6 +280,7 @@ class ModuleIdent : public Module
 
        void init()
        {
+               ServerInstance->Modules->AddService(ext);
                OnRehash(NULL);
                Implementation eventlist[] = {
                        I_OnRehash, I_OnUserInit, I_OnCheckReady,