From 9c2f9ec9a2520a74f4878370a18e55fe34414e0a Mon Sep 17 00:00:00 2001 From: jilles Date: Wed, 28 Mar 2007 07:30:10 -0700 Subject: [PATCH] [svn] Merge old trunk r2226: If we are connecting outward to a server, check if the server name they sent is the same as what we tried to connect to. Previously such a connection could succeed if there existed connect blocks with the same IP and passwords for the other server name. --- ChangeLog | 13 +++++++++++++ include/serno.h | 2 +- modules/core/m_server.c | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83e36fb..a5d1c74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +jilles 2007/03/28 14:21:37 UTC (20070328-3289) + Log: + Merge old trunk r2212: + Another handling of SJOINs without nicks: + Propagate them if the channel is +P or the channel + already existed, otherwise remove the channel again + and do not propagate the SJOIN. + + + Changes: Modified: + +2 -3 trunk/modules/core/m_sjoin.c (File Modified) + + jilles 2007/03/28 13:49:57 UTC (20070328-3287) Log: Remove channels entirely from /whois on services. diff --git a/include/serno.h b/include/serno.h index 93edded..17cb958 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070328-3287" +#define SERNO "20070328-3289" 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 */