mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-11-03 23:43:00 +00:00 
			
		
		
		
	Compare commits
	
		
			27 Commits
		
	
	
		
			rel-25-rc1
			...
			rel-0-7-0
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9295fce7cf | ||
| 
						 | 
					9dfe74ffe2 | ||
| 
						 | 
					10577f8e36 | ||
| 
						 | 
					fbead4a15c | ||
| 
						 | 
					322d3ebaec | ||
| 
						 | 
					bbfeaa953b | ||
| 
						 | 
					26790e960f | ||
| 
						 | 
					4b1711a614 | ||
| 
						 | 
					3630e840e5 | ||
| 
						 | 
					bcd6db9016 | ||
| 
						 | 
					0e7970cfe6 | ||
| 
						 | 
					9a9b4617aa | ||
| 
						 | 
					434a6887f0 | ||
| 
						 | 
					a9a605ddb9 | ||
| 
						 | 
					99ab8607c9 | ||
| 
						 | 
					14b1ae7aea | ||
| 
						 | 
					2517c2cb99 | ||
| 
						 | 
					75fb85d029 | ||
| 
						 | 
					1e599eb535 | ||
| 
						 | 
					36bd5d3ad6 | ||
| 
						 | 
					0be9053c17 | ||
| 
						 | 
					cd7d28d743 | ||
| 
						 | 
					f04a2ce2b4 | ||
| 
						 | 
					4d7a5df0e2 | ||
| 
						 | 
					7ba1bde408 | ||
| 
						 | 
					a7d00cd7b1 | ||
| 
						 | 
					3585e2bc50 | 
							
								
								
									
										18
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -10,8 +10,22 @@
 | 
			
		||||
                               -- ChangeLog --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ngIRCd CVS-HEAD
 | 
			
		||||
ngIRCd 0.7.0 (2003-05-01)
 | 
			
		||||
  - "ServerName" is checked better now: a dot (".") is required.
 | 
			
		||||
  - The KILL comand verifies and logs more parameters.
 | 
			
		||||
 | 
			
		||||
  ngIRCd 0.7.0-pre2 (2003-04-27)
 | 
			
		||||
  - CVS build system fixes (made autogen.sh more portable).
 | 
			
		||||
  - Fixed compilation and test-suite on Solaris (tested with 2.6).
 | 
			
		||||
  - New documentation file "doc/Platforms.txt" describing the status of
 | 
			
		||||
    ngIRCd on the various tested platforms.
 | 
			
		||||
  - Test for broken GCC on Mac OS X and disable "-pedantic" in this case.
 | 
			
		||||
  - Disable "-ansi" on Cygwin: system headers are incompatible.
 | 
			
		||||
  - The server tried to connect to other servers only once when DNS or
 | 
			
		||||
    socket failures occured.
 | 
			
		||||
  - Fixed --configtest: There is no variable "ServerPwd", it's "Password".
 | 
			
		||||
 | 
			
		||||
  ngIRCd 0.7.0-pre1 (2003-04-22)
 | 
			
		||||
  - New signal handler (more secure, actions are executed outside).
 | 
			
		||||
  - GCC: the compiler is now called with more warning options enabled.
 | 
			
		||||
  - Replaced a lot of str[n]cpy(), str[n]cat() and sprintf() calls with the
 | 
			
		||||
@@ -433,4 +447,4 @@ ngIRCd 0.0.1, 31.12.2001
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- 
 | 
			
		||||
$Id: ChangeLog,v 1.188 2003/04/20 23:12:57 alex Exp $
 | 
			
		||||
$Id: ChangeLog,v 1.188.2.13 2003/05/01 10:15:02 alex Exp $
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								INSTALL
									
									
									
									
									
								
							@@ -93,6 +93,7 @@ This files will be installed by default:
 | 
			
		||||
 | 
			
		||||
- /usr/local/sbin/ngircd: executable server
 | 
			
		||||
- /usr/local/etc/ngircd.conf: sample configuration (if not already present)
 | 
			
		||||
- /usr/local/share/doc/ngircd/: documentation
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
II. Useful make-targets
 | 
			
		||||
@@ -157,4 +158,4 @@ number. In both cases the server exits after the output.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- 
 | 
			
		||||
$Id: INSTALL,v 1.15 2003/03/23 23:13:15 alex Exp $
 | 
			
		||||
$Id: INSTALL,v 1.15.2.1 2003/04/22 20:00:32 alex Exp $
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								NEWS
									
									
									
									
									
								
							@@ -10,7 +10,7 @@
 | 
			
		||||
                                  -- NEWS --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ngIRCd CVS-HEAD
 | 
			
		||||
