about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2003-01-21 21:04:16 +0000
committerAlexander Barton <alex@barton.de>2003-01-21 21:04:16 +0000
commitfbec1f1070b35586b7e932ccec88383066faad50 (patch)
tree0ffd7dd0ea6ca5ec1ea314daa6118684846d4b97 /src
parentd978d8ddbb886456a05932e49a2f59fe49dd9bea (diff)
downloadngircd-fbec1f1070b35586b7e932ccec88383066faad50.tar.gz
ngircd-fbec1f1070b35586b7e932ccec88383066faad50.zip
The server didn't validate wheather the "target" client of a channel
user mode change is a valid channel member or not.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc-mode.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index ec8771e9..cf635417 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.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 <assert.h>
@@ -509,6 +509,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 */