X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/b0b7de54b122c7b4cb7b1ccdee1835a6d57afe8b..8d19a2b257b9d7c119a56a9112ae839a274f8850:/modules/core/m_server.c diff --git a/modules/core/m_server.c b/modules/core/m_server.c index f6fb2b4..bc64f3b 100644 --- a/modules/core/m_server.c +++ b/modules/core/m_server.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_server.c 3179 2007-02-01 00:34:33Z jilles $ + * $Id: m_server.c 3291 2007-03-28 14:30:10Z jilles $ */ #include "stdinc.h" @@ -59,7 +59,7 @@ struct Message sid_msgtab = { mapi_clist_av1 server_clist[] = { &server_msgtab, &sid_msgtab, NULL }; -DECLARE_MODULE_AV1(server, NULL, NULL, server_clist, NULL, NULL, "$Revision: 3179 $"); +DECLARE_MODULE_AV1(server, NULL, NULL, server_clist, NULL, NULL, "$Revision: 3291 $"); int bogus_host(const char *host); static int set_server_gecos(struct Client *, const char *); @@ -83,6 +83,17 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char hop = atoi(parv[2]); strlcpy(info, parv[3], sizeof(info)); + if (IsHandshake(client_p) && irccmp(client_p->name, name)) + { + sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL, + "Server %s has unexpected name %s", + get_server_name(client_p, HIDE_IP), name); + ilog(L_SERVER, "Server %s has unexpected name %s", + log_client_name(client_p, SHOW_IP), name); + exit_client(client_p, client_p, client_p, "Server name mismatch"); + return 0; + } + /* * Reject a direct nonTS server connection if we're TS_ONLY -orabidoo */