1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-18 02:04:03 +00:00

Compare commits

...

16 Commits

Author SHA1 Message Date
Florian Westphal
3b69da0c52 io.c: fix select FD_SETSIZE check when using epoll as io backend 2008-04-07 13:37:49 +02:00
Alexander Barton
04933f5b8b Fixed indentation ... too late for 0.11.1 :-/ 2008-04-07 13:37:46 +02:00
Alexander Barton
45df522bcb ngIRCd 0.11.1. 2008-02-26 19:37:34 +00:00
Alexander Barton
51260c2e9f Updated NEWS and ChangeLog for 0.11.1. 2008-02-26 19:22:06 +00:00
Florian Westphal
55865d7fc6 From: Rolf Eike Beer <eike@sf-mail.de>
Fix sending of JOINs between servers

I found a bug in "sending join between servers".
This does hit only operators that join a channel with at least 2 servers active in the net
the server the oper connects to sends "channel^Go" to the other servers
the other server first searches for the channel and then strips the modes from the channel name
he has to do the other way round: first strip and then check the channel name.
2008-02-26 12:07:41 +00:00
Florian Westphal
082a92beef send "G" flag in WHOIS replies instead of "H" if client is marked as being away.
(reported by Dana Dahlstrom)
2008-02-26 12:06:57 +00:00
Florian Westphal
e92c889580 From: Dana Dahlstrom <dana+70@cs.ucsd.edu>
Under some circumstances ngIRCd currently issues a channel MODE message
with a trailing space after the last parameter, which isn't permitted by
the grammar in RFC 2812 section 2.3.1:

http://tools.ietf.org/html/rfc2812#section-2.3.1

The following patch modifies mode-test.e to expose this, and modifies
irc-mode.c to correct it. [from HEAD]
2008-02-16 11:26:11 +00:00
Florian Westphal
de4676f066 [Parser]: Don't use Client_Type after command has been processed.
This caused a read from already free'd memory, if the processed
command (IRC_QUIT) calls Client_Destroy. (from HEAD)
2008-02-05 13:11:20 +00:00
Florian Westphal
64a98338d5 [LOGIN] irc_login, w CVSDATE defined, used strncpy with overlapping src/dest.
use memmove instead (from HEAD).
2008-02-05 11:48:37 +00:00
Alexander Barton
f4709082fe ngIRCd 0.11.0 2008-01-15 20:45:52 +00:00
Alexander Barton
997abc6889 Documented NoDNS configuration option. [from HEAD] 2008-01-07 23:10:28 +00:00
Alexander Barton
b7047f2e3b Updated ChangeLog to reflect changes from 0.10.x branch. 2008-01-07 23:09:25 +00:00
Alexander Barton
e990d96c61 ngIRCd 0.11.0-pre2 2008-01-07 21:25:35 +00:00
Florian Westphal
d986cd372f IRC_PART could reference invalid memory. 2008-01-07 11:42:13 +00:00
Florian Westphal
762aec0e08 Remove entry about ngircd failing on Linux 2.4: ngircd can now fall back to select. 2008-01-02 22:36:48 +00:00
Alexander Barton
f8cb8e3f20 Fixed year of release (2009 vs. 2008) ... ooops ;-) 2008-01-02 21:39:59 +00:00
14 changed files with 107 additions and 72 deletions

View File

@@ -10,8 +10,21 @@
-- ChangeLog --
ngIRCd HEAD
ngIRCd 0.11.1 (2008-02-26)
- Fix sending of JOIN commands between servers when remote server appended
mode flags. (Rolf Eike Beer) [from HEAD]
- Send "G" instead of "H" flag in WHO replies. (reported by Dana Dahlstrom)
- Under some circumstances ngIRCd issued channel MODE message with a
trailing space. (Dana Dahlstrom) [from HEAD]
ngIRCd 0.11.0 (2008-01-15)
ngIRCd 0.11.0-pre2 (2008-01-07)
- SECURITY: IRC_PART could reference invalid memory, causing
ngircd to crash [from HEAD].
ngIRCd 0.11.0-pre1 (2008-01-02)
- Use dotted-decimal IP address if hostname is >= 64.
- Add support for /STAT u (server uptime) command.
- New [Server] configuration Option "Bind" allows to specify
@@ -40,6 +53,11 @@ ngIRCd HEAD
- Added support for the WALLOPS command. Usage is restricted to IRC
operators.
ngIRCd 0.10.4 (2008-01-07)
- SECURITY: IRC_PART could reference invalid memory, causing
ngircd to crash [from HEAD].
ngIRCd 0.10.3 (2007-08-01)
- SECURITY: Fixed a severe bug in handling JOIN commands, which could
@@ -724,4 +742,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: ChangeLog,v 1.332 2008/01/02 11:31:48 alex Exp $
$Id: ChangeLog,v 1.332.2.11 2008/02/26 20:35:05 alex Exp $

