ngIRCd: Patch to update ngIRCd 0.11.0 to version 0.11.1. ChangeLog | 10 +++++++++- NEWS | 2 +- configure.in | 4 ++-- contrib/Debian/changelog | 6 ++++++ contrib/ngircd.spec | 2 +- src/ngircd/irc-channel.c | 22 +++++++++------------- src/ngircd/irc-info.c | 18 ++++++++++++------ src/ngircd/irc-login.c | 6 +++--- src/ngircd/irc-mode.c | 14 +++++--------- src/ngircd/parse.c | 9 +++++---- src/testsuite/mode-test.e | 6 +++--- 11 files changed, 56 insertions(+), 43 deletions(-) Index: ChangeLog =================================================================== RCS file: /srv/cvs/ngircd/ngircd/ChangeLog,v retrieving revision 1.332.2.6 retrieving revision 1.332.2.10 diff -u -p -r1.332.2.6 -r1.332.2.10 --- ChangeLog 15 Jan 2008 20:45:52 -0000 1.332.2.6 +++ ChangeLog 26 Feb 2008 19:22:06 -0000 1.332.2.10 @@ -10,6 +10,14 @@ -- ChangeLog -- +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) @@ -734,4 +742,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.332.2.6 2008/01/15 20:45:52 alex Exp $ +$Id: ChangeLog,v 1.332.2.10 2008/02/26 19:22:06 alex Exp $ Index: NEWS =================================================================== RCS file: /srv/cvs/ngircd/ngircd/NEWS,v retrieving revision 1.83.2.2 retrieving revision 1.83.2.4 diff -u -p -r1.83.2.2 -r1.83.2.4 --- NEWS 15 Jan 2008 20:45:52 -0000 1.83.2.2 +++ NEWS 26 Feb 2008 19:22:07 -0000 1.83.2.4 @@ -251,4 +251,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: NEWS,v 1.83.2.2 2008/01/15 20:45:52 alex Exp $ +$Id: NEWS,v 1.83.2.4 2008/02/26 19:22:07 alex Exp $ Index: configure.in =================================================================== RCS file: /srv/cvs/ngircd/ngircd/configure.in,v retrieving revision 1.125.2.3 retrieving revision 1.125.2.4 diff -u -p -r1.125.2.3 -r1.125.2.4 --- configure.in 15 Jan 2008 20:45:52 -0000 1.125.2.3 +++ configure.in 26 Feb 2008 19:37:34 -0000 1.125.2.4 @@ -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.2.3 2008/01/15 20:45:52 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, 0.11.0) +AC_INIT(ngircd, 0.11.1) AC_CONFIG_SRCDIR(src/ngircd/ngircd.c) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(1.6) Index: contrib/ngircd.spec =================================================================== RCS file: /srv/cvs/ngircd/ngircd/contrib/ngircd.spec,v retrieving revision 1.4.8.3 retrieving revision 1.4.8.4 diff -u -p -r1.4.8.3 -r1.4.8.4 --- contrib/ngircd.spec 15 Jan 2008 20:45:53 -0000 1.4.8.3 +++ contrib/ngircd.spec 26 Feb 2008 19:37:35 -0000 1.4.8.4 @@ -1,5 +1,5 @@ %define name ngircd -%define version 0.11.0 +%define version 0.11.1 %define release 1 %define prefix %{_prefix} Index: contrib/Debian/changelog =================================================================== RCS file: /srv/cvs/ngircd/ngircd/contrib/Debian/changelog,v retrieving revision 1.14.2.3 retrieving revision 1.14.2.4 diff -u -p -r1.14.2.3 -r1.14.2.4 --- contrib/Debian/changelog 15 Jan 2008 20:45:54 -0000 1.14.2.3 +++ contrib/Debian/changelog 26 Feb 2008 19:37:36 -0000 1.14.2.4 @@ -1,3 +1,9 @@ +ngircd (0.11.1-0ab1) unstable; urgency=low + + * New "upstream" release 0.11.1. + + -- Alexander Barton Tue, 26 Feb 2008 20:24:55 +0100 + ngircd (0.11.0-0ab1) unstable; urgency=low * New "upstream" release 0.11.0. Index: src/ngircd/irc-channel.c =================================================================== RCS file: /srv/cvs/ngircd/ngircd/src/ngircd/irc-channel.c,v retrieving revision 1.40.2.1 retrieving revision 1.40.2.2 diff -u -p -r1.40.2.1 -r1.40.2.2 --- src/ngircd/irc-channel.c 7 Jan 2008 11:42:14 -0000 1.40.2.1 +++ src/ngircd/irc-channel.c 26 Feb 2008 12:07:41 -0000 1.40.2.2 @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-channel.c,v 1.40.2.1 2008/01/07 11:42:14 fw 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 @@ -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 ) { Index: src/ngircd/irc-info.c =================================================================== RCS file: /srv/cvs/ngircd/ngircd/src/ngircd/irc-info.c,v retrieving revision 1.41 retrieving revision 1.41.2.1 diff -u -p -r1.41 -r1.41.2.1 --- src/ngircd/irc-info.c 11 Dec 2007 11:29:44 -0000 1.41 +++ src/ngircd/irc-info.c 26 Feb 2008 12:06:57 -0000 1.41.2.1 @@ -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 @@ -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 *C 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 )); Index: src/ngircd/irc-login.c =================================================================== RCS file: /srv/cvs/ngircd/ngircd/src/ngircd/irc-login.c,v retrieving revision 1.54 retrieving revision 1.54.2.1 diff -u -p -r1.54 -r1.54.2.1 --- src/ngircd/irc-login.c 21 Nov 2007 12:16:36 -0000 1.54 +++ src/ngircd/irc-login.c 5 Feb 2008 11:48:37 -0000 1.54.2.1 @@ -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 @@ -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 Index: src/ngircd/irc-mode.c =================================================================== RCS file: /srv/cvs/ngircd/ngircd/src/ngircd/irc-mode.c,v retrieving revision 1.50 retrieving revision 1.50.2.1 diff -u -p -r1.50 -r1.50.2.1 --- src/ngircd/irc-mode.c 14 Oct 2007 12:08:57 -0000 1.50 +++ src/ngircd/irc-mode.c 16 Feb 2008 11:26:12 -0000 1.50.2.1 @@ -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 @@ -317,7 +317,7 @@ Channel_Mode( CLIENT *Client, REQUEST *R /* 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 *R /* 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 *R /* 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 *R /* 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 */ Index: src/ngircd/parse.c =================================================================== RCS file: /srv/cvs/ngircd/ngircd/src/ngircd/parse.c,v retrieving revision 1.69 retrieving revision 1.69.2.1 diff -u -p -r1.69 -r1.69.2.1 --- src/ngircd/parse.c 21 Nov 2007 12:16:36 -0000 1.69 +++ src/ngircd/parse.c 5 Feb 2008 13:11:20 -0000 1.69.2.1 @@ -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 *Re 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 *Re } cmd = My_Commands; + client_type = Client_Type(client); while( cmd->name ) { /* Befehl suchen */ @@ -444,7 +445,7 @@ Handle_Request( CONN_ID Idx, REQUEST *Re 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 *Re 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; Index: src/testsuite/mode-test.e =================================================================== RCS file: /srv/cvs/ngircd/ngircd/src/testsuite/mode-test.e,v retrieving revision 1.6 retrieving revision 1.6.8.1 diff -u -p -r1.6 -r1.6.8.1 --- src/testsuite/mode-test.e 10 Mar 2004 20:40:06 -0000 1.6 +++ src/testsuite/mode-test.e 16 Feb 2008 11:26:13 -0000 1.6.8.1 @@ -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"