]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Close the link that sends an invalid UID.
authorJilles Tjoelker <redacted>
Sat, 6 Sep 2008 13:13:28 +0000 (15:13 +0200)
committerJilles Tjoelker <redacted>
Sat, 6 Sep 2008 13:13:28 +0000 (15:13 +0200)
It does not make sense to send a kill using an invlid
identifier to an obviously broken server, as was
previously done.

modules/core/m_nick.c

index 7d0996c6587c028904c77394942fec1973e05d8d..292d5ca5df5c0ee55ea41913a597593d433f2db3 100644 (file)
@@ -404,6 +404,7 @@ ms_uid(struct Client *client_p, struct Client *source_p, int parc, const char *p
 {
        struct Client *target_p;
        time_t newts = 0;
+       char squitreason[120];
 
        newts = atol(parv[3]);
 
@@ -425,23 +426,22 @@ ms_uid(struct Client *client_p, struct Client *source_p, int parc, const char *p
                return 0;
        }
 
-       if(!clean_username(parv[5]) || !clean_host(parv[6]))
+       if(!clean_uid(parv[8]))
        {
-               ServerStats.is_kill++;
-               sendto_realops_snomask(SNO_DEBUG, L_ALL,
-                                    "Bad user@host: %s@%s From: %s(via %s)",
-                                    parv[5], parv[6], source_p->name, client_p->name);
-               sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)", me.id, parv[8], me.name);
+               rb_snprintf(squitreason, sizeof squitreason,
+                               "Invalid UID %s for nick %s on %s",
+                               parv[8], parv[1], source_p->name);
+               exit_client(client_p, client_p, client_p, squitreason);
                return 0;
        }
 
-       if(!clean_uid(parv[8]))
+       if(!clean_username(parv[5]) || !clean_host(parv[6]))
        {
                ServerStats.is_kill++;
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
-                                    "Bad UID: %s From: %s(via %s)",
-                                    parv[8], source_p->name, client_p->name);
-               sendto_one(client_p, ":%s KILL %s :%s (Bad UID)", me.id, parv[8], me.name);
+                                    "Bad user@host: %s@%s From: %s(via %s)",
+                                    parv[5], parv[6], source_p->name, client_p->name);
+               sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)", me.id, parv[8], me.name);
                return 0;
        }
 
@@ -492,6 +492,7 @@ ms_euid(struct Client *client_p, struct Client *source_p, int parc, const char *
 {
        struct Client *target_p;
        time_t newts = 0;
+       char squitreason[120];
 
        newts = atol(parv[3]);
 
@@ -513,23 +514,22 @@ ms_euid(struct Client *client_p, struct Client *source_p, int parc, const char *
                return 0;
        }
 
-       if(!clean_username(parv[5]) || !clean_host(parv[6]))
+       if(!clean_uid(parv[8]))
        {
-               ServerStats.is_kill++;
-               sendto_realops_snomask(SNO_DEBUG, L_ALL,
-                                    "Bad user@host: %s@%s From: %s(via %s)",
-                                    parv[5], parv[6], source_p->name, client_p->name);
-               sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)", me.id, parv[8], me.name);
+               rb_snprintf(squitreason, sizeof squitreason,
+                               "Invalid UID %s for nick %s on %s",
+                               parv[8], parv[1], source_p->name);
+               exit_client(client_p, client_p, client_p, squitreason);
                return 0;
        }
 
-       if(!clean_uid(parv[8]))
+       if(!clean_username(parv[5]) || !clean_host(parv[6]))
        {
                ServerStats.is_kill++;
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
-                                    "Bad UID: %s From: %s(via %s)",
-                                    parv[8], source_p->name, client_p->name);
-               sendto_one(client_p, ":%s KILL %s :%s (Bad UID)", me.id, parv[8], me.name);
+                                    "Bad user@host: %s@%s From: %s(via %s)",
+                                    parv[5], parv[6], source_p->name, client_p->name);
+               sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)", me.id, parv[8], me.name);
                return 0;
        }