ngIRCd 0.7.0
 | 
			
		||||
 | 
			
		||||
  - New command CONNECT to enable and add server links. The syntax is not
 | 
			
		||||
    RFC-compatible: use "CONNECT <name> <port>" to enable and connect an
 | 
			
		||||
@@ -161,4 +161,4 @@ ngIRCd 0.0.1, 31.12.2001
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- 
 | 
			
		||||
$Id: NEWS,v 1.53 2003/04/20 23:14:28 alex Exp $
 | 
			
		||||
$Id: NEWS,v 1.53.2.2 2003/04/27 18:33:26 alex Exp $
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,10 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# $Id: autogen.sh,v 1.6 2003/04/13 22:34:17 alex Exp $
 | 
			
		||||
# $Id: autogen.sh,v 1.6.2.1 2003/04/22 10:18:41 alex Exp $
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
export WANT_AUTOMAKE=1.6
 | 
			
		||||
WANT_AUTOMAKE=1.6
 | 
			
		||||
export WANT_AUTOMAKE
 | 
			
		||||
 | 
			
		||||
aclocal && \
 | 
			
		||||
 autoheader && \
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32
									
								
								configure.in
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								configure.in
									
									
									
									
									
								
							@@ -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.89 2003/04/21 10:51:44 alex Exp $
 | 
			
		||||
# $Id: configure.in,v 1.89.2.6 2003/05/01 10:15:02 alex Exp $
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# -- Initialisierung --
 | 
			
		||||
 | 
			
		||||
AC_PREREQ(2.50)
 | 
			
		||||
AC_INIT(ngircd, CVSHEAD)
 | 
			
		||||
AC_INIT(ngircd, 0.7.0)
 | 
			
		||||
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
 | 
			
		||||
AC_CANONICAL_TARGET
 | 
			
		||||
AM_INIT_AUTOMAKE(1.6)
 | 
			
		||||
@@ -76,6 +76,13 @@ if test `uname` = "HP-UX"; then
 | 
			
		||||
	add_DEFINES="-D_XOPEN_SOURCE_EXTENDED $add_DEFINES"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if test `uname` = "SunOS"; then
 | 
			
		||||
	# define _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__
 | 
			
		||||
	# when compiling on SunOS (tested with 5.6):
 | 
			
		||||
	AC_MSG_RESULT([detected SunOS, defining _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__])
 | 
			
		||||
	add_DEFINES="-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ $add_DEFINES"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# -- Header --
 | 
			
		||||
 | 
			
		||||
AC_HEADER_STDC
 | 
			
		||||
@@ -259,7 +266,26 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
 | 
			
		||||
 | 
			
		||||
if test "$GCC" = "yes"; then
 | 
			
		||||
	the_CFLAGS="-Wmissing-declarations -Wpointer-arith -Wstrict-prototypes"
 | 
			
		||||
	add_CFLAGS="-Wall -W -ansi -pedantic $CFLAGS $CFLAGS_ADD"
 | 
			
		||||
	ansi=" -ansi"
 | 
			
		||||
	pedantic=" -pedantic"
 | 
			
		||||
 | 
			
		||||
	$CC --version | grep 20020420 > /dev/null 2>&1
 | 
			
		||||
	if test $? -eq 0; then
 | 
			
		||||
		# Mac OS X (and Darwin?) ship with a slightly broken
 | 
			
		||||
		# prerelease of GCC 3.1 which don't like -pedantic:
 | 
			
		||||
		AC_MSG_RESULT([detected broken GNU C compiler, disabling "-pedantic"])
 | 
			
		||||
		pedantic=""
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	uname | grep "CYGWIN" > /dev/null 2>&1
 | 
			
		||||
	if test $? -eq 0; then
 | 
			
		||||
		# The include files of Cygwin don't like -ansi,
 | 
			
		||||
		# so we disable it:
 | 
			
		||||
		AC_MSG_RESULT([detected Cygwin, disabling "-ansi"])
 | 
			
		||||
		ansi=""
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	add_CFLAGS="-Wall -W${ansi}${pedantic} $CFLAGS $CFLAGS_ADD"
 | 
			
		||||
else
 | 
			
		||||
	the_CFLAGS="$CFLAGS"
 | 
			
		||||
	add_CFLAGS="$CFLAGS_ADD"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
%define name    ngircd
 | 
			
		||||
%define version CurrentCVS
 | 
			
		||||
