Handle join requests for too-long channel names.
authorMichael Poole <mdpoole@troilus.org>
Thu, 6 Oct 2005 23:58:09 +0000 (23:58 +0000)
committerMichael Poole <mdpoole@troilus.org>
Thu, 6 Oct 2005 23:58:09 +0000 (23:58 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1518 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_join.c

index f73ce256842bbd0dd6a67dafc9d1c131ef7904d7..7377e55f5e5d57516cf2fcc1bd13d7c32ed31050 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-06  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/m_join.c (m_join): Report too-long channel names as
+       non-existent.
+
 2005-10-05  Michael Poole <mdpoole@troilus.org>
 
        * ircd/m_names.c (m_names): Fix format string when forwarding
index 091562bfca904fa04acde883fbef782122bd2ee3..66b1a5835e58fa0550d6ed4f601aabe728ad5352 100644 (file)
@@ -41,6 +41,7 @@
 #include "s_debug.h"
 #include "s_user.h"
 #include "send.h"
+#include "sys.h"
 
 /* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <stdlib.h>
@@ -156,7 +157,8 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     }
 
     if (!(chptr = FindChannel(name))) {
-      if ((name[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS)) {
+      if (((name[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS))
+          || strlen(name) >= IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN))) {
         send_reply(sptr, ERR_NOSUCHCHANNEL, name);
         continue;
       }