4
NEWS
View File

@@ -10,7 +10,7 @@
-- NEWS --
ngIRCd HEAD
ngIRCd 0.11.0 (2008-01-15)
- Add support for /STAT u (server uptime) command.
- New [Server] configuration Option "Bind" allows to specify
@@ -251,4 +251,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: NEWS,v 1.83 2008/01/02 11:31:48 alex Exp $
$Id: NEWS,v 1.83.2.4 2008/02/26 19:22:07 alex Exp $

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2005 Alexander Barton <alex@barton.de>
# Copyright (c)2001-2008 Alexander Barton <alex@barton.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -8,13 +8,13 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: configure.in,v 1.125 2006/12/26 16:00:45 alex Exp $
# $Id: configure.in,v 1.125.2.4 2008/02/26 19:37:34 alex Exp $
#
# -- Initialisation --
AC_PREREQ(2.50)
AC_INIT(ngircd, CVSHEAD)
AC_INIT(ngircd, 0.11.1)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6)

View File

@@ -1,3 +1,33 @@
ngircd (0.11.1-0ab1) unstable; urgency=low
* New "upstream" release 0.11.1.
-- Alexander Barton <alex@barton.de> Tue, 26 Feb 2008 20:24:55 +0100
ngircd (0.11.0-0ab1) unstable; urgency=low
* New "upstream" release 0.11.0.
-- Alexander Barton <alex@barton.de> Tue, 15 Jan 2008 21:43:46 +0100
ngircd (0.11.0-0ab0-pre2) unstable; urgency=low
* Second prerelease of upcoming new "upstream release".
-- Alexander Barton <alex@barton.de> Mon, 7 Jan 2008 15:32:42 +0100
ngircd (0.11.0-0ab0-pre1) unstable; urgency=low
* Prerelease of upcoming new "upstream release".
-- Alexander Barton <alex@barton.de> Wed, 2 Jan 2008 21:33:15 +0100
ngircd (0.10.4-0ab1) unstable; urgency=high
* New "upstream" release: 0.10.4 - fixing a security bug.
-- Alexander Barton <alex@barton.de> Mon, 7 Jan 2008 22:04:44 +0100
ngircd (0.10.0-0ab1) unstable; urgency=low
* New "upstream" release: 0.10.0

View File

@@ -1,5 +1,5 @@
%define name ngircd
%define version CVSHEAD
%define version 0.11.1
%define release 1
%define prefix %{_prefix}

View File

@@ -62,15 +62,6 @@ A: On Linux/glibc with chroot enabled you need to put some libraries inside
is to either disable chroot support or to link against dietlibc instead
of glibc. (tnx to Sebastian Siewior)
Q: I am running Linux and ngircd dies on startup with the follwing errors:
IO subsystem: epoll (hint size 100, initial maxfd 100, masterfd -1).
Cannot initialize IO routines: Function not implemented
Server isn't listening on a single port!
ngircd exiting due to fatal errors!
A: epoll is only supported on 2.6 Linux kernels. Either use a 2.6 kernel, or
re-run configure with the --without-epoll parameter. After configure
completed, you should see select() being listed as IO backend:
'(I/O backend: "select()"').
IV. Bugs!?
~~~~~~~~~~
@@ -85,4 +76,4 @@ A: Please file a bug report at <http://ngircd.barton.de/bugzilla/index.cgi>!
--
$Id: FAQ.txt,v 1.11 2005/12/09 21:14:56 fw Exp $
$Id: FAQ.txt,v 1.11.4.1 2008/01/02 22:36:48 fw Exp $

View File

@@ -1,4 +1,4 @@
# $Id: sample-ngircd.conf,v 1.43 2007/11/23 16:26:03 fw Exp $
# $Id: sample-ngircd.conf,v 1.43.2.1 2008/01/07 23:10:28 alex Exp $
#
# This is a sample configuration file for the ngIRCd, which must be adepted
@@ -100,6 +100,9 @@
# Allow Pre-Defined Channels only (see Section [Channels])
;PredefChannelsOnly = no
# Don't do any DNS lookups when a client connects to the server.
;NoDNS = no
# Maximum number of simultaneous connection the server is allowed
# to accept (0: unlimited):
;MaxConnections = 0

