]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / users.cpp
index 0f6cba2da7135c7d79a557e6a961c656c3dbf3ed..5f495aafbfc8f5e65c993ee7e929a407018d311a 100644 (file)
@@ -37,9 +37,9 @@ std::string User::ProcessNoticeMasks(const char *sm)
                                adding = false;
                        break;
                        case '*':
-                               for (unsigned char d = 'A'; d <= 'z'; d++)
+                               for (unsigned char d = 'a'; d <= 'z'; d++)
                                {
-                                       if (ServerInstance->SNO->IsEnabled(d))
+                                       if (!ServerInstance->SNO->masks[d - 'a'].Description.empty())
                                        {
                                                if ((!IsNoticeMaskSet(d) && adding) || (IsNoticeMaskSet(d) && !adding))
                                                {
@@ -50,12 +50,23 @@ std::string User::ProcessNoticeMasks(const char *sm)
 
                                                        output += d;
                                                }
+                                               oldadding = adding;
+                                               char u = toupper(d);
+                                               if ((!IsNoticeMaskSet(u) && adding) || (IsNoticeMaskSet(u) && !adding))
+                                               {
+                                                       if ((oldadding != adding) || (!output.length()))
+                                                               output += (adding ? '+' : '-');
+
+                                                       this->SetNoticeMask(u, adding);
+
+                                                       output += u;
+                                               }
+                                               oldadding = adding;
                                        }
-                                       oldadding = adding;
                                }
                        break;
                        default:
-                               if ((*c >= 'A') && (*c <= 'z') && (ServerInstance->SNO->IsEnabled(*c)))
+                               if (isalpha(*c))
                                {
                                        if ((!IsNoticeMaskSet(*c) && adding) || (IsNoticeMaskSet(*c) && !adding))
                                        {
@@ -716,10 +727,11 @@ void LocalUser::CheckClass()
        if (!a)
        {
                ServerInstance->Users->QuitUser(this, "Access denied by configuration");
+               return;
        }
        else if (a->type == CC_DENY)
        {
-               ServerInstance->Users->QuitUser(this, "Unauthorised connection");
+               ServerInstance->Users->QuitUser(this, a->config->getString("reason", "Unauthorised connection"));
                return;
        }
        else if ((a->GetMaxLocal()) && (ServerInstance->Users->LocalCloneCount(this) > a->GetMaxLocal()))
@@ -804,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.
@@ -1008,7 +1023,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);
@@ -1381,7 +1396,9 @@ void User::DoHostCycle(const std::string &quitline)
                {
                        for(unsigned int i=0; i < memb->modes.length(); i++)
                                modeline.append(" ").append(nick);
-                       snprintf(buffer, MAXBUF, ":%s MODE %s +%s", GetFullHost().c_str(), c->name.c_str(), modeline.c_str());
+                       snprintf(buffer, MAXBUF, ":%s MODE %s +%s",
+                               ServerInstance->Config->CycleHostsFromUser ? GetFullHost().c_str() : ServerInstance->Config->ServerName.c_str(),
+                               c->name.c_str(), modeline.c_str());
                        modeline = buffer;
                }
 
@@ -1608,7 +1625,7 @@ void LocalUser::SetClass(const std::string &explicit_name)
                                        continue;
                        }
 
-                       if (!c->config->getString("pass").empty())
+                       if (regdone && !c->config->getString("pass").empty())
                        {
                                if (ServerInstance->PassCompare(this, c->config->getString("pass"), password, c->config->getString("hash")))
                                {