Compare commits

...
9 Commits
10 changed files with 377 additions and 324 deletions
+10 -1
View File
@@ -10,6 +10,15 @@
-- ChangeLog -- -- ChangeLog --
ngIRCd 0.9.2 (2005-10-15)
- Fixed a bug that could cause the damon to crash when outgoing server
connections can't be established.
- Fixed a bug that caused the daemon to leak file descriptors when no
resolver subprocesses could be created.
- Fixed server NOTICEs to users with "s" mode ("server messages").
- Fixed a format string bug in "connection statistics" messages to clients.
ngIRCd 0.9.1 (2005-08-03) ngIRCd 0.9.1 (2005-08-03)
- The KILL command killed much more than desired (including server links!) - The KILL command killed much more than desired (including server links!)
@@ -620,4 +629,4 @@ ngIRCd 0.0.1, 31.12.2001
-- --
$Id: ChangeLog,v 1.276.2.7 2005/08/03 14:27:48 alex Exp $ $Id: ChangeLog,v 1.276.2.12 2005/10/15 12:44:08 alex Exp $
+263 -262
View File
File diff suppressed because it is too large Load Diff
Vendored
+30 -20
View File
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2005-04-22' timestamp='2005-07-08'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +21,15 @@ timestamp='2005-04-22'
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# Boston, MA 02111-1307, USA. # 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. Submit a context # Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry. # diff and a properly formatted ChangeLog entry.
# #
@@ -83,11 +84,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do while test $# -gt 0 ; do
case $1 in case $1 in
--time-stamp | --time* | -t ) --time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;; echo "$timestamp" ; exit ;;
--version | -v ) --version | -v )
echo "$version" ; exit 0 ;; echo "$version" ; exit ;;
--help | --h* | -h ) --help | --h* | -h )
echo "$usage"; exit 0 ;; echo "$usage"; exit ;;
-- ) # Stop option processing -- ) # Stop option processing
shift; break ;; shift; break ;;
- ) # Use stdin as input. - ) # Use stdin as input.
@@ -99,7 +100,7 @@ while test $# -gt 0 ; do
*local*) *local*)
# First pass through any local machine types. # First pass through any local machine types.
echo $1 echo $1
exit 0;; exit ;;
* ) * )
break ;; break ;;
@@ -247,6 +248,7 @@ case $basic_machine in
| mips64vr4100 | mips64vr4100el \ | mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \ | mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \ | mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \ | mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \ | mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \ | mipsisa64 | mipsisa64el \
@@ -255,13 +257,14 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \ | mipstx39 | mipstx39el \
| mn10200 | mn10300 \ | mn10200 | mn10300 \
| ms1 \
| msp430 \ | msp430 \
| ns16k | ns32k \ | ns16k | ns32k \
| openrisc | or32 \ | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \ | pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b \ | sparcv8 | sparcv9 | sparcv9b \
@@ -273,6 +276,9 @@ case $basic_machine in
| z8k) | z8k)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m32c)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12) m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12. # Motorola 68HC11/12.
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
@@ -321,6 +327,7 @@ case $basic_machine in
| mips64vr4100-* | mips64vr4100el-* \ | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \ | mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \ | mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \ | mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \ | mipsisa64-* | mipsisa64el-* \
@@ -329,6 +336,7 @@ case $basic_machine in
| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \ | mipstx39-* | mipstx39el-* \
| mmix-* \ | mmix-* \
| ms1-* \
| msp430-* \ | msp430-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \ | orion-* \
@@ -336,7 +344,7 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* \ | romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
@@ -351,6 +359,8 @@ case $basic_machine in
| ymp-* \ | ymp-* \
| z8k-*) | z8k-*)
;; ;;
m32c-*)
;;
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
386bsd) 386bsd)
@@ -761,9 +771,8 @@ case $basic_machine in
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
;; ;;
or32 | or32-*) openrisc | openrisc-*)
basic_machine=or32-unknown basic_machine=or32-unknown
os=-coff
;; ;;
os400) os400)
basic_machine=powerpc-ibm basic_machine=powerpc-ibm
@@ -1089,12 +1098,9 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b) sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
@@ -1181,7 +1187,8 @@ case $os in
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@@ -1199,7 +1206,7 @@ case $os in
os=`echo $os | sed -e 's|nto|nto-qnx|'` os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;; ;;
-mac*) -mac*)
@@ -1388,6 +1395,9 @@ case $basic_machine in
*-be) *-be)
os=-beos os=-beos
;; ;;
*-haiku)
os=-haiku
;;
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
@@ -1559,7 +1569,7 @@ case $basic_machine in
esac esac
echo $basic_machine$os echo $basic_machine$os
exit 0 exit
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
+2 -2
View File
@@ -8,13 +8,13 @@
# (at your option) any later version. # (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information. # Please read the file COPYING, README and AUTHORS for more information.
# #
# $Id: configure.in,v 1.111.2.4 2005/08/03 14:27:48 alex Exp $ # $Id: configure.in,v 1.111.2.6 2005/10/15 12:44:08 alex Exp $
# #
# -- Initialisation -- # -- Initialisation --
AC_PREREQ(2.50) AC_PREREQ(2.50)
AC_INIT(ngircd, 0.9.1) AC_INIT(ngircd, 0.9.2)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c) AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6) AM_INIT_AUTOMAKE(1.6)
+6
View File
@@ -1,3 +1,9 @@
ngircd (0.9.2-0ab1) unstable; urgency=low
* New "upstream release" fixing a few bugs in 0.9.1.
-- Alexander Barton <alex@barton.de> Sat, 15 Oct 2005 14:10:34 +0200
ngircd (0.9.1-0ab1) unstable; urgency=medium ngircd (0.9.1-0ab1) unstable; urgency=medium
* New "upstream release" addressing two problems in ngIRCd 0.9.0. * New "upstream release" addressing two problems in ngIRCd 0.9.0.
+1 -1
View File
@@ -1,5 +1,5 @@
%define name ngircd %define name ngircd
%define version 0.9.1 %define version 0.9.2
%define release 1 %define release 1
%define prefix %{_prefix} %define prefix %{_prefix}
+10 -6
View File
@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: conf.c,v 1.77 2005/06/17 19:16:53 fw Exp $"; static char UNUSED id[] = "$Id: conf.c,v 1.77.2.1 2005/10/11 19:28:47 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -204,6 +204,7 @@ Conf_UnsetServer( CONN_ID Idx )
* Non-Server-Connections will be silently ignored. */ * Non-Server-Connections will be silently ignored. */
int i; int i;
time_t t;
/* Check all our configured servers */ /* Check all our configured servers */
for( i = 0; i < MAX_SERVERS; i++ ) for( i = 0; i < MAX_SERVERS; i++ )
@@ -221,11 +222,14 @@ Conf_UnsetServer( CONN_ID Idx )
else else
{ {
/* Set time for next connect attempt */ /* Set time for next connect attempt */
if( Conf_Server[i].lasttry < time( NULL ) - Conf_ConnectRetry ) t = time(NULL);
{ if (Conf_Server[i].lasttry < t - Conf_ConnectRetry) {
/* Okay, the connection was established "long enough": */ /* The connection has been "long", so we don't
Conf_Server[i].lasttry = time( NULL ) - Conf_ConnectRetry + RECONNECT_DELAY; * require the next attempt to be delayed. */
} Conf_Server[i].lasttry =
t - Conf_ConnectRetry + RECONNECT_DELAY;
} else
Conf_Server[i].lasttry = t;
} }
} }
} /* Conf_UnsetServer */ } /* Conf_UnsetServer */
+39 -24
View File
@@ -16,7 +16,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: conn.c,v 1.155.2.1 2005/07/02 14:45:07 alex Exp $"; static char UNUSED id[] = "$Id: conn.c,v 1.155.2.3 2005/10/11 19:28:47 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -694,24 +694,34 @@ Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient )
c = Client_GetFromConn( Idx ); c = Client_GetFromConn( Idx );
/* Should the client be informed? */ /* Should the client be informed? */
if( InformClient ) if (InformClient) {
{
#ifndef STRICT_RFC #ifndef STRICT_RFC
/* Send statistics to client if registered as user: */ /* Send statistics to client if registered as user: */
if(( c != NULL ) && ( Client_Type( c ) == CLIENT_USER )) if ((c != NULL) && (Client_Type(c) == CLIENT_USER)) {
{ Conn_WriteStr( Idx,
Conn_WriteStr( Idx, "NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.", Client_ThisServer( ), NOTICE_TXTPREFIX, (double)My_Connections[Idx].bytes_in / 1024, (double)My_Connections[Idx].bytes_out / 1024 ); "NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.",
Client_ID(Client_ThisServer()), NOTICE_TXTPREFIX,
(double)My_Connections[Idx].bytes_in / 1024,
(double)My_Connections[Idx].bytes_out / 1024);
} }
#endif #endif
/* Send ERROR to client (see RFC!) */ /* Send ERROR to client (see RFC!) */
if( FwdMsg ) Conn_WriteStr( Idx, "ERROR :%s", FwdMsg ); if (FwdMsg)
else Conn_WriteStr( Idx, "ERROR :Closing connection." ); Conn_WriteStr(Idx, "ERROR :%s", FwdMsg);
else
Conn_WriteStr(Idx, "ERROR :Closing connection.");
} }
/* Try to write out the write buffer */ /* Try to write out the write buffer. Note: Handle_Write() eventually
* removes the CLIENT structure associated with this connection if an
* error occurs! So we have to re-check if there is still an valid
* CLIENT structure after calling Handle_Write() ...*/
(void)Handle_Write( Idx ); (void)Handle_Write( Idx );
/* Search client, if any (re-check!) */
c = Client_GetFromConn( Idx );
/* Shut down socket */ /* Shut down socket */
if( close( My_Connections[Idx].sock ) != 0 ) if( close( My_Connections[Idx].sock ) != 0 )
{ {
@@ -855,23 +865,28 @@ Handle_Write( CONN_ID Idx )
res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &sock_len ); res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &sock_len );
assert( sock_len == sizeof( err )); assert( sock_len == sizeof( err ));
/* Fehler aufgetreten? */ /* Error while connecting? */
if(( res != 0 ) || ( err != 0 )) if ((res != 0) || (err != 0)) {
{ if (res != 0)
/* Fehler! */ Log(LOG_CRIT, "getsockopt (connection %d): %s!",
if( res != 0 ) Log( LOG_CRIT, "getsockopt (connection %d): %s!", Idx, strerror( errno )); Idx, strerror(errno));
else Log( LOG_CRIT, "Can't connect socket to \"%s:%d\" (connection %d): %s!", My_Connections[Idx].host, Conf_Server[Conf_GetServer( Idx )].port, Idx, strerror( err )); else
Log(LOG_CRIT,
"Can't connect socket to \"%s:%d\" (connection %d): %s!",
My_Connections[Idx].host,
Conf_Server[Conf_GetServer(Idx)].port,
Idx, strerror(err));
/* Clean up socket, connection and client structures */ /* Clean up the CLIENT structure (to avoid silly log
FD_CLR( My_Connections[Idx].sock, &My_Sockets ); * messages) and call Conn_Close() to do the rest. */
c = Client_GetFromConn( Idx ); c = Client_GetFromConn(Idx);
if( c ) Client_DestroyNow( c ); if (c)
close( My_Connections[Idx].sock ); Client_DestroyNow(c);
Init_Conn_Struct( Idx );
/* Bei Server-Verbindungen lasttry-Zeitpunkt auf "jetzt" setzen */ Conn_Close(Idx, "Can't connect!", NULL, false);
Conf_Server[Conf_GetServer( Idx )].lasttry = time( NULL );
Conf_UnsetServer( Idx ); /* Set the timestamp of the last connect attempt */
Conf_UnsetServer(Idx);
return false; return false;
} }
+11 -7
View File
@@ -1,6 +1,6 @@
/* /*
* ngIRCd -- The Next Generation IRC Daemon * ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) * Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: log.c,v 1.57 2005/06/24 19:55:10 alex Exp $"; static char UNUSED id[] = "$Id: log.c,v 1.57.2.1 2005/08/29 11:19:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -302,19 +302,23 @@ va_dcl
} /* Log_Resolver */ } /* Log_Resolver */
/**
* Send log messages to users flagged with the "s" mode.
* @param Msg The message to send.
*/
LOCAL void LOCAL void
Wall_ServerNotice( char *Msg ) Wall_ServerNotice( char *Msg )
{ {
/* Server-Notice an entsprechende User verschicken */
CLIENT *c; CLIENT *c;
assert( Msg != NULL ); assert( Msg != NULL );
c = Client_First( ); c = Client_First( );
while( c ) while(c) {
{ if (Client_Conn(c) > NONE && Client_HasMode(c, 's'))
if(( Client_Conn( c ) > NONE ) && ( Client_HasMode( c, 's' ))) IRC_WriteStrClient( c, "NOTICE %s :%s%s", Client_ThisServer( ), NOTICE_TXTPREFIX, Msg ); IRC_WriteStrClient(c, "NOTICE %s :%s%s", Client_ID(c),
NOTICE_TXTPREFIX, Msg);
c = Client_Next( c ); c = Client_Next( c );
} }
} /* Wall_ServerNotice */ } /* Wall_ServerNotice */
+5 -1
View File
@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: resolve.c,v 1.12 2005/05/28 10:46:50 fw Exp $"; static char UNUSED id[] = "$Id: resolve.c,v 1.12.2.1 2005/09/02 22:07:38 fw Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -108,6 +108,8 @@ Resolve_Addr( struct sockaddr_in *Addr )
else else
{ {
/* Error! */ /* Error! */
close(s->pipe[0]);
close(s->pipe[1]);
free( s ); free( s );
Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno )); Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
return NULL; return NULL;
@@ -149,6 +151,8 @@ Resolve_Name( char *Host )
else else
{ {
/* Error! */ /* Error! */
close(s->pipe[0]);
close(s->pipe[1]);
free( s ); free( s );
Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno )); Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
return NULL; return NULL;