about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2007-10-14 12:08:57 +0000
committerAlexander Barton <alex@barton.de>2007-10-14 12:08:57 +0000
commit8f162f4e1770940889cb1504b285e7ca9a61a485 (patch)
tree76c3b9e14a9875f0532f59fc393a68705f464cad /src
parent089ca21b3dcde8d12b140d418f00f6ed8d770444 (diff)
downloadngircd-8f162f4e1770940889cb1504b285e7ca9a61a485.tar.gz
ngircd-8f162f4e1770940889cb1504b285e7ca9a61a485.zip
Fixed propagation of channel mode 'P' on server links.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc-mode.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index 4a6127ad..c26984d8 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.49 2007/08/02 10:14:26 fw Exp $";
+static char UNUSED id[] = "$Id: irc-mode.c,v 1.50 2007/10/14 12:08:57 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -432,16 +432,21 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
 				break;
 
 			case 'P': /* Persistent channel */
-				if( modeok )
-				{
-					if( set && ( ! Client_OperByMe( Client )))
-					{
-						/* Only IRC operators are allowed to set P mode */
-						ok = IRC_WriteStrClient( Origin, ERR_NOPRIVILEGES_MSG, Client_ID( Origin ));
-					}
-					else x[0] = 'P';
-				}
-				else ok = IRC_WriteStrClient( Origin, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( Origin ), Channel_Name( Channel ));
+				if (modeok) {
+					/* Only IRC operators are allowed to
+					 * set the 'P' channel mode! */
+					if (set && ! (Client_OperByMe(Client)
+					    || Client_Type(Client) == CLIENT_SERVER)) {
+						ok = IRC_WriteStrClient(Origin,
+							ERR_NOPRIVILEGES_MSG,
+							Client_ID(Origin));
+					} else
+						x[0] = 'P';
+				} else
+					ok = IRC_WriteStrClient(Origin,
+						ERR_CHANOPRIVSNEEDED_MSG,
+						Client_ID(Origin),
+						Channel_Name(Channel));
 				break;
 
 			/* --- Channel user modes --- */