]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Made xline notices neater when notifying of unknown connections
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 29 Apr 2005 07:33:07 +0000 (07:33 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 29 Apr 2005 07:33:07 +0000 (07:33 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1258 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp
src/xline.cpp

index 369c1f4c41d146e3d59226ed41a7dc905b85a1b3..b1aedde73132f856334235d52ce0967fff4b1969 100644 (file)
@@ -4087,14 +4087,13 @@ int InspIRCd(void)
                                                        if (current->registered == 7)
                                                        {
                                                                kill_link(current,"RecvQ exceeded");
-                                                               goto label;
                                                        }
                                                        else
                                                        {
                                                                add_zline(120,ServerName,"Flood from unregistered connection",current->ip);
                                                                apply_lines();
-                                                               goto label;
                                                        }
+                                                       goto label;
                                                }
                                                // while there are complete lines to process...
                                                while (current->BufferIsReady())
@@ -4102,9 +4101,17 @@ int InspIRCd(void)
                                                        floodlines++;
                                                        if ((floodlines > current->flood) && (current->flood != 0))
                                                        {
-                                                               log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
-                                                               WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
-                                                               kill_link(current,"Excess flood");
+                                                               if (current->registered == 7)
+                                                               {
+                                                                       log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+                                                                       WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+                                                                       kill_link(current,"Excess flood");
+                                                               }
+                                                               else
+                                                               {
+                                                                       add_zline(120,ServerName,"Flood from unregistered connection",current->ip);
+                                                                       apply_lines();
+                                                               }
                                                                goto label;
                                                        }
                                                        char sanitized[MAXBUF];
index 0e625bb52ad11db626cfaa205484863a678c1cbb..35ebc50f38b1384f051a6e0ca93ee4b462c8eec3 100644 (file)
@@ -663,7 +663,7 @@ void apply_lines()
                                        char* check = matches_gline(host);
                                        if (check)
                                        {
-                                               WriteOpers("*** User %s matches G-Line: %s",u->second->nick,check);
+                                               WriteOpers("*** User %s matches G-Line: %s",u->registered == 7 ? u->second->nick:"<unknown>",check);
                                                snprintf(reason,MAXBUF,"G-Lined: %s",check);
                                                kill_link(u->second,reason);
                                                go_again = true;
@@ -675,7 +675,7 @@ void apply_lines()
                                        char* check = matches_kline(host);
                                        if (check)
                                        {
-                                               WriteOpers("*** User %s matches K-Line: %s",u->second->nick,check);
+                                               WriteOpers("*** User %s matches K-Line: %s",u->registered == 7 ? u->second->nick:"<unknown>",check);
                                                snprintf(reason,MAXBUF,"K-Lined: %s",check);
                                                kill_link(u->second,reason);
                                                go_again = true;
@@ -688,7 +688,7 @@ void apply_lines()
                                        if (check)
                                        {
                                                snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check);
-                                               WriteOpers("*** Q-Lined nickname %s from %s: %s",u->second->nick,u->second->host,check);
+                                               WriteOpers("*** Q-Lined nickname %s from %s: %s",u->registered == 7 ? u->second->nick:"<unknown>",u->second->host,check);
                                                kill_link(u->second,reason);
                                                go_again = true;
                                                break;
@@ -700,7 +700,7 @@ void apply_lines()
                                        if (check)
                                        {
                                                snprintf(reason,MAXBUF,"Z-Lined: %s",check);
-                                               WriteOpers("*** User %s matches Z-Line: %s",u->second->nick,u->second->host,check);
+                                               WriteOpers("*** User %s matches Z-Line: %s",u->registered == 7 ? u->second->nick:"<unknown>",u->second->host,check);
                                                kill_link(u->second,reason);
                                                go_again = true;
                                                break;