]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fix bug #83
[user/henk/code/inspircd.git] / src / users.cpp
index 8aeb4a1f6318ac6ed70a0ac79b3b353cbd223b68..5ff890fd7f1072e3e09e0f971e2c88c97d46f68a 100644 (file)
@@ -113,6 +113,8 @@ void LocalUser::StartDNSLookup()
        catch (CoreException& e)
        {
                ServerInstance->Logs->Log("USERS", DEBUG,"Error in resolver: %s",e.GetReason());
+               dns_done = true;
+               ServerInstance->stats->statsDnsBad++;
        }
 }
 
@@ -511,9 +513,6 @@ eol_found:
                if (user->quitting)
                        return;
        }
-       // Add pseudo-penalty so that we continue processing after sendq recedes
-       if (user->CommandFloodPenalty == 0 && getSendQSize() >= sendqmax)
-               user->CommandFloodPenalty++;
        if (user->CommandFloodPenalty >= penaltymax && !user->MyClass->fakelag)
                ServerInstance->Users->QuitUser(user, "Excess Flood");
 }
@@ -649,7 +648,7 @@ void OperInfo::init()
                        {
                                this->AllowedUserModes.set();
                        }
-                       else
+                       else if (*c >= 'A' && *c < 'z')
                        {
                                this->AllowedUserModes[*c - 'A'] = true;
                        }
@@ -661,7 +660,7 @@ void OperInfo::init()
                        {
                                this->AllowedChanModes.set();
                        }
-                       else
+                       else if (*c >= 'A' && *c < 'z')
                        {
                                this->AllowedChanModes[*c - 'A'] = true;
                        }
@@ -782,6 +781,7 @@ void LocalUser::FullConnect()
         * may put the user into a totally seperate class with different restrictions! so we *must* check again.
         * Don't remove this! -- w00t
         */
+       MyClass = NULL;
        SetClass();
        CheckClass();
        CheckLines();
@@ -816,6 +816,9 @@ void LocalUser::FullConnect()
        if (!MOD_RESULT)
                ServerInstance->CallCommandHandler(command, parameters, this);
 
+       if (ServerInstance->Config->RawLog)
+               WriteServ("PRIVMSG %s :*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded.", nick.c_str());
+
        /*
         * We don't set REG_ALL until triggering OnUserConnect, so some module events don't spew out stuff
         * for a user that doesn't exist yet.
@@ -830,6 +833,8 @@ void LocalUser::FullConnect()
                this->GetServerPort(), this->nick.c_str(), this->ident.c_str(), this->host.c_str(), this->GetIPString(), this->fullname.c_str());
        ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding NEGATIVE hit for %s", this->GetIPString());
        ServerInstance->BanCache->AddHit(this->GetIPString(), "", "");
+       // reset the flood penalty (which could have been raised due to things like auto +x)
+       CommandFloodPenalty = 0;
 }
 
 void User::InvalidateCache()
@@ -1020,7 +1025,7 @@ void LocalUser::Write(const std::string& text)
                return;
        }
 
-       ServerInstance->Logs->Log("USEROUTPUT", DEBUG,"C[%s] O %s", uuid.c_str(), text.c_str());
+       ServerInstance->Logs->Log("USEROUTPUT", RAWIO, "C[%s] O %s", uuid.c_str(), text.c_str());
 
        eh.AddWriteBuf(text);
        eh.AddWriteBuf(wide_newline);
@@ -1622,9 +1627,9 @@ void LocalUser::SetClass(const std::string &explicit_name)
                                        continue;
                        }
 
-                       if (!c->config->getString("pass").empty())
+                       if (regdone && !c->config->getString("password").empty())
                        {
-                               if (ServerInstance->PassCompare(this, c->config->getString("pass"), password, c->config->getString("hash")))
+                               if (ServerInstance->PassCompare(this, c->config->getString("password"), password, c->config->getString("hash")))
                                {
                                        ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Bad password, skipping");
                                        continue;
@@ -1706,6 +1711,9 @@ ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask, cons
 
 void ConnectClass::Update(const ConnectClass* src)
 {
+       config = src->config;
+       type = src->type;
+       fakelag = src->fakelag;
        name = src->name;
        registration_timeout = src->registration_timeout;
        host = src->host;
@@ -1714,7 +1722,9 @@ void ConnectClass::Update(const ConnectClass* src)
        hardsendqmax = src->hardsendqmax;
        recvqmax = src->recvqmax;
        penaltythreshold = src->penaltythreshold;
+       commandrate = src->commandrate;
        maxlocal = src->maxlocal;
        maxglobal = src->maxglobal;
+       maxchans = src->maxchans;
        limit = src->limit;
 }