]> jfr.im git - solanum.git/blobdiff - modules/core/m_server.c
Unify oper:{global,local}_kill
[solanum.git] / modules / core / m_server.c
index ad8f66a986849f02c4358922602c5e08615c63a3..850a67d8d0d90eccc3d8650341f62df594d21ea8 100644 (file)
@@ -208,6 +208,15 @@ mr_server(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
                        exit_client(client_p, client_p, client_p, "Invalid certificate.");
                }
 
+               return;
+       case -7:
+               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                    "Connection from servername %s rejected, no more connections allowed in class",
+                    name);
+               ilog(L_SERVER, "Access denied, no more connections allowed in class for %s",
+                    log_client_name(client_p, SHOW_IP));
+
+               exit_client(client_p, client_p, client_p, "Access denied, no more connections allowed in class");
                return;
        default:
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
@@ -287,22 +296,25 @@ mr_server(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
                return;
        }
 
-       if(has_id(client_p) && (target_p = find_id(client_p->id)) != NULL)
-       {
-               sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL,
-                                    "Attempt to re-introduce SID %s from %s%s (already in use by %s)",
-                                    client_p->id,
-                                    EmptyString(client_p->name) ? name : "",
-                                    client_p->name, target_p->name);
-               ilog(L_SERVER, "Attempt to re-introduce SID %s from %s%s (already in use by %s)",
-                               client_p->id,
-                               EmptyString(client_p->name) ? name : "",
-                               log_client_name(client_p, SHOW_IP),
-                               target_p->name);
-
-               sendto_one(client_p, "ERROR :SID already exists.");
-               exit_client(client_p, client_p, client_p, "SID Exists");
-               return;
+       if (client_p->preClient && !EmptyString(client_p->preClient->id)) {
+               if ((target_p = find_id(client_p->preClient->id)) != NULL) {
+                       sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL,
+                                       "Attempt to re-introduce SID %s from %s%s (already in use by %s)",
+                                       client_p->preClient->id,
+                                       EmptyString(client_p->name) ? name : "",
+                                       client_p->name, target_p->name);
+                       ilog(L_SERVER, "Attempt to re-introduce SID %s from %s%s (already in use by %s)",
+                                       client_p->preClient->id,
+                                       EmptyString(client_p->name) ? name : "",
+                                       log_client_name(client_p, SHOW_IP),
+                                       target_p->name);
+
+                       sendto_one(client_p, "ERROR :SID already exists.");
+                       exit_client(client_p, client_p, client_p, "SID Exists");
+                       return;
+               } else {
+                       rb_strlcpy(client_p->id, client_p->preClient->id, sizeof(client_p->id));
+               }
        }
 
        /*