Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-10-06 23:49:35 UTC

Modified files:
     ChangeLog ircd/channel.c ircd/m_join.c

Log message:

Handle join requests for too-long channel names.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.721 ircu2.10/ChangeLog:1.722
--- ircu2.10/ChangeLog:1.721    Wed Oct  5 21:00:36 2005
+++ ircu2.10/ChangeLog  Thu Oct  6 16:49:25 2005
@@ -1,3 +1,10 @@
+2005-10-06  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/channel.c (clean_channelname): Delete unused function.
+
+       * ircd/m_join.c (m_join): Report too-long channel names as
+       non-existent.
+
 2005-10-05  Michael Poole <[EMAIL PROTECTED]>
 
        * ircd/m_names.c (m_names): Fix format string when forwarding
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.155 ircu2.10/ircd/channel.c:1.156
--- ircu2.10/ircd/channel.c:1.155       Mon Sep 26 19:41:57 2005
+++ ircu2.10/ircd/channel.c     Thu Oct  6 16:49:25 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.155 2005/09/27 02:41:57 entrope Exp $
+ * @version $Id: channel.c,v 1.156 2005/10/06 23:49:25 entrope Exp $
  */
 #include "config.h"
 
@@ -1181,34 +1181,6 @@
   send_reply(cptr, RPL_ENDOFBANLIST, chptr->chname);
 }
 
-/** Remove bells and commas from channel name
- *
- * @param cn   Channel name to clean, modified in place.
- */
-void clean_channelname(char *cn)
-{
-  int i;
-
-  for (i = 0; cn[i]; i++) {
-    if (i >= IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN))
-        || !IsChannelChar(cn[i])) {
-      cn[i] = '\0';
-      return;
-    }
-    if (IsChannelLower(cn[i])) {
-      cn[i] = ToLower(cn[i]);
-#ifndef FIXME
-      /*
-       * Remove for .08+
-       * toupper(0xd0)
-       */
-      if ((unsigned char)(cn[i]) == 0xd0)
-        cn[i] = (char) 0xf0;
-#endif
-    }
-  }
-}
-
 /** Get a channel block, creating if necessary.
  *  Get Channel block for chname (and allocate a new channel
  *  block, if it didn't exists before).
Index: ircu2.10/ircd/m_join.c
diff -u ircu2.10/ircd/m_join.c:1.34 ircu2.10/ircd/m_join.c:1.35
--- ircu2.10/ircd/m_join.c:1.34 Fri Sep 16 07:12:05 2005
+++ ircu2.10/ircd/m_join.c      Thu Oct  6 16:49:25 2005
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_join.c,v 1.34 2005/09/16 14:12:05 klmitch Exp $
+ * $Id: m_join.c,v 1.35 2005/10/06 23:49:25 entrope Exp $
  */
 
 #include "config.h"
@@ -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 @@
     }
 
     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;
       }
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to