View File

@@ -12,7 +12,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: io.c,v 1.28 2008/01/02 10:29:51 fw Exp $";
static char UNUSED id[] = "$Id: io.c,v 1.28.2.1 2008/04/03 14:16:35 fw Exp $";
#include <assert.h>
#include <stdlib.h>
@@ -308,7 +308,7 @@ io_event_create(int fd, short what, void (*cbfunc) (int, short))
assert(fd >= 0);
#if defined(IO_USE_SELECT) && defined(FD_SETSIZE)
if (fd >= FD_SETSIZE) {
if (io_masterfd < 0 && fd >= FD_SETSIZE) {
Log(LOG_ERR,
"fd %d exceeds FD_SETSIZE (%u) (select can't handle more file descriptors)",
fd, FD_SETSIZE);

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-channel.c,v 1.40 2007/07/31 18:56:14 alex Exp $";
static char UNUSED id[] = "$Id: irc-channel.c,v 1.40.2.2 2008/02/26 12:07:41 fw Exp $";
#include "imp.h"
#include <assert.h>
@@ -79,6 +79,14 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
{
chan = NULL; flags = NULL;
if (Client_Type(Client) == CLIENT_SERVER) {
flags = strchr( channame, 0x7 );
if( flags ) {
*flags = '\0';
flags++;
}
}
/* wird der Channel neu angelegt? */
if( Channel_Search( channame )) {
is_new_chan = false;
@@ -92,18 +100,6 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
is_new_chan = true;
}
/* Hat ein Server Channel-User-Modes uebergeben? */
if( Client_Type( Client ) == CLIENT_SERVER )
{
/* Channel-Flags extrahieren */
flags = strchr( channame, 0x7 );
if( flags )
{
*flags = '\0';
flags++;
}
}
/* Local client? */
if( Client_Type( Client ) == CLIENT_USER )
{
@@ -269,8 +265,9 @@ IRC_PART( CLIENT *Client, REQUEST *Req )
assert( Client != NULL );
assert( Req != NULL );
/* Falsche Anzahl Parameter? */
if(( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if (Req->argc < 1 || Req->argc > 2)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
/* Wer ist der Absender? */
if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_Search( Req->prefix );
@@ -278,18 +275,11 @@ IRC_PART( CLIENT *Client, REQUEST *Req )
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Channel-Namen durchgehen */
chan = strtok( Req->argv[0], "," );
while( chan )
{
if( ! Channel_Part( target, Client, chan, Req->argc > 1 ? Req->argv[1] : Client_ID( target )))
{
/* naechsten Namen ermitteln */
chan = strtok( NULL, "," );
continue;
}
chan = strtok(Req->argv[0], ",");
while (chan) {
Channel_Part(target, Client, chan, Req->argc > 1 ? Req->argv[1] : Client_ID(target));
/* naechsten Namen ermitteln */
chan = strtok( NULL, "," );
chan = strtok(NULL, ",");
}
return CONNECTED;
} /* IRC_PART */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.41 2007/12/11 11:29:44 fw Exp $";
static char UNUSED id[] = "$Id: irc-info.c,v 1.41.2.1 2008/02/26 12:06:57 fw Exp $";
#include "imp.h"
#include <assert.h>
@@ -648,7 +648,11 @@ IRC_WHO( CLIENT *Client, REQUEST *Req )
if( ok && (( ! only_ops ) || ( strchr( Client_Modes( c ), 'o' ))))
{
/* Get flags */
strcpy( flags, "H" );
if (strchr(Client_Modes( c ), 'a'))
strcpy(flags, "G"); /* away */
else
strcpy(flags, "H");
if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags ));
/* Search suitable channel */
@@ -1082,10 +1086,12 @@ IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, bool OnlyOps )
if( strchr( Client_Modes( c ), 'i' )) is_visible = false;
else is_visible = true;
if( is_member || is_visible )
{
/* Flags zusammenbasteln */
strcpy( flags, "H" );
if( is_member || is_visible ) {
if (strchr(Client_Modes( c ), 'a'))
strcpy(flags, "G"); /* away */
else
strcpy(flags, "H");
if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags ));
if( strchr( Channel_UserModes( Chan, c ), 'o' )) strlcat( flags, "@", sizeof( flags ));
else if( strchr( Channel_UserModes( Chan, c ), 'v' )) strlcat( flags, "+", sizeof( flags ));

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-login.c,v 1.54 2007/11/21 12:16:36 alex Exp $";
static char UNUSED id[] = "$Id: irc-login.c,v 1.54.2.1 2008/02/05 11:48:37 fw Exp $";
#include "imp.h"
#include <assert.h>
@@ -601,8 +601,8 @@ Hello_User( CLIENT *Client )
/* Version and system type */
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 );
memmove( ver + 4, ver + 5, 2 );
memmove( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return false;
#else

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-mode.c,v 1.50 2007/10/14 12:08:57 alex Exp $";
static char UNUSED id[] = "$Id: irc-mode.c,v 1.50.2.1 2008/02/16 11:26:12 fw Exp $";
#include "imp.h"
#include <assert.h>
@@ -317,7 +317,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Prepare reply string */
if( set ) strcpy( the_modes, "+" );
else strcpy( the_modes, "-" );
strcpy( the_args, " " );
the_args[0] = '\0';
x[1] = '\0';
ok = CONNECTED;
@@ -528,8 +528,8 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-User-Mode */
if( Channel_UserModeAdd( Channel, client, x[0] ))
{
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_modes, x, sizeof( the_modes ));
Log( LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"", Client_Mask( client ), Channel_Name( Channel ), Channel_UserModes( Channel, client ));
}
@@ -552,8 +552,8 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-User-Mode */
if( Channel_UserModeDel( Channel, client, x[0] ))
{
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_modes, x, sizeof( the_modes ));
Log( LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"", Client_Mask( client ), Channel_Name( Channel ), Channel_UserModes( Channel, client ));
}
@@ -572,8 +572,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Are there additional arguments to add? */
if( argadd[0] )
{
len = strlen( the_args ) - 1;
if( the_args[len] != ' ' ) strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, argadd, sizeof( the_args ));
}
}
@@ -586,9 +585,6 @@ chan_exit:
len = strlen( the_modes ) - 1;
if(( the_modes[len] == '+' ) || ( the_modes[len] == '-' )) the_modes[len] = '\0';
/* Clean up argument string if there are none */
if( ! the_args[1] ) the_args[0] = '\0';
if( Client_Type( Client ) == CLIENT_SERVER )
{
/* Forward mode changes to channel users and other servers */

View File

@@ -12,7 +12,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: parse.c,v 1.69 2007/11/21 12:16:36 alex Exp $";
static char UNUSED id[] = "$Id: parse.c,v 1.69.2.1 2008/02/05 13:11:20 fw Exp $";
/**
* @file
@@ -358,7 +358,7 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
bool result;
COMMAND *cmd;
NUMERIC *num;
int i;
int i, client_type;
assert( Idx >= 0 );
assert( Req != NULL );
@@ -436,6 +436,7 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
}
cmd = My_Commands;
client_type = Client_Type(client);
while( cmd->name )
{
/* Befehl suchen */
@@ -444,7 +445,7 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
cmd++; continue;
}
if( Client_Type( client ) & cmd->type )
if( client_type & cmd->type )
{
/* Command is allowed for this client: call it and count produced bytes */
Conn_ResetWCounter( );
@@ -452,7 +453,7 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
cmd->bytes += Conn_WCounter( );
/* Adjust counters */
if( Client_Type( client ) != CLIENT_SERVER ) cmd->lcount++;
if( client_type != CLIENT_SERVER ) cmd->lcount++;
else cmd->rcount++;
return result;

View File

@@ -1,4 +1,4 @@
# $Id: mode-test.e,v 1.6 2004/03/10 20:40:06 alex Exp $
# $Id: mode-test.e,v 1.6.8.1 2008/02/16 11:26:13 fw Exp $
spawn telnet localhost 6789
expect {
@@ -72,7 +72,7 @@ expect {
send "mode #channel +v nick\r"
expect {
timeout { exit 1 }
"@* MODE #channel +v nick"
"@* MODE #channel +v nick\r"
}
send "mode #channel +I nick1\r"
@@ -96,7 +96,7 @@ expect {
send "mode #channel -vo nick nick\r"
expect {
timeout { exit 1 }
"@* MODE #channel -vo nick nick"
"@* MODE #channel -vo nick nick\r"
}
send "quit\r"