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
-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.
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 */
#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.
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;
}