repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 8f162f4e1770940889cb1504b285e7ca9a61a485:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 8f162f4e1770940889cb1504b285e7ca9a61a485
Author: Alexander Barton 
Date:   Sun Oct 14 12:08:57 2007 +0000

    Fixed propagation of channel mode 'P' on server links.

diff --git a/ChangeLog b/ChangeLog
index 383ac755a59a853b963ee8cd5195b01c41e9402e..
index ..9a59f286d090dcffd654588f60c92b952e58bb30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@

 ngIRCd HEAD

+  - Fixed propagation of channel mode 'P' on server links.
   - Numeric 317: implemented "signon time" (displayed in WHOIS result).
   - Fixed code that prevented GCC 2.95 to compile ngIRCd.
   - Adjust path names in manual pages according to "./configure" settings.
@@ -707,4 +708,4 @@ ngIRCd 0.0.1, 31.12.2001


 -- 
-$Id: ChangeLog,v 1.323 2007/10/04 15:03:55 alex Exp $
+$Id: ChangeLog,v 1.324 2007/10/14 12:09:04 alex Exp $
diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index 4a6127ad95a0baa9e374fa3b36c3d764eb2fbeb1..
index ..c26984d8208ec5eb0e4201bd2bebe694dd0b6097 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 
@@ -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 --- */

-----END OF PAGE-----