ngIRCd HEAD
+ - Predefined Channel configuration now allows specification of channel key
+ (mode k) and maximum user count (mode l).
- When using epoll() IO interface, compile in the select() interface as
well and fall back to it when epoll() isn't available on runtime.
- New configure option "--without-select" to disable select() IO API
--
-$Id: ChangeLog,v 1.312 2006/12/26 16:00:45 alex Exp $
+$Id: ChangeLog,v 1.313 2006/12/29 14:09:48 fw Exp $
-# $Id: sample-ngircd.conf,v 1.38 2006/11/05 13:03:47 fw Exp $
+# $Id: sample-ngircd.conf,v 1.39 2006/12/29 14:09:48 fw Exp $
#
# This is a sample configuration file for the ngIRCd, which must be adepted
;Topic = a great topic
# Initial channel modes
- ;Modes = tn
+ ;Modes = tnk
+
+ # initial channel password (mode k)
+ ;Key = Secret
+
+ # maximum users per channel (mode l)
+ ;MaxUsers = 23
[Channel]
# More [Channel] sections, if you like ...
.\"
-.\" $Id: ngircd.conf.5.tmpl,v 1.1 2006/12/25 16:13:26 alex Exp $
+.\" $Id: ngircd.conf.5.tmpl,v 1.2 2006/12/29 14:09:49 fw Exp $
.\"
.TH ngircd.conf 5 "August 2005" ngircd "ngIRCd Manual"
.SH NAME
.TP
\fBModes\fR
Initial channel modes.
+.TP
+\fBKey\fR
+Sets initial channel key (only relevant if mode k is set)
+.TP
+\fBMaxUsers\fR
+Set maximum user limit for this channel (only relevant if mode l is set)
.SH HINTS
It's wise to use "ngircd --configtest" to validate the configuration file
after changing it. See
#include "portab.h"
-static char UNUSED id[] = "$Id: channel.c,v 1.61 2006/12/07 22:23:39 fw Exp $";
+static char UNUSED id[] = "$Id: channel.c,v 1.62 2006/12/29 14:09:50 fw Exp $";
#include "imp.h"
#include <assert.h>
while (*c)
Channel_ModeAdd(chan, *c++);
+ Channel_SetKey(chan, Conf_Channel[i].key);
+ Channel_SetMaxUsers(chan, Conf_Channel[i].maxusers);
+
Log(LOG_INFO, "Created pre-defined channel \"%s\".",
Conf_Channel[i].name );
}
{
CHANNEL *c, *c_next;
CL2CHAN *cl2chan, *cl2chan_next;
-
+
/* Channel-Strukturen freigeben */
c = My_Channels;
while( c )
#include "portab.h"
-static char UNUSED id[] = "$Id: conf.c,v 1.96 2006/11/20 19:32:07 fw Exp $";
+static char UNUSED id[] = "$Id: conf.c,v 1.97 2006/12/29 14:09:50 fw Exp $";
#include "imp.h"
#include <assert.h>
puts( "[CHANNEL]" );
printf( " Name = %s\n", Conf_Channel[i].name );
printf( " Modes = %s\n", Conf_Channel[i].modes );
+ printf( " Key = %s\n", Conf_Channel[i].key );
+ printf( " MaxUsers = %lu\n", Conf_Channel[i].maxusers );
topic = (char*)array_start(&Conf_Channel[i].topic);
printf( " Topic = %s\n\n", topic ? topic : "");
/* Initialize new channel structure */
strcpy( Conf_Channel[Conf_Channel_Count].name, "" );
strcpy( Conf_Channel[Conf_Channel_Count].modes, "" );
+ strcpy( Conf_Channel[Conf_Channel_Count].key, "" );
+ Conf_Channel[Conf_Channel_Count].maxusers = 0;
array_free(&Conf_Channel[Conf_Channel_Count].topic);
Conf_Channel_Count++;
}
return;
}
+ if( strcasecmp( Var, "Key" ) == 0 ) {
+ /* Initial Channel Key (mode k) */
+ len = strlcpy(Conf_Channel[chancount].key, Arg, sizeof(Conf_Channel[chancount].key));
+ if (len >= sizeof( Conf_Channel[chancount].key ))
+ Config_Error_TooLong(Line, Var);
+ return;
+ }
+
+ if( strcasecmp( Var, "MaxUsers" ) == 0 ) {
+ /* maximum user limit, mode l */
+ Conf_Channel[chancount].maxusers = (unsigned long) atol(Arg);
+ if (Conf_Channel[chancount].maxusers == 0)
+ Config_Error_NaN(Line, Var);
+ return;
+ }
+
Config_Error( LOG_ERR, "%s, line %d (section \"Channel\"): Unknown variable \"%s\"!",
NGIRCd_ConfFile, Line, Var );
} /* Handle_CHANNEL */
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
- * $Id: conf.h,v 1.41 2006/11/05 13:03:48 fw Exp $
+ * $Id: conf.h,v 1.42 2006/12/29 14:09:50 fw Exp $
*
* Configuration management (header)
*/
{
char name[CHANNEL_NAME_LEN]; /* Name of the channel */
char modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
+ char key[CLIENT_PASS_LEN]; /* Channel key ("password", mode "k" ) */
+ unsigned long maxusers; /* maximum usercount for this channel, mode "l" */
array topic; /* Initial topic */
} CONF_CHANNEL;