%define version 0.7.0
 | 
			
		||||
%define release 1
 | 
			
		||||
%define prefix  %{_prefix}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,10 @@ A: Yes. ngIRCd is compatible to the original ircd used by IRCNet. Actually
 | 
			
		||||
Q: Is there a homepage with further information and downloads?
 | 
			
		||||
A: Yes. Please visit <http://arthur.ath.cx/~alex/ngircd/>.
 | 
			
		||||
 | 
			
		||||
Q: Why should I use ngIRCd instead of the original one?
 | 
			
		||||
A: ngIRCd offers several benefits: no problems with dynamic IPs, easy to
 | 
			
		||||
   configure, open source (GPL), under active development.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
II. Compilation
 | 
			
		||||
~~~~~~~~~~~~~~~
 | 
			
		||||
@@ -60,4 +64,4 @@ A: Please file a bug report at <http://arthur.ath.cx/bugzilla/ngircd/>!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- 
 | 
			
		||||
$Id: FAQ.txt,v 1.5 2003/04/05 11:37:17 alex Exp $
 | 
			
		||||
$Id: FAQ.txt,v 1.5.2.1 2003/04/29 13:45:09 alex Exp $
 | 
			
		||||
 
 | 
			
		||||
@@ -9,11 +9,11 @@
 | 
			
		||||
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
 | 
			
		||||
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
 | 
			
		||||
#
 | 
			
		||||
# $Id: Makefile.am,v 1.16 2003/04/21 08:01:29 alex Exp $
 | 
			
		||||
# $Id: Makefile.am,v 1.16.2.1 2003/04/22 23:52:48 alex Exp $
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt README-AUX.txt \
 | 
			
		||||
	README-BeOS.txt RFC.txt sample-ngircd.conf
 | 
			
		||||
EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt Platforms.txt \
 | 
			
		||||
	README-AUX.txt README-BeOS.txt RFC.txt sample-ngircd.conf
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -f Makefile Makefile.in
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										53
									
								
								doc/Platforms.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								doc/Platforms.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
 | 
			
		||||
                      (c)2001-2003 by Alexander Barton,
 | 
			
		||||
                    alex@barton.de, http://www.barton.de/
 | 
			
		||||
 | 
			
		||||
               ngIRCd is free software and published under the
 | 
			
		||||
                   terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
                              -- Platforms.txt --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
This file lists the status of all platforms on which the ngIRCd has been
 | 
			
		||||
tested. Included is the date and version of the last "official" test and
 | 
			
		||||
the name of the tester/maintainer.
 | 
			
		||||
 | 
			
		||||
If you successfully compiled and tested ngIRCd on a platform that isn't
 | 
			
		||||
listed here, please contact Alexander Barton, <alex@barton.de>, so that this
 | 
			
		||||
list can be updated. Thanks for your help!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                              the executable works ("runs") as expected --+
 | 
			
		||||
                                tests run successfully ("make check") --+ |
 | 
			
		||||
                                           ngIRCd compiles ("make") --+ | |
 | 
			
		||||
                                                ./configure works --+ | | |
 | 
			
		||||
                                                                    | | | |
 | 
			
		||||
Platform                    Compiler     ngIRCd     Date     Tester C M T R See
 | 
			
		||||
--------------------------- ------------ ---------- -------- ------ - - - - ---
 | 
			
		||||
i386/pc/solaris2.9          gcc 3.2.2    0.7.x-CVS  03-04-28 alex   Y Y Y Y
 | 
			
		||||
i386/unknown/freebsd5.0     gcc 3.2.1    0.7.x-CVS  03-04-23 alex   Y Y Y Y
 | 
			
		||||
i386/unknown/netbsdelf1.6.1 gcc 2.95.3   0.7.x-CVS  03-04-23 alex   Y Y Y Y
 | 
			
		||||
i686/pc/cygwin              gcc 3.2      0.7.x-CVS  03-04-24 alex   Y Y n Y
 | 
			
		||||
i686/pc/linux-gnu           gcc 2.95/3.x 0.7.0-pre1 03-04-22 alex   Y Y Y Y (1)
 | 
			
		||||
m68k/apple/aux3.1.1         Orig. A/UX   0.7.x-CVS  03-04-22 alex   Y Y Y Y (2)
 | 
			
		||||
powerpc/apple/darwin6.5     gcc 3.1      0.7.x-CVS  03-04-23 alex   Y Y Y Y
 | 
			
		||||
