Don't allow remote servers to send messages to our &channels (Bug #721494)
authorMichael Poole <mdpoole@troilus.org>
Sat, 11 Sep 2004 17:00:50 +0000 (17:00 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 11 Sep 2004 17:00:50 +0000 (17:00 +0000)
Rework of Kev's patch to do the same fix.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1126 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/ircd_relay.c
ircd/m_wallchops.c
ircd/m_wallvoices.c

index 80ee62d92e3066f1562f89f98f7a0e02ff8f0d82..cad64ac4d40bff901719d473609e8e479384b5c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-09-11  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/ircd_relay.c (server_relay_channel_message,
+       server_relay_channel_notice): Do not allow other servers to send
+       or relay to local channels.
+
+       * ircd/m_wallchops (ms_wallchops): Likewise.
+
+       * ircd/m_wallvoices (ms_wallvoices): Likewise.
+
 2004-09-11  Kevin L Mitchell  <klmitch@mit.edu>
 
        * ircd/gline.c (gline_add): fix GLINE logging (Bug #750927)
index 3ac0850e3a9ef1bf8a645a8a7431d898a06c612a..f2bf04dfdca6e638f29b6ecb1756f28219058143 100644 (file)
@@ -110,7 +110,7 @@ void server_relay_channel_message(struct Client* sptr, const char* name, const c
   assert(0 != name);
   assert(0 != text);
 
-  if (0 == (chptr = FindChannel(name))) {
+  if (IsLocalChannel(name) || 0 == (chptr = FindChannel(name))) {
     /*
      * XXX - do we need to send this back from a remote server?
      */
@@ -136,7 +136,7 @@ void server_relay_channel_notice(struct Client* sptr, const char* name, const ch
   assert(0 != name);
   assert(0 != text);
 
-  if (0 == (chptr = FindChannel(name)))
+  if (IsLocalChannel(name) || 0 == (chptr = FindChannel(name)))
     return;
   /*
    * This first: Almost never a server/service
index b569c83892631e26ff1251d0fa2f03d36e82af71..d9732be9ebcf698170d8da549b3e2a9fe2ce0e25 100644 (file)
@@ -143,7 +143,7 @@ int ms_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[
   if (parc < 3 || !IsUser(sptr))
     return 0;
 
-  if ((chptr = FindChannel(parv[1]))) {
+  if (!IsLocalChannel(parv[1]) && (chptr = FindChannel(parv[1]))) {
     if (client_can_send_to_channel(sptr, chptr, 0)) {
       sendcmdto_channel_butone(sptr, CMD_WALLCHOPS, chptr, cptr,
                               SKIP_DEAF | SKIP_BURST | SKIP_NONOPS,
index a92267478b91e865d50042f30e98ba023a620096..4dfad262dc6cd4500e21b708e7b54173b7460717 100644 (file)
@@ -142,7 +142,7 @@ int ms_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv
   if (parc < 3 || !IsUser(sptr))
     return 0;
 
-  if ((chptr = FindChannel(parv[1]))) {
+  if (!IsLocalChannel(parv[1]) && (chptr = FindChannel(parv[1]))) {
     if (client_can_send_to_channel(sptr, chptr, 0)) {
       sendcmdto_channel_butone(sptr, CMD_WALLVOICES, chptr, cptr,
                               SKIP_DEAF | SKIP_BURST | SKIP_NONVOICES,