Author: Jeekay <jeekay@irc.planetarion.com>
authorPerry Lorier <isomer@undernet.org>
Sun, 26 May 2002 01:48:30 +0000 (01:48 +0000)
committerPerry Lorier <isomer@undernet.org>
Sun, 26 May 2002 01:48:30 +0000 (01:48 +0000)
Log message:

Patch to prevent local users joining channels with characters <=32 in
their names. This closes bug #51.

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

ChangeLog
ircd/ircd.c
ircd/m_join.c

index 6e3ffe01a53e6feadb4def4cf72b5864d21d86b7..b0d92d69a1447892c48ed0e4a615a9ee4c7782d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,9 @@
-2002-04-22  Alex Badea  <vampire@p16.pub.ro>
-
-       * ircd/m_stats.c (report_servers_verbose): include 'me' in the
-       server list as well
-
+2002-05-26  Jeekay  <jeekay@irc.planetarion.com>
+       * ircd/m_join.c (m_join,HasControlChars): check if a channel
+       name has any control chars (<=32) in it before allowing a
+       local user to join.
 2002-21-05 Andrew Miller <a1kmm@mware.virtualave.net>
        * ircd/ircd_relay.c: stop an information leak about the
        the network topography from relayed messages.
index e05d426d9adeaa75c2527c3b95a831c3213df27b..f6b04922e5793f225b39fbe3d8ea5271ddc0770b 100644 (file)
@@ -238,7 +238,7 @@ static void try_connections(struct Event* ev) {
   Debug((DEBUG_NOTICE, "Connection check at   : %s", myctime(CurrentTime)));
   for (aconf = GlobalConfList; aconf; aconf = aconf->next) {
     /* Also when already connecting! (update holdtimes) --SRB */
-    if (!(aconf->status & CONF_SERVER) || aconf->port == 0)
+    if (!(aconf->status & CONF_SERVER) || aconf->port == 0 || aconf->hold == 0)
       continue;
 
     /* Also skip juped servers */
index ef5c44adc142d8952a6b58fbb0671231ab12591f..ae7c5371ec1b13be7a76ca81897ae03be55474a8 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+/*
+ * Helper function to see if there are any control characters
+ * in a given string
+ */
+static char *
+HasControlChars(char *mstring)
+{
+  char *j;
+  for(j = mstring; *j ; j++) {
+    if(*j <= 32) { return j; }
+  }
+
+  return 0;
+}
+
 /*
  * Helper function to find last 0 in a comma-separated list of
  * channel names.
@@ -193,7 +208,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */
       continue;
 
-    if (!IsChannelName(name)) { /* bad channel name */
+    if (!IsChannelName(name) || HasControlChars(name)) { /* bad channel name */
       send_reply(sptr, ERR_NOSUCHCHANNEL, name);
       continue;
     }