From: Alexander Barton Date: Tue, 21 Jan 2003 21:05:19 +0000 (+0000) Subject: The server didn't validate weather the target user of a channel user mode X-Git-Tag: rel-0-6-1~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90e6ec3f897608eb3ac9accc9d0ef8fc16be7314;p=ngircd The server didn't validate weather the target user of a channel user mode change is a valid channel member or not (from HEAD). --- diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index ccd46b29..a518461a 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-mode.c,v 1.24.2.4 2003/01/17 19:08:57 alex Exp $"; +static char UNUSED id[] = "$Id: irc-mode.c,v 1.24.2.5 2003/01/21 21:05:19 alex Exp $"; #include "imp.h" #include @@ -507,6 +507,13 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel ) /* Is there a valid mode change? */ if( ! x[0] ) continue; + /* Validate target client */ + if( client && ( ! Channel_IsMemberOf( Channel, client ))) + { + if( ! IRC_WriteStrClient( Origin, ERR_USERNOTINCHANNEL_MSG, Client_ID( Origin ), Client_ID( client ), Channel_Name( Channel ))) break; + continue; + } + if( set ) { /* Set mode */