sparc/sun/solaris2.6        gcc 2.95.3   0.7.x-CVS  03-04-22 alex   Y Y Y Y
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Notes
 | 
			
		||||
~~~~~
 | 
			
		||||
(1) i686/pc/linux-gnu:
 | 
			
		||||
    ngIRCd has been tested with various Linux distributions, such as SuSE,
 | 
			
		||||
    RedHat, Debian, and Gentoo using Kernels 2.2.x or 2.4.x and various
 | 
			
		||||
    versions of the GNU C compiler (2.95.3, 3.0, 3.2 and 3.3). The eldest
 | 
			
		||||
    glibc used was glibc-2.0.7. ngIRCd compiled and run on all these systems
 | 
			
		||||
    without problems.
 | 
			
		||||
 | 
			
		||||
(2) This compiler is an pre-ANSI C compiler, therefore the source code is
 | 
			
		||||
    automatically converted using the included ansi2knr tool while building.
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
-- 
 | 
			
		||||
$Id: Platforms.txt,v 1.1.2.4 2003/04/28 00:14:04 alex Exp $
 | 
			
		||||
@@ -22,7 +22,7 @@ in all details. But because the ngIRCd should be a fully compatible
 | 
			
		||||
replacement for this server ("ircd") it tries to emulate these differences.
 | 
			
		||||
 | 
			
		||||
If you don't like this behavior please ./configure the ngIRCd using the
 | 
			
		||||
"--enable-strict-rfc" command line option. But please not: not all IRC
 | 
			
		||||
"--enable-strict-rfc" command line option. But please note: not all IRC
 | 
			
		||||
clients are compatible with such an server, some can't even connect at all!
 | 
			
		||||
Therefore this option isn't desired for "normal operation".
 | 
			
		||||
 | 
			
		||||
@@ -104,4 +104,4 @@ channel mode). In this case <limit> should be "0".
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- 
 | 
			
		||||
$Id: Protocol.txt,v 1.9 2003/04/21 12:48:40 alex Exp $
 | 
			
		||||
$Id: Protocol.txt,v 1.9.2.1 2003/04/29 13:42:24 alex Exp $
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
# $Id: sample-ngircd.conf,v 1.20 2003/03/10 00:23:34 alex Exp $
 | 
			
		||||
# $Id: sample-ngircd.conf,v 1.20.2.2 2003/04/29 12:37:17 alex Exp $
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# This is a sample configuration file for the ngIRCd, which must adept to
 | 
			
		||||
@@ -16,13 +16,17 @@
 | 
			
		||||
	# configuration of the server, like the server name and the ports
 | 
			
		||||
	# on which the server should be listening.
 | 
			
		||||
	
 | 
			
		||||
	# Server name in the IRC-network
 | 
			
		||||
	# Server name in the IRC network, must contain at least one dot
 | 
			
		||||
	# (".") and be unique in the IRC network.
 | 
			
		||||
	Name = irc.the.net
 | 
			
		||||
	
 | 
			
		||||
	# Info text of the server. This will be shown by WHOIS and
 | 
			
		||||
	# LINKS requests for example.
 | 
			
		||||
	Info = Server Info Text
 | 
			
		||||
	
 | 
			
		||||
	# Global password for all users needed to connect to the server
 | 
			
		||||
	;Password = abc
 | 
			
		||||
	
 | 
			
		||||
	# Information about the server and the administrator, used by the
 | 
			
		||||
	# ADMIN command.
 | 
			
		||||
	;AdminInfo1 = Description
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
 | 
			
		||||
#include "portab.h"
 | 
			
		||||
 | 
			
		||||
static char UNUSED id[] = "$Id: conf.c,v 1.57 2003/04/21 11:06:07 alex Exp $";
 | 
			
		||||
static char UNUSED id[] = "$Id: conf.c,v 1.57.2.2 2003/04/29 12:37:18 alex Exp $";
 | 
			
		||||
 | 
			
		||||
#include "imp.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
@@ -108,7 +108,7 @@ Conf_Test( VOID )
 | 
			
		||||
	puts( "[GLOBAL]" );
 | 
			
		||||
	printf( "  ServerName = %s\n", Conf_ServerName );
 | 
			
		||||
	printf( "  ServerInfo = %s\n", Conf_ServerInfo );
 | 
			
		||||
	printf( "  ServerPwd = %s\n", Conf_ServerPwd );
 | 
			
		||||
	printf( "  Password = %s\n", Conf_ServerPwd );
 | 
			
		||||
	printf( "  AdminInfo1 = %s\n", Conf_ServerAdmin1 );
 | 
			
		||||
	printf( "  AdminInfo2 = %s\n", Conf_ServerAdmin2 );
 | 
			
		||||
	printf( "  AdminEMail = %s\n", Conf_ServerAdminMail );
 | 
			
		||||
