From dc361e4037a3e1e3a733b865989ce11927475472 Mon Sep 17 00:00:00 2001 From: Lance Date: Thu, 2 Feb 2006 13:00:42 +0000 Subject: [PATCH] fixed private channel exploit git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1929 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- plugins/irc/ircclient.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/plugins/irc/ircclient.c b/plugins/irc/ircclient.c index 7d4410227..ea4265db0 100644 --- a/plugins/irc/ircclient.c +++ b/plugins/irc/ircclient.c @@ -5,6 +5,7 @@ // need option for whois on receiving PM // bug: setting channel to private, crashes fte when trying to join it. // http://www.mirc.net/raws/ +// http://www.ircle.com/reference/commands.shtml #include "../plugin.h" @@ -1253,12 +1254,17 @@ int IRC_ClientFrame(ircclient_t *irc) } else if (!strncmp(msg, "353 ", 4)) //the names of people on a channel { - char *eq = strstr(msg, "="); + char *eq = strstr(msg, "="); // BAD SPIKE!! = is normal channel :( char *eq2 = strstr(msg, "@"); // @ means the channel is +s (secret) + char *eq3 = strstr(msg, "*"); // * means the channel is +p (private) rather redundant... + char *channeltype = strtok(var[4], " "); char *channel = strtok(var[5], " "); char *str; + + int secret = 0; - if (eq) + int privatechan = 0; + if ( !strcmp(channeltype,"=") ) { char *end; eq++; @@ -1270,7 +1276,8 @@ int IRC_ClientFrame(ircclient_t *irc) *end = '\0'; str++; } - else if (eq2) + //else if (eq2) + else if ( !strcmp(channeltype,"@") ) { char *end; @@ -1285,6 +1292,21 @@ int IRC_ClientFrame(ircclient_t *irc) *end = '\0'; str++; } + else if ( !strcmp(channeltype,"*") ) + { + char *end; + + privatechan = 1; + + eq3++; + str = strstr(eq3, ":"); + while(*eq3 == ' ') + eq3++; + for (end = eq3; *end>' '&&*end !=':'; end++) + ; + *end = '\0'; + str++; + } else { eq = "Corrupted_Message"; @@ -1307,6 +1329,10 @@ int IRC_ClientFrame(ircclient_t *irc) { Con_SubPrintf(channel, "%s is secret (+s)\n",channel); } + else if (privatechan == 1) + { + Con_SubPrintf(channel, "%s is private (+p)\n",channel); + } } // would be great to convert the above to work better