]> arthur.barton.de Git - ngircd.git/commitdiff
The server didn't validate weather the target user of a channel user mode
authorAlexander Barton <alex@barton.de>
Tue, 21 Jan 2003 21:05:19 +0000 (21:05 +0000)
committerAlexander Barton <alex@barton.de>
Tue, 21 Jan 2003 21:05:19 +0000 (21:05 +0000)
change is a valid channel member or not (from HEAD).

src/ngircd/irc-mode.c

index ccd46b29fd631b99bcbf9680a36414cb08fb08cc..a518461a5b06352c8422a66abfbeb20b6893c98f 100644 (file)
@@ -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 <assert.h>
@@ -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 */