@@ -837,6 +837,17 @@ Validate_Config( BOOLEAN Configtest )
 | 
			
		||||
			exit( 1 );
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	if( ! strchr( Conf_ServerName, '.' ))
 | 
			
		||||
	{
 | 
			
		||||
		/* No dot in server name! */
 | 
			
		||||
		Config_Error( LOG_ALERT, "Invalid server name configured in \"%s\" ('ServerName'): Dot missing!", NGIRCd_ConfFile );
 | 
			
		||||
		if( ! Configtest )
 | 
			
		||||
		{
 | 
			
		||||
			Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
 | 
			
		||||
			exit( 1 );
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifdef STRICT_RFC
 | 
			
		||||
	if( ! Conf_ServerAdminMail[0] )
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
 | 
			
		||||
#include "portab.h"
 | 
			
		||||
 | 
			
		||||
static char UNUSED id[] = "$Id: conn.c,v 1.122 2003/04/21 10:52:26 alex Exp $";
 | 
			
		||||
static char UNUSED id[] = "$Id: conn.c,v 1.122.2.1 2003/04/25 16:50:53 alex Exp $";
 | 
			
		||||
 | 
			
		||||
#include "imp.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
@@ -151,7 +151,7 @@ Conn_Exit( VOID )
 | 
			
		||||
#ifdef RENDEZVOUS
 | 
			
		||||
	Rendezvous_UnregisterListeners( );
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	/* Sockets schliessen */
 | 
			
		||||
	for( i = 0; i < Conn_MaxFD + 1; i++ )
 | 
			
		||||
	{
 | 
			
		||||
@@ -183,7 +183,7 @@ Conn_Exit( VOID )
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	free( My_Connections );
 | 
			
		||||
	My_Connections = NULL;
 | 
			
		||||
	Pool_Size = 0;
 | 
			
		||||
@@ -217,7 +217,7 @@ Conn_ExitListeners( VOID )
 | 
			
		||||
#ifdef RENDEZVOUS
 | 
			
		||||
	Rendezvous_UnregisterListeners( );
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	Log( LOG_INFO, "Shutting down all listening sockets ..." );
 | 
			
		||||
	for( i = 0; i < Conn_MaxFD + 1; i++ )
 | 
			
		||||
	{
 | 
			
		||||
@@ -240,7 +240,7 @@ Conn_NewListener( CONST UINT Port )
 | 
			
		||||
#ifdef RENDEZVOUS
 | 
			
		||||
	CHAR name[CLIENT_ID_LEN], *info;
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	/* Server-"Listen"-Socket initialisieren */
 | 
			
		||||
	memset( &addr, 0, sizeof( addr ));
 | 
			
		||||
	addr.sin_family = AF_INET;
 | 
			
		||||
@@ -415,7 +415,7 @@ Conn_Handler( VOID )
 | 
			
		||||
		tv.tv_usec = 0;
 | 
			
		||||
		if( timeout ) tv.tv_sec = TIME_RES;
 | 
			
		||||
		else tv.tv_sec = 0;
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		/* Auf Aktivitaet warten */
 | 
			
		||||
		i = select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv );
 | 
			
		||||
		if( i == 0 )
 | 
			
		||||
@@ -443,7 +443,7 @@ Conn_Handler( VOID )
 | 
			
		||||
			/* Es kann geschrieben werden ... */
 | 
			
		||||
			idx = Socket2Index( i );
 | 
			
		||||
			if( idx == NONE ) continue;
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
			if( ! Handle_Write( idx ))
 | 
			
		||||
			{
 | 
			
		||||
				/* Fehler beim Schreiben! Diesen Socket nun
 | 
			
		||||
@@ -899,7 +899,7 @@ New_Connection( INT Sock )
 | 
			
		||||
		Log( LOG_CRIT, "Can't accept connection: %s!", strerror( errno ));
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
#ifdef USE_TCPWRAP
 | 
			
		||||
	/* Validate socket using TCP Wrappers */
 | 
			
		||||
	request_init( &req, RQ_DAEMON, PACKAGE_NAME, RQ_FILE, new_sock, RQ_CLIENT_SIN, &new_addr, NULL );
 | 
			
		||||
@@ -921,10 +921,10 @@ New_Connection( INT Sock )
 | 
			
		||||
	if( idx >= Pool_Size )
 | 
			
		||||
	{
 | 
			
		||||
		new_size = Pool_Size + CONNECTION_POOL;
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		/* Im bisherigen Pool wurde keine freie Connection-Struktur mehr gefunden.
 | 
			
		||||
		 * Wenn erlaubt und moeglich muss nun der Pool vergroessert werden: */
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		if( Conf_MaxConnections > 0 )
 | 
			
		||||
		{
 | 
			
		||||
			/* Es ist ein Limit konfiguriert */
 | 
			
		||||
@@ -945,7 +945,7 @@ New_Connection( INT Sock )
 | 
			
		||||
			close( new_sock );
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		/* zunaechst realloc() versuchen; wenn das scheitert, malloc() versuchen
 | 
			
		||||
		 * und Daten ggf. "haendisch" umkopieren. (Haesslich! Eine wirklich
 | 
			
		||||
		 * dynamische Verwaltung waere wohl _deutlich_ besser ...) */
 | 
			
		||||
@@ -962,21 +962,21 @@ New_Connection( INT Sock )
 | 
			
		||||
				close( new_sock );
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
			/* Struktur umkopieren ... */
 | 
			
		||||
			memcpy( ptr, My_Connections, sizeof( CONNECTION ) * Pool_Size );
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
			Log( LOG_DEBUG, "Allocated new connection pool for %ld items (%ld bytes). [malloc()/memcpy()]", new_size, sizeof( CONNECTION ) * new_size );
 | 
			
		||||
		}
 | 
			
		||||
		else Log( LOG_DEBUG, "Allocated new connection pool for %ld items (%ld bytes). [realloc()]", new_size, sizeof( CONNECTION ) * new_size );
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		/* Adjust pointer to new block */
 | 
			
		||||
		My_Connections = ptr;
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		/* Initialize new items */
 | 
			
		||||
		for( idx = Pool_Size; idx < new_size; idx++ ) Init_Conn_Struct( idx );
 | 
			
		||||
		idx = Pool_Size;
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		/* Adjust new pool size */
 | 
			
		||||
		Pool_Size = new_size;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1011,7 +1011,7 @@ New_Connection( INT Sock )
 | 
			
		||||
		/* Sub-Prozess wurde asyncron gestartet */
 | 
			
		||||
		My_Connections[idx].res_stat = s;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	/* Penalty-Zeit setzen */
 | 
			
		||||
	Conn_SetPenalty( idx, 4 );
 | 
			
		||||
} /* New_Connection */
 | 
			
		||||
@@ -1142,14 +1142,14 @@ Handle_Buffer( CONN_ID Idx )
 | 
			
		||||
			if( ! Unzip_Buffer( Idx )) return FALSE;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
		if( My_Connections[Idx].rdatalen < 1 ) break;
 | 
			
		||||
 | 
			
		||||
		/* Eine komplette Anfrage muss mit CR+LF enden, vgl.
 | 
			
		||||
		 * RFC 2812. Haben wir eine? */
 | 
			
		||||
		My_Connections[Idx].rbuf[My_Connections[Idx].rdatalen] = '\0';
 | 
			
		||||
		ptr = strstr( My_Connections[Idx].rbuf, "\r\n" );
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
		if( ptr ) delta = 2;
 | 
			
		||||
#ifndef STRICT_RFC
 | 
			
		||||
		else
 | 
			
		||||
@@ -1164,7 +1164,7 @@ Handle_Buffer( CONN_ID Idx )
 | 
			
		||||
			else if( ptr2 ) ptr = ptr2;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
		action = FALSE;
 | 
			
		||||
		if( ptr )
 | 
			
		||||
		{
 | 
			
		||||
@@ -1219,10 +1219,10 @@ Handle_Buffer( CONN_ID Idx )
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		if( action ) result = TRUE;
 | 
			
		||||
	} while( action );
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	return result;
 | 
			
		||||
} /* Handle_Buffer */
 | 
			
		||||
 | 
			
		||||
@@ -1348,7 +1348,7 @@ Check_Servers( VOID )
 | 
			
		||||
LOCAL VOID
 | 
			
		||||
New_Server( INT Server, CONN_ID Idx )
 | 
			
		||||
{
 | 
			
		||||
	/* Neue Server-Verbindung aufbauen */
 | 
			
		||||
	/* Establish new server link */
 | 
			
		||||
 | 
			
		||||
	struct sockaddr_in new_addr;
 | 
			
		||||
	struct in_addr inaddr;
 | 
			
		||||
@@ -1358,11 +1358,12 @@ New_Server( INT Server, CONN_ID Idx )
 | 
			
		||||
	assert( Server > NONE );
 | 
			
		||||
	assert( Idx > NONE );
 | 
			
		||||
 | 
			
		||||
	/* Wurde eine gueltige IP-Adresse gefunden? */
 | 
			
		||||
	/* Did we get a valid IP address? */
 | 
			
		||||
	if( ! Conf_Server[Server].ip[0] )
 | 
			
		||||
	{
 | 
			
		||||
		/* Nein. Verbindung wieder freigeben: */
 | 
			
		||||
		/* No. Free connection structure and abort: */
 | 
			
		||||
		Init_Conn_Struct( Idx );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		Log( LOG_ERR, "Can't connect to \"%s\" (connection %d): ip address unknown!", Conf_Server[Server].host, Idx );
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1377,8 +1378,9 @@ New_Server( INT Server, CONN_ID Idx )
 | 
			
		||||
	if( inaddr.s_addr == (unsigned)-1 )
 | 
			
		||||
#endif
 | 
			
		||||
	{
 | 
			
		||||
		/* Konnte Adresse nicht konvertieren */
 | 
			
		||||
		/* Can't convert IP address */
 | 
			
		||||
		Init_Conn_Struct( Idx );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		Log( LOG_ERR, "Can't connect to \"%s\" (connection %d): can't convert ip address %s!", Conf_Server[Server].host, Idx, Conf_Server[Server].ip );
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1391,7 +1393,9 @@ New_Server( INT Server, CONN_ID Idx )
 | 
			
		||||
	new_sock = socket( PF_INET, SOCK_STREAM, 0 );
 | 
			
		||||
	if ( new_sock < 0 )
 | 
			
		||||
	{
 | 
			
		||||
		/* Can't create socket */
 | 
			
		||||
		Init_Conn_Struct( Idx );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		Log( LOG_CRIT, "Can't create socket: %s!", strerror( errno ));
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1401,9 +1405,11 @@ New_Server( INT Server, CONN_ID Idx )
 | 
			
		||||
	res = connect( new_sock, (struct sockaddr *)&new_addr, sizeof( new_addr ));
 | 
			
		||||
	if(( res != 0 ) && ( errno != EINPROGRESS ))
 | 
			
		||||
	{
 | 
			
		||||
		/* Can't connect socket */
 | 
			
		||||
		Log( LOG_CRIT, "Can't connect socket: %s!", strerror( errno ));
 | 
			
		||||
		close( new_sock );
 | 
			
		||||
		Init_Conn_Struct( Idx );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1411,24 +1417,26 @@ New_Server( INT Server, CONN_ID Idx )
 | 
			
		||||
	c = Client_NewLocal( Idx, inet_ntoa( new_addr.sin_addr ), CLIENT_UNKNOWNSERVER, FALSE );
 | 
			
		||||
	if( ! c )
 | 
			
		||||
	{
 | 
			
		||||
		/* Can't create new client structure */
 | 
			
		||||
		close( new_sock );
 | 
			
		||||
		Init_Conn_Struct( Idx );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		Log( LOG_ALERT, "Can't establish connection: can't create client structure!" );
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	Client_SetIntroducer( c, c );
 | 
			
		||||
	Client_SetToken( c, TOKEN_OUTBOUND );
 | 
			
		||||
 | 
			
		||||
	/* Verbindung registrieren */
 | 
			
		||||
	/* Register connection */
 | 
			
		||||
	My_Connections[Idx].sock = new_sock;
 | 
			
		||||
	My_Connections[Idx].addr = new_addr;
 | 
			
		||||
	strlcpy( My_Connections[Idx].host, Conf_Server[Server].host, sizeof( My_Connections[Idx].host ));
 | 
			
		||||
 | 
			
		||||
	/* Neuen Socket registrieren */
 | 
			
		||||
	/* Register new socket */
 | 
			
		||||
	FD_SET( new_sock, &My_Sockets );
 | 
			
		||||
	FD_SET( new_sock, &My_Connects );
 | 
			
		||||
	if( new_sock > Conn_MaxFD ) Conn_MaxFD = new_sock;
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	Log( LOG_DEBUG, "Registered new connection %d on socket %d.", Idx, My_Connections[Idx].sock );
 | 
			
		||||
} /* New_Server */
 | 
			
		||||
 | 
			
		||||
@@ -1531,7 +1539,7 @@ Read_Resolver_Result( INT r_fd )
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Log( LOG_DEBUG, "Resolver: %s is \"%s\".", My_Connections[i].host, result );
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	/* Aufraeumen */
 | 
			
		||||
	close( My_Connections[i].res_stat->pipe[0] );
 | 
			
		||||
	close( My_Connections[i].res_stat->pipe[1] );
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
 | 
			
		||||
#include "portab.h"
 | 
			
		||||
 | 
			
		||||
static char UNUSED id[] = "$Id: irc.c,v 1.120 2003/03/31 15:54:21 alex Exp $";
 | 
			
		||||
static char UNUSED id[] = "$Id: irc.c,v 1.120.2.1 2003/04/29 12:20:14 alex Exp $";
 | 
			
		||||
 | 
			
		||||
#include "imp.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
@@ -95,8 +95,30 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
 | 
			
		||||
	if( c )
 | 
			
		||||
	{
 | 
			
		||||
		/* Yes, there is such a client -- but is it a valid user? */
 | 
			
		||||
		if( Client_Type( c ) == CLIENT_SERVER ) IRC_WriteStrClient( Client, ERR_CANTKILLSERVER_MSG, Client_ID( Client ));
 | 
			
		||||
		else if( Client_Type( c ) != CLIENT_USER  )IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
 | 
			
		||||
		if( Client_Type( c ) == CLIENT_SERVER )
 | 
			
		||||
		{
 | 
			
		||||
			if( Client != Client_ThisServer( )) IRC_WriteStrClient( Client, ERR_CANTKILLSERVER_MSG, Client_ID( Client ));
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				/* Oops, I should kill another server!? */
 | 
			
		||||
				Log( LOG_ERR, "Can't KILL server \"%s\"!", Req->argv[0] );
 | 
			
		||||
				conn = Client_Conn( Client_NextHop( c ));
 | 
			
		||||
				assert( conn > NONE );
 | 
			
		||||
				Conn_Close( conn, NULL, "Nick collision for server!?", TRUE );
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else if( Client_Type( c ) != CLIENT_USER  )
 | 
			
		||||
		{
 | 
			
		||||
			if( Client != Client_ThisServer( )) IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				/* Oops, what sould I close?? */
 | 
			
		||||
				Log( LOG_ERR, "Can't KILL \"%s\": invalid client type!", Req->argv[0] );
 | 
			
		||||
				conn = Client_Conn( Client_NextHop( c ));
 | 
			
		||||
				assert( conn > NONE );
 | 
			
		||||
				Conn_Close( conn, NULL, "Collision for invalid client type!?", TRUE );
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			/* Kill user NOW! */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
# ngIRCd Test Suite
 | 
			
		||||
# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $
 | 
			
		||||
# $Id: getpid.sh,v 1.2.4.1 2003/04/22 20:01:23 alex Exp $
 | 
			
		||||
 | 
			
		||||
# wurde ein Name uebergeben?
 | 
			
		||||
[ $# -ne 1 ] && exit 1
 | 
			
		||||
@@ -18,7 +18,9 @@ fi
 | 
			
		||||
 | 
			
		||||
# PID ermitteln
 | 
			
		||||
ps $PS_FLAGS > procs.tmp
 | 
			
		||||
pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS )
 | 
			
		||||
cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n > pids.tmp
 | 
			
		||||
pid=`head $HEAD_FLAGS pids.tmp`
 | 
			
		||||
rm -rf procs.tmp pids.tmp
 | 
			
		||||
 | 
			
		||||
# ermittelte PID validieren
 | 
			
		||||
[ "$pid" -gt 1 ] > /dev/null 2>&1
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
# ngIRCd Test Suite
 | 
			
		||||
# $Id: stress-server.sh,v 1.6 2002/09/23 22:07:43 alex Exp $
 | 
			
		||||
# $Id: stress-server.sh,v 1.6.4.1 2003/04/22 20:01:23 alex Exp $
 | 
			
		||||
 | 
			
		||||
[ -z "$srcdir" ] && srcdir=`dirname $0`
 | 
			
		||||
 | 
			
		||||
[ $1 -gt 0 ] 2> /dev/null && CLIENTS=$1 || CLIENTS=5
 | 
			
		||||
[ "$1" -gt 0 ] 2> /dev/null && CLIENTS="$1" || CLIENTS=5
 | 
			
		||||
 | 
			
		||||
name=`basename $0`
 | 
			
		||||
test=`echo ${name} | cut -d '.' -f 1`
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user