1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-13 10:20:28 +00:00

The server didn't validate wheather the "target" client of a channel

user mode change is a valid channel member or not.
This commit is contained in:
Alexander Barton 2003-01-21 21:04:16 +00:00
parent d978d8ddbb
commit fbec1f1070

View File

@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-mode.c,v 1.30 2003/01/17 19:04:19 alex Exp $"; static char UNUSED id[] = "$Id: irc-mode.c,v 1.31 2003/01/21 21:04:16 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@ -509,6 +509,13 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Is there a valid mode change? */ /* Is there a valid mode change? */
if( ! x[0] ) continue; 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 ) if( set )
{ {
/* Set mode */ /* Set mode */