ngIRCd CVSHEAD
+ - New configuration option "OperServerMode" to enable a workaround needed
+ when running an network with ircd2 servers and "OperCanUseMode" enabled
+ to prevent the ircd2 daemon to drop mode changes of IRC operators.
+ Patch by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
- Implemented support for "secret channels" (channel mode "s").
- New configuration option "Mask" for [Operator] sections to limit OPER
commands to ussers with a specific IRC mask. Patch from Florian Westphal.
--
-$Id: ChangeLog,v 1.263 2005/03/02 16:35:10 alex Exp $
+$Id: ChangeLog,v 1.264 2005/03/15 16:56:16 alex Exp $
ngIRCd CVSHEAD
+ - New configuration option "OperServerMode" to enable a workaround needed
+ when running an network with ircd2 servers and "OperCanUseMode" enabled
+ to prevent the ircd2 daemon to drop mode changes of IRC operators.
+ Patch by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
- Implemented support for "secret channels" (channel mode "s").
- New configuration option "Mask" for [Operator] sections to limit OPER
commands to ussers with a specific IRC mask. Patch from Florian Westphal.
--
-$Id: NEWS,v 1.70 2005/03/02 16:35:10 alex Exp $
+$Id: NEWS,v 1.71 2005/03/15 16:56:16 alex Exp $
-# $Id: sample-ngircd.conf,v 1.31 2005/03/02 16:07:30 alex Exp $
+# $Id: sample-ngircd.conf,v 1.32 2005/03/15 16:56:16 alex Exp $
#
# This is a sample configuration file for the ngIRCd, which must be adepted
# they are not(!) channel-operators?
;OperCanUseMode = no
+ # Mask IRC Operator mode requests as if they were coming from the server?
+ # (This is a compatibility hack for ircd-irc2 servers )
+ ;OperServerMode = no
+
# Maximum number of simultaneous connection the server is allowed
# to accept (<=0: unlimited):
;MaxConnections = -1
.\"
-.\" $Id: ngircd.conf.5,v 1.15 2005/03/02 16:07:31 alex Exp $
+.\" $Id: ngircd.conf.5,v 1.16 2005/03/15 16:56:17 alex Exp $
.\"
.TH ngircd.conf 5 "February 2005" ngircd "ngIRCd Manual"
.SH NAME
Should IRC Operators be allowed to use the MODE command even if they are
not(!) channel-operators? Default: no.
.TP
+\fBOperServerMode\fR
+If OperCanUseMode is enabled, this may lead the compatibility problems with
+Servers that run the ircd-irc2 Software. This Option "masks" mode requests
+by non-chanops as if they were coming from the server. Default: no.
+.TP
\fBMaxConnections\fR
Maximum number of simultaneous connection the server is allowed to accept
(<=0: unlimited). Default: -1.
#include "portab.h"
-static char UNUSED id[] = "$Id: conf.c,v 1.69 2005/03/02 16:07:31 alex Exp $";
+static char UNUSED id[] = "$Id: conf.c,v 1.70 2005/03/15 16:56:18 alex Exp $";
#include "imp.h"
#include <assert.h>
printf( " PongTimeout = %d\n", Conf_PongTimeout );
printf( " ConnectRetry = %d\n", Conf_ConnectRetry );
printf( " OperCanUseMode = %s\n", Conf_OperCanMode == TRUE ? "yes" : "no" );
+ printf( " OperServerMode = %s\n", Conf_OperServerMode == TRUE ? "yes" : "no" );
if( Conf_MaxConnections > 0 ) printf( " MaxConnections = %ld\n", Conf_MaxConnections );
else printf( " MaxConnections = -1\n" );
if( Conf_MaxConnectionsIP > 0 ) printf( " MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP );
Conf_Channel_Count = 0;
Conf_OperCanMode = FALSE;
+ Conf_OperServerMode = FALSE;
Conf_MaxConnections = -1;
Conf_MaxConnectionsIP = 5;
} /* Read_Config */
+LOCAL BOOLEAN
+Check_ArgIsTrue( const char *Arg )
+{
+ if( strcasecmp( Arg, "yes" ) == 0 ) return TRUE;
+ if( strcasecmp( Arg, "true" ) == 0 ) return TRUE;
+ if( atoi( Arg ) != 0 ) return TRUE;
+
+ return FALSE;
+} /* Check_ArgIsTrue */
+
+
LOCAL VOID
Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
{
if( strcasecmp( Var, "OperCanUseMode" ) == 0 )
{
/* Are IRC operators allowed to use MODE in channels they aren't Op in? */
- if( strcasecmp( Arg, "yes" ) == 0 ) Conf_OperCanMode = TRUE;
- else if( strcasecmp( Arg, "true" ) == 0 ) Conf_OperCanMode = TRUE;
- else if( atoi( Arg ) != 0 ) Conf_OperCanMode = TRUE;
- else Conf_OperCanMode = FALSE;
+ Conf_OperCanMode = Check_ArgIsTrue( Arg );
+ return;
+ }
+ if( strcasecmp( Var, "OperServerMode" ) == 0 )
+ {
+ /* Mask IRC operator as if coming from the server? (ircd-irc2 compat hack) */
+ Conf_OperServerMode = Check_ArgIsTrue( Arg );
return;
}
if( strcasecmp( Var, "MaxConnections" ) == 0 )
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
- * $Id: conf.h,v 1.31 2005/03/02 16:07:31 alex Exp $
+ * $Id: conf.h,v 1.32 2005/03/15 16:56:18 alex Exp $
*
* Configuration management (header)
*/
/* Are IRC operators allowed to always use MODE? */
GLOBAL BOOLEAN Conf_OperCanMode;
+/* If an IRC op gives chanop privileges without being a chanop,
+ * ircd2 will ignore the command. This enables a workaround:
+ * It masks the command as coming from the server */
+GLOBAL BOOLEAN Conf_OperServerMode;
+
/* Maximum number of connections to this server */
GLOBAL LONG Conf_MaxConnections;
#include "portab.h"
-static char UNUSED id[] = "$Id: irc-mode.c,v 1.38 2005/03/05 11:44:01 alex Exp $";
+static char UNUSED id[] = "$Id: irc-mode.c,v 1.39 2005/03/15 16:56:18 alex Exp $";
#include "imp.h"
#include <assert.h>
/* Handle channel and channel-user modes */
CHAR the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2], argadd[CLIENT_PASS_LEN], *mode_ptr;
- BOOLEAN ok, set, modeok, skiponce;
+ BOOLEAN ok, set, modeok = FALSE, skiponce, use_servermode = FALSE;
INT mode_arg, arg_arg;
CLIENT *client;
LONG l;
/* Is he channel operator? */
if( strchr( Channel_UserModes( Channel, Origin ), 'o' )) modeok = TRUE;
- else modeok = FALSE;
- if( Conf_OperCanMode )
+ else if( Conf_OperCanMode )
{
- /* auch IRC-Operatoren duerfen MODE verwenden */
- if( Client_OperByMe( Origin )) modeok = TRUE;
+ /* IRC-Operators can use MODE as well */
+ if( Client_OperByMe( Origin )) {
+ modeok = TRUE;
+ if ( Conf_OperServerMode ) use_servermode = TRUE; /* Change Origin to Server */
+ }
}
}
else modeok = TRUE;
}
else
{
+ if ( use_servermode ) Origin = Client_ThisServer();
+
/* Send reply to client and inform other servers and channel users */
ok = IRC_WriteStrClientPrefix( Client, Origin, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );
IRC_WriteStrServersPrefix( Client, Origin, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );