1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-15 16:54:07 +00:00

Compare commits

...

42 Commits

Author SHA1 Message Date
Alexander Barton
a9823b2db1 ngIRCd 0.8.3 2005-02-03 10:16:25 +00:00
Alexander Barton
3563147514 Fixed a bug that could case a root exploit when the daemon is compiled
to do IDENT lookups and is logging to syslog. Bug discovered by CoKi,
<coki@nosystem.com.ar>, thanks a lot! [from HEAD.]
(http://www.nosystem.com.ar/advisories/advisory-11.txt)
2005-02-03 09:27:09 +00:00
Alexander Barton
81d21d4592 "ngIRCd" instead of "ngircd" ... 2005-02-03 09:20:58 +00:00
Alexander Barton
117cc7055d Updated config.guess and config.sub 2005-01-27 00:15:15 +00:00
Alexander Barton
7f1a44dd40 Fixed wrong maintainer name ... 2005-01-27 00:01:10 +00:00
Alexander Barton
51e5d9d74d Ooops, bad email address ... 2005-01-26 22:18:48 +00:00
Alexander Barton
93a0179a34 ngIRCd package 0.8.2-0ab1 2005-01-26 22:16:50 +00:00
Alexander Barton
314cf1238b ngIRCd 0.8.2 2005-01-26 22:05:26 +00:00
Alexander Barton
286b29ffcd We are in the year 2005 now! :-) 2005-01-26 22:02:36 +00:00
Alexander Barton
2283454917 Added doc/SSL.txt (from CVS HEAD) to 0.8.x branch. 2005-01-26 21:47:47 +00:00
Alexander Barton
f0b3a9cacd Fixed a buffer overflow that could cause the daemon to crash. Bug found
by Florian Westphal, <westphal@foo.fh-furtwangen.de>. [from HEAD]
2005-01-26 13:27:01 +00:00
Alexander Barton
9dc7666eed Updated list of contributors. 2005-01-26 13:26:41 +00:00
Alexander Barton
87ce4379e8 Fixed a possible buffer underrun when reading the MOTD file. Thanks to
Florian Westphal, <westphal@foo.fh-furtwangen.de>. [from HEAD].
2005-01-24 14:22:30 +00:00
Alexander Barton
0eb7ad58d0 Fixed detection of IRC lines which are too long to send. Detected by
Florian Westphal, <westphal@foo.fh-furtwangen.de>. [from HEAD]
2005-01-19 23:35:42 +00:00
Alexander Barton
883251ca05 Fixed return values of our own implementation of strlcpy(). The code has
been taken from rsync and they fixed it, but we didn't until today :-/ [HEAD]
2005-01-18 09:09:05 +00:00
Alexander Barton
e04d74ad3b Version 0.8.1 2004-12-25 00:20:57 +00:00
Alexander Barton
002d9299a6 Updated config.guess and config.sub [from HEAD]. 2004-12-25 00:11:42 +00:00
Alexander Barton
33cec4efd9 Added some more debug code ... [from HEAD]. 2004-12-25 00:00:42 +00:00
Alexander Barton
0999dc7907 Updated list of supported/tested platforms. 2004-11-09 10:58:01 +00:00
Alexander Barton
35fe11fea4 Fixed wrong variable names in output of "ngircd --configtest". [From HEAD]. 2004-09-27 11:30:52 +00:00
Alexander Barton
180fdb542b Added functions.inc to EXTRA_DIST files. [From HEAD]. 2004-09-08 09:45:53 +00:00
Alexander Barton
9cb9cca536 Fixed echo without newline for systems not understanding "echo -n"; added
new file "functions.inc" for functions usable by all test scripts. [From HEAD].
2004-09-06 22:07:26 +00:00
Alexander Barton
593cc7b4e2 Reverted extension of the "make all" target in the test-suite. 2004-09-06 20:35:00 +00:00
Alexander Barton
0be284db30 Fixed wrong exit code check of "kill -0". [From HEAD]. 2004-09-06 20:30:43 +00:00
Alexander Barton
e2e89067ae Changed version number to reflect CVS branch-0-8-x. 2004-09-06 00:41:34 +00:00
Alexander Barton
f632ca2645 ed name of "default file" for ngircd-full package. And do the test if
the binary is executable after reading this file. [From HEAD].
2004-09-06 00:36:49 +00:00
Alexander Barton
12497e1dd2 Updated documentation. 2004-09-04 20:50:53 +00:00
Alexander Barton
cabd09d9ae Updated "test suite". From HEAD. 2004-09-04 20:49:36 +00:00
Alexander Barton
98b92e112a Information for configuring ngIRCd. From HEAD. 2004-09-03 20:02:02 +00:00
Alexander Barton
2d524b1958 Fixed wrong email address. 2004-07-28 16:03:42 +00:00
Alexander Barton
d989166d3f Added missing commas to debian control file, fixes bug #56.
Thanks to Kevin Otte (nivex@nivex.net) for the patch.
2004-07-15 08:59:09 +00:00
Alexander Barton
f7c63e9237 Debian package version 0.8.0-0ab1 2004-06-26 09:27:29 +00:00
Alexander Barton
0958133a0a ngIRCd 0.8.0 2004-06-26 09:19:58 +00:00
Alexander Barton
205fea28b3 Updated documentation. 2004-06-26 09:12:38 +00:00
Alexander Barton
8cd18eb6b4 Added cast to integer for Solaris. 2004-06-26 09:06:27 +00:00
Alexander Barton
7f66fd908e Fixed wrong buffer size calculation for resolver results. 2004-05-30 16:24:21 +00:00
Alexander Barton
3c33a41fe8 Version 0.8.0-pre2 2004-05-15 23:55:48 +00:00
Alexander Barton
0d0cdf4831 Fixed host name lookups when using IDENT user lookups. 2004-05-15 23:52:17 +00:00
Alexander Barton
030fef4a8a Enhanced logging to console when running in "no-detached mode": added PID
and log messages of resolver sub-processes. [from HEAD]
2004-05-15 23:51:13 +00:00
Alexander Barton
15d31d31db "make clean" and "make maintainer-clean" remove more files now. [from HEAD] 2004-05-11 00:38:17 +00:00
Alexander Barton
2a3ec21702 Version 0.8.0-pre1 2004-05-07 11:56:19 +00:00
Alexander Barton
9f9576ce31 New "chroot" feature (from Benjamin Pineau), introducing new configuration
variables "ChrootDir" and "MotdPhrase". [from HEAD]
2004-05-07 11:24:17 +00:00
41 changed files with 758 additions and 248 deletions

View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001-2005 Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
@@ -21,6 +21,7 @@ Goetz Hoffart, <goetz@hoffart.de> (goetz)
Ilja Osthoff, <i.osthoff@gmx.net> (ilja)
Benjamin Pineau, <ben@zouh.org>
Sean Reifschneider, <jafo-rpms@tummy.com>
Florian Westphal, <westphal@foo.fh-furtwangen.de>
Code snippets
@@ -31,4 +32,4 @@ Andrew Tridgell & Martin Pool: strl{cpy|cat}()-functions
--
$Id: AUTHORS,v 1.9 2004/05/07 11:19:20 alex Exp $
$Id: AUTHORS,v 1.8.2.2 2005/01/26 13:26:41 alex Exp $

View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001-2005 Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
@@ -10,8 +10,48 @@
-- ChangeLog --
ngIRCd CVSHEAD
ngIRCd 0.8.3 (2005-02-03)
- Fixed a bug that could case a root exploit when the daemon is compiled
to do IDENT lookups and is logging to syslog. Bug discovered by CoKi,
<coki@nosystem.com.ar>, thanks a lot!
(http://www.nosystem.com.ar/advisories/advisory-11.txt)
ngIRCd 0.8.2 (2005-01-26)
- Added doc/SSL.txt to distribution.
- Fixed a buffer overflow that could cause the daemon to crash. Bug found
by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
- Fixed a possible buffer underrun when reading the MOTD file. Thanks
to Florian Westphal, <westphal@foo.fh-furtwangen.de>.
- Fixed detection of IRC lines which are too long to send. Detected by
Florian Westphal, <westphal@foo.fh-furtwangen.de>.
- Fixed return values of our own implementation of strlcpy(). The code has
been taken from rsync and they fixed it, but we didn't until today :-/
It has only been used when the system didn't implement strlcpy by itself,
not on "modern" systems. Florian Westphal, <westphal@foo.fh-furtwangen.de>.
nIRCd 0.8.1 (2004-12-25)
- Autoconf: Updated config.guess and config.sub
- Added some more debug code ...
- Fixed wrong variable names in output of "ngircd --configtest".
- Debian: Fxied the name of the "default file" in the init script for
ngircd-full packages. And do the test if the binary is executable after
reading this file.
- Enhanced the "test suite": please have a look at src/testsuite/README!
ngIRCd 0.8.0 (2004-06-26)
- Fixed wrong buffer size calculation for results of the resolver.
ngIRCd 0.8.0-pre2 (2004-05-16)
- Enhanced logging to console when running in "no-detached mode": added
PID and log messages of resolver sub-processes.
- Fixed host name lookups when using IDENT user lookups.
- "make clean" and "make maintainer-clean" remove more files mow.
ngIRCd 0.8.0-pre1 (2004-05-07)
- Two new configuration options: "ChrootDir" and "MotdPhrase", thanks to
Benjamin Pineau <ben@zouh.org>. Now you can force the daemon to change
its root and working directory to something "safe". MotdPhrase is used
@@ -521,4 +561,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: ChangeLog,v 1.234 2004/05/07 11:19:20 alex Exp $
$Id: ChangeLog,v 1.233.2.20 2005/02/03 10:16:25 alex Exp $

16
INSTALL
View File

@@ -46,6 +46,20 @@ files (using a distribution archive or CVS) is as following:
3) make
4) make install
(Please see details below!)
Now the newly compiled executable "ngircd" is installed in its standard
location, /usr/local/sbin/.
The next step is to configure and afterwards starting the daemon. Please
have a look at the ngircd(8) and ngircd.conf(5) manual pages for details
and all possible options.
If no previous version of the configuration file exists (the standard name
is /usr/local/etc/ngircd.conf), a sample configuration file containing all
possible options will be installed there. You'll find its template in the
doc/ directory: sample-ngircd.conf.
1): "autogen.sh"
@@ -163,4 +177,4 @@ number. In both cases the server exits after the output.
--
$Id: INSTALL,v 1.19 2004/05/07 11:19:20 alex Exp $
$Id: INSTALL,v 1.18.2.2 2004/09/03 20:02:02 alex Exp $

View File

@@ -8,18 +8,21 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Makefile.am,v 1.14 2004/01/01 22:24:48 alex Exp $
# $Id: Makefile.am,v 1.14.2.1 2004/05/11 00:38:17 alex Exp $
#
AUTOMAKE_OPTIONS = gnu
SUBDIRS = doc src man contrib
clean-local:
rm -f build-stamp*
maintainer-clean-local:
rm -rf autom4te.cache
rm -f Makefile.in Makefile aclocal.m4 configure
rm -f mkinstalldirs missing depcomp install-sh
rm -f config.log build-stamp* debian
rm -f config.log debian
lint:
make -C src/ngircd lint

4
NEWS
View File

@@ -10,7 +10,7 @@
-- NEWS --
ngIRCd CVSHEAD
ngIRCd 0.8.0 (2004-06-26)
- Two new configuration options: "ChrootDir" and "MotdPhrase", thanks to
Benjamin Pineau <ben@zouh.org>. Now you can force the daemon to change
@@ -189,4 +189,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: NEWS,v 1.65 2004/05/07 11:19:20 alex Exp $
$Id: NEWS,v 1.64.2.3 2004/06/26 09:12:38 alex Exp $

2
README
View File

@@ -84,4 +84,4 @@ mail to: <alex@barton.de> or <alex@arthur.ath.cx>
--
$Id: README,v 1.19 2004/05/07 11:19:20 alex Exp $
$Id: README,v 1.18.2.1 2004/05/07 11:24:17 alex Exp $

109
config.guess vendored
View File

@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
timestamp='2004-01-05'
timestamp='2004-11-12'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -197,15 +197,21 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
amd64:OpenBSD:*:*)
echo x86_64-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
cats:OpenBSD:*:*)
echo arm-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
luna88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -221,28 +227,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pegasos:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mipseb-unknown-openbsd${UNAME_RELEASE}
echo mips64-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit 0 ;;
macppc:MirBSD:*:*)
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
exit 0 ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
@@ -280,14 +291,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha*:OpenVMS:*:*)
echo alpha-hp-vms
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
@@ -310,6 +319,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit 0 ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit 0 ;;
@@ -333,7 +345,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
@@ -405,6 +417,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -740,7 +755,7 @@ EOF
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
*:UNICOS/mp:*:*)
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
@@ -763,21 +778,7 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#if __GLIBC__ >= 2
LIBC=gnu
#else
LIBC=
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
# FreeBSD's kernel, but not the complete OS.
case ${LIBC} in gnu) kernel_only='k' ;; esac
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -826,9 +827,18 @@ EOF
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit 0 ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit 0 ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
@@ -1069,9 +1079,9 @@ EOF
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
M68*:*:R3V[567]*:*)
M68*:*:R3V[5678]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1169,9 +1179,10 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
case `uname -p` in
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
powerpc) UNAME_PROCESSOR=powerpc ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
@@ -1230,8 +1241,18 @@ EOF
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
*:DRAGONFLY:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly${UNAME_RELEASE}
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms && exit 0 ;;
I*) echo ia64-dec-vms && exit 0 ;;
V*) echo vax-dec-vms && exit 0 ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit 0 ;;
esac

77
config.sub vendored
View File

@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
timestamp='2004-01-05'
timestamp='2004-11-30'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -70,7 +70,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -145,7 +145,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
-apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@@ -237,7 +237,7 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m68000 | m68k | m88k | mcore \
| m32r | m32rle | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -262,12 +262,12 @@ case $basic_machine in
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -300,7 +300,7 @@ case $basic_machine in
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
@@ -308,7 +308,7 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32r-* \
| m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -326,8 +326,9 @@ case $basic_machine in
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
@@ -336,14 +337,14 @@ case $basic_machine in
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
@@ -363,6 +364,9 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -442,12 +446,27 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -470,6 +489,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -648,10 +671,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -732,10 +751,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -1018,6 +1033,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1048,6 +1067,9 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1070,7 +1092,7 @@ case $basic_machine in
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -1143,8 +1165,9 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
@@ -1282,6 +1305,9 @@ case $os in
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-none)
;;
*)
@@ -1362,6 +1388,9 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2004 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
# 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.102 2004/04/11 13:20:24 alex Exp $
# $Id: configure.in,v 1.102.2.7 2005/02/03 10:16:25 alex Exp $
#
# -- Initialisation --
AC_PREREQ(2.50)
AC_INIT(ngircd, CVSHEAD)
AC_INIT(ngircd, 0.8.3)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6)

View File

@@ -8,7 +8,7 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Makefile.am,v 1.3 2004/01/13 01:10:11 alex Exp $
# $Id: Makefile.am,v 1.3.2.1 2004/05/11 00:38:17 alex Exp $
#
EXTRA_DIST = rules changelog compat control copyright \
@@ -16,11 +16,12 @@ EXTRA_DIST = rules changelog compat control copyright \
maintainer-clean-local:
rm -f Makefile Makefile.in
clean-local:
rm -f ngircd.postinst.debhelper ngircd.postrm.debhelper \
ngircd.prerm.debhelper ngircd.substvars
rm -f ngircd-full.postinst.debhelper ngircd-full.postrm.debhelper \
ngircd-full.prerm.debhelper ngircd-full.substvars
rm -rf ngircd ngircd-full
rm -f files

View File

@@ -1,3 +1,34 @@
ngircd (0.8.3-0ab1) unstable; urgency=high
* New "upstream release", including security fixes.
-- Alexander Barton <alex@Arthur.Ath.CX> Thu, 3 Feb 2005 10:41:55 +0100
ngircd (0.8.2-0ab1) unstable; urgency=high
* New "upstream release", including security fixes.
-- Alexander Barton <alex@Arthur.Ath.CX> Wed, 26 Jan 2005 23:14:12 +0100
ngircd (0.8.1-0ab1) unstable; urgency=low
* New "upstream release".
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 25 Dec 2004 01:18:32 +0100
ngircd (0.8.0-0ab2) unstable; urgency=low
* Added missing commas to debian control file, fixes bug #56.
Thanks to Kevin Otte.
-- Alexander Barton <alex@Arthur.Ath.CX> Thu, 15 Jul 2004 10:53:39 +0200
ngircd (0.8.0-0ab1) unstable; urgency=low
* New upstream version.
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 26 Jun 2004 11:25:59 +0200
ngircd (0.7.7+HEAD-0ab5) unstable; urgency=low
* Updates from CVS HEAD branch, most notably: "INVITE- and BAN-lists

View File

@@ -7,7 +7,7 @@ Standards-Version: 3.5.8
Package: ngircd
Architecture: any
Depends: ${shlibs:Depends} ${misc:Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: A lightweight daemon for the Internet Relay Chat (IRC)
ngIRCd is a free open source daemon for the Internet Relay Chat (IRC)
network. It is written from scratch and is not based upon the original
@@ -27,7 +27,7 @@ Description: A lightweight daemon for the Internet Relay Chat (IRC)
Package: ngircd-full
Architecture: any
Depends: ${shlibs:Depends} ${misc:Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Conflicts: ngircd
Description: A lightweight daemon for the Internet Relay Chat (IRC)
ngIRCd is a free open source daemon for the Internet Relay Chat (IRC)

View File

@@ -2,18 +2,19 @@
#
# ngIRCd start and stop script for Debian-based systems
#
# $Id: ngircd.init,v 1.1 2003/12/31 17:20:11 alex Exp $
# $Id: ngircd.init,v 1.1.2.1 2004/09/06 00:36:49 alex Exp $
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/ngircd
NAME=ngIRCd
BASENAME=`basename $0`
DESC="IRC daemon"
PARAMS=""
test -x $DAEMON || exit 0
test -f /etc/default/$BASENAME && . /etc/default/$BASENAME
test -f /etc/default/ngircd && . /etc/default/ngircd
test -x $DAEMON || exit 0
Check_Config()
{

View File

@@ -8,10 +8,13 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Makefile.am,v 1.1 2004/02/29 17:19:43 alex Exp $
# $Id: Makefile.am,v 1.1.2.1 2004/05/11 00:38:17 alex Exp $
#
clean-local:
rm -rf build
maintainer-clean-local:
rm -f Makefile Makefile.in
# -eof-

View File

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

View File

@@ -26,20 +26,24 @@ list can be updated. Thanks for your help!
| | | |
Platform Compiler ngIRCd Date Tester C M T R See
--------------------------- ------------ ---------- -------- ------ - - - - ---
hppa/unknown/openbsd3.5 gcc 2.95.3 CVSHEAD 04-05-25 alex Y Y Y Y
hppa1.1/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
i386/unknown/freebsd5.0 gcc 3.2.1 0.7.0 03-05-15 alex Y Y Y Y
i386/unknown/gnu0.3 gcc 3.2.3 CVSHEAD 03-05-05 alex Y Y n Y
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
i386/unknown/gnu0.3 gcc 3.3.3 0.8.0 04-05-30 alex Y Y n Y
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 CVSHEAD 04-02-24 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 0.7.0 03-05-15 alex Y Y Y Y (1)
i686/pc/linux-gnu gcc 3.3.3 CVSHEAD 04-02-22 alex Y Y Y Y (1)
i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y n Y
i686/pc/linux-gnu gcc 2.95.4 0.8.0 04-05-30 alex Y Y Y Y (1)
i686/pc/linux-gnu gcc 3.3.3 0.8.0 04-05-30 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)
m68k/hp/hp-ux9.10 Orig. HPUX 0.7.x-CVS 03-04-30 goetz Y Y Y Y
m88k/dg/dgux5.4R3.10 gcc 2.5.8 CVSHEAD 04-03-15 alex Y Y ? ?
powerpc/apple/darwin6.5 gcc 3.1 0.7.x-CVS 03-04-23 alex Y Y Y Y
powerpc/apple/darwin7.2.0 gcc 3.3 CVSHEAD 04-02-22 alex Y Y Y Y
powerpc/apple/darwin7.4.0 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
powerpc/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 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
sparc/sun/solaris2.7 gcc 3.3 CVSHEAD 04-02-24 alex Y Y Y Y
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
Notes
@@ -56,4 +60,4 @@ Notes
--
$Id: Platforms.txt,v 1.11 2004/04/05 11:11:05 alex Exp $
$Id: Platforms.txt,v 1.11.2.1 2004/11/09 10:58:01 alex Exp $

58
doc/SSL.txt Normal file
View File

@@ -0,0 +1,58 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 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.
-- SSL.txt --
ngIRCd actually doesn't support secure connections for client-server or
server-server links using SSL, the Secure Socket Layer, by itself. But you can
use the stunnel(8) command to make this work.
<http://stunnel.mirt.net/>
<http://www.stunnel.org/>
Stefan Sperling (stefan at binarchy dot net) mailed me the following text as a
short "how-to", thanks Stefan!
=== snip ===
! This guide applies to stunnel 4.x !
Put this in your stunnel.conf:
[ircs]
accept = 6667
connect = 6668
This makes stunnel listen for incoming connections
on port 6667 and forward decrypted data to port 6668.
We call the connection 'ircs'. Stunnel will use this
name when logging connection attempts via syslog.
You can also use the name in /etc/hosts.{allow,deny}
if you run tcp-wrappers.
To make sure ngircd is listening on the port where
the decrypted data arrives, set
Ports = 6668
in your ngircd.conf.
Start stunnel and restart ngircd.
That's it.
Don't forget to activate ssl support in your irc client ;)
=== snip ===
Probably ngIRCd will include support for SSL in the future ...
--
$Id: SSL.txt,v 1.2.2.1 2005/01/26 21:47:47 alex Exp $

View File

@@ -1,4 +1,4 @@
# $Id: sample-ngircd.conf,v 1.26 2004/05/07 11:19:20 alex Exp $
# $Id: sample-ngircd.conf,v 1.25.2.1 2004/05/07 11:24:17 alex Exp $
#
# This is a sample configuration file for the ngIRCd, which must be adepted

View File

@@ -1,5 +1,5 @@
.\"
.\" $Id: ngircd.conf.5,v 1.13 2004/05/07 11:19:20 alex Exp $
.\" $Id: ngircd.conf.5,v 1.12.2.1 2004/05/07 11:24:18 alex Exp $
.\"
.TH ngircd.conf 5 "Mai 2003" ngircd "ngIRCd Manual"
.SH NAME

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: conf.c,v 1.64 2004/05/07 11:19:21 alex Exp $";
static char UNUSED id[] = "$Id: conf.c,v 1.63.2.2 2004/09/27 11:30:52 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -107,8 +107,8 @@ Conf_Test( VOID )
else puts( "Ok, dump of your server configuration follows:\n" );
puts( "[GLOBAL]" );
printf( " ServerName = %s\n", Conf_ServerName );
printf( " ServerInfo = %s\n", Conf_ServerInfo );
printf( " Name = %s\n", Conf_ServerName );
printf( " Info = %s\n", Conf_ServerInfo );
printf( " Password = %s\n", Conf_ServerPwd );
printf( " AdminInfo1 = %s\n", Conf_ServerAdmin1 );
printf( " AdminInfo2 = %s\n", Conf_ServerAdmin2 );

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: conf.h,v 1.29 2004/05/07 11:19:21 alex Exp $
* $Id: conf.h,v 1.28.2.1 2004/05/07 11:24:18 alex Exp $
*
* Configuration management (header)
*/

View File

@@ -16,7 +16,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: conn.c,v 1.134 2004/04/25 14:06:12 alex Exp $";
static char UNUSED id[] = "$Id: conn.c,v 1.134.2.4 2005/01/19 23:35:42 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -525,7 +525,7 @@ va_dcl
#else
va_start( ap );
#endif
if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) == COMMAND_LEN - 2 )
if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) >= COMMAND_LEN - 2 )
{
Log( LOG_CRIT, "Text too long to send (connection %d)!", Idx );
Conn_Close( Idx, "Text too long to send!", NULL, FALSE );
@@ -628,6 +628,9 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
{
/* Conn_Close() has been called recursively for this link;
* probabe reason: Try_Write() failed -- see below. */
#ifdef DEBUG
Log( LOG_DEBUG, "Recursive request to close connection: %d", Idx );
#endif
return;
}
@@ -723,6 +726,10 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
/* Clean up connection structure (=free it) */
Init_Conn_Struct( Idx );
#ifdef DEBUG
Log( LOG_DEBUG, "Shutdown of connection %d completed.", Idx );
#endif
} /* Conn_Close */
@@ -1272,22 +1279,20 @@ Handle_Buffer( CONN_ID Idx )
/* Mit dem letzten Befehl wurde Socket-Kompression aktiviert.
* Evtl. schon vom Socket gelesene Daten in den Unzip-Puffer
* umkopieren, damit diese nun zunaechst entkomprimiert werden */
if( My_Connections[Idx].rdatalen > ZREADBUFFER_LEN )
{
if( My_Connections[Idx].rdatalen > ZREADBUFFER_LEN )
{
/* Hupsa! Soviel Platz haben wir aber gar nicht! */
Log( LOG_ALERT, "Can't move read buffer: No space left in unzip buffer (need %d bytes)!", My_Connections[Idx].rdatalen );
return FALSE;
}
memcpy( My_Connections[Idx].zip.rbuf, My_Connections[Idx].rbuf, My_Connections[Idx].rdatalen );
My_Connections[Idx].zip.rdatalen = My_Connections[Idx].rdatalen;
My_Connections[Idx].rdatalen = 0;
#ifdef DEBUG
Log( LOG_DEBUG, "Moved already received data (%d bytes) to uncompression buffer.", My_Connections[Idx].zip.rdatalen );
#endif
/* Hupsa! Soviel Platz haben wir aber gar nicht! */
Log( LOG_ALERT, "Can't move read buffer: No space left in unzip buffer (need %d bytes)!", My_Connections[Idx].rdatalen );
return FALSE;
}
memcpy( My_Connections[Idx].zip.rbuf, My_Connections[Idx].rbuf, My_Connections[Idx].rdatalen );
My_Connections[Idx].zip.rdatalen = My_Connections[Idx].rdatalen;
My_Connections[Idx].rdatalen = 0;
#ifdef DEBUG
Log( LOG_DEBUG, "Moved already received data (%d bytes) to uncompression buffer.", My_Connections[Idx].zip.rdatalen );
#endif /* DEBUG */
}
#endif
#endif /* ZLIB */
}
if( action ) result = TRUE;
@@ -1600,35 +1605,28 @@ Init_Socket( INT Sock )
LOCAL VOID
Read_Resolver_Result( INT r_fd )
{
/* Ergebnis von Resolver Sub-Prozess aus Pipe lesen
* und entsprechende Connection aktualisieren */
/* Read result of resolver sub-process from pipe and update the
* apropriate connection/client structure(s): hostname and/or
* IDENT user name.*/
CHAR result[HOST_LEN];
CLIENT *c;
INT len, i, n;
FD_CLR( r_fd, &Resolver_FDs );
/* Read result from pipe */
len = read( r_fd, result, HOST_LEN - 1 );
if( len < 0 )
{
/* Error! */
close( r_fd );
Log( LOG_CRIT, "Resolver: Can't read result: %s!", strerror( errno ));
return;
}
result[len] = '\0';
RES_STAT *s;
CHAR *ptr;
/* Search associated connection ... */
for( i = 0; i < Pool_Size; i++ )
{
if(( My_Connections[i].sock != NONE ) && ( My_Connections[i].res_stat ) && ( My_Connections[i].res_stat->pipe[0] == r_fd )) break;
if(( My_Connections[i].sock != NONE )
&& ( My_Connections[i].res_stat != NULL )
&& ( My_Connections[i].res_stat->pipe[0] == r_fd ))
break;
}
if( i >= Pool_Size )
{
/* Ops, none found? Probably the connection has already
* been closed. */
* been closed!? We'll ignore that ... */
FD_CLR( r_fd, &Resolver_FDs );
close( r_fd );
#ifdef DEBUG
Log( LOG_DEBUG, "Resolver: Got result for unknown connection!?" );
@@ -1636,61 +1634,102 @@ Read_Resolver_Result( INT r_fd )
return;
}
/* Get resolver structure */
s = My_Connections[i].res_stat;
assert( s != NULL );
/* Read result from pipe */
len = read( r_fd, s->buffer + s->bufpos, sizeof( s->buffer ) - s->bufpos - 1 );
if( len < 0 )
{
/* Error! */
close( r_fd );
Log( LOG_CRIT, "Resolver: Can't read result: %s!", strerror( errno ));
return;
}
s->bufpos += len;
s->buffer[s->bufpos] = '\0';
/* If the result string is incomplete, return to main loop and
* wait until we can read in more bytes. */
#ifdef IDENTAUTH
try_resolve:
#endif
ptr = strchr( s->buffer, '\n' );
if( ! ptr ) return;
*ptr = '\0';
#ifdef DEBUG
Log( LOG_DEBUG, "Resolver: %s is \"%s\".", My_Connections[i].host, result );
Log( LOG_DEBUG, "Got result from resolver: \"%s\" (%d bytes), stage %d.", s->buffer, len, s->stage );
#endif
/* Clean up ... */
close( My_Connections[i].res_stat->pipe[0] );
close( My_Connections[i].res_stat->pipe[1] );
free( My_Connections[i].res_stat );
My_Connections[i].res_stat = NULL;
/* Okay, we got a complete result: this is a host name for outgoing
* connections and a host name or IDENT user name (if enabled) for
* incoming conneciions.*/
if( My_Connections[i].sock > NONE )
{
/* Incoming connection */
#ifdef IDENTAUTH
CHAR *ident;
#endif
/* Search client ... */
c = Client_GetFromConn( i );
assert( c != NULL );
/* Only update client information of unregistered clients */
if( Client_Type( c ) != CLIENT_UNKNOWN )
if( Client_Type( c ) == CLIENT_UNKNOWN )
{
#ifdef DEBUG
Log( LOG_DEBUG, "Resolver: discarding result for already registered connection %d.", i );
#endif
return;
}
/* Set hostname */
strlcpy( My_Connections[i].host, result, sizeof( My_Connections[i].host ));
Client_SetHostname( c, result );
if( s->stage == 0 )
{
/* host name */
strlcpy( My_Connections[i].host, s->buffer, sizeof( My_Connections[i].host ));
Client_SetHostname( c, s->buffer );
#ifdef IDENTAUTH
ident = strchr( result, 0 );
ident++;
/* clean up buffer for IDENT result */
len = strlen( s->buffer ) + 1;
memmove( s->buffer, s->buffer + len, sizeof( s->buffer ) - len );
s->bufpos -= len;
/* Do we have a result of the IDENT lookup? If so, set it as the user name */
if( *ident )
{
Log( LOG_INFO, "IDENT lookup for connection %ld: \"%s\".", i, ident );
Client_SetUser( c, ident, TRUE );
/* Don't close pipe and clean up, but
* instead wait for IDENT result */
s->stage = 1;
goto try_resolve;
}
else if( s->stage == 1 )
{
/* IDENT user name */
if( s->buffer[0] )
{
Log( LOG_INFO, "IDENT lookup for connection %ld: \"%s\".", i, s->buffer );
Client_SetUser( c, s->buffer, TRUE );
}
else Log( LOG_INFO, "IDENT lookup for connection %ld: no result.", i );
#endif
}
else Log( LOG_ERR, "Resolver: got result for unknown stage %d!?", s->stage );
}
else Log( LOG_INFO, "IDENT lookup for connection %ld: no result.", i );
#ifdef DEBUG
else Log( LOG_DEBUG, "Resolver: discarding result for already registered connection %d.", i );
#endif
}
else
{
/* Outgoing connection (server link!): set IP address */
/* Outgoing connection (server link): set the IP address
* so that we can connect to it in the main loop. */
/* Search server ... */
n = Conf_GetServer( i );
assert( n > NONE );
strlcpy( Conf_Server[n].ip, result, sizeof( Conf_Server[n].ip ));
strlcpy( Conf_Server[n].ip, s->buffer, sizeof( Conf_Server[n].ip ));
}
/* Clean up ... */
FD_CLR( r_fd, &Resolver_FDs );
close( My_Connections[i].res_stat->pipe[0] );
close( My_Connections[i].res_stat->pipe[1] );
free( My_Connections[i].res_stat );
My_Connections[i].res_stat = NULL;
/* Reset penalty time */
Conn_ResetPenalty( i );
} /* Read_Resolver_Result */

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: defines.h,v 1.46 2004/05/07 11:19:21 alex Exp $
* $Id: defines.h,v 1.45.2.1 2004/05/07 11:24:18 alex Exp $
*
* Global defines of ngIRCd.
*/

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.22 2004/05/07 11:19:21 alex Exp $";
static char UNUSED id[] = "$Id: irc-info.c,v 1.21.2.2 2005/01/24 14:22:30 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -770,6 +770,7 @@ IRC_Show_MOTD( CLIENT *Client )
BOOLEAN ok;
CHAR line[127];
FILE *fd;
UINT line_len;
assert( Client != NULL );
@@ -790,8 +791,12 @@ IRC_Show_MOTD( CLIENT *Client )
if( ! IRC_WriteStrClient( Client, RPL_MOTDSTART_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )))) return DISCONNECTED;
while( TRUE )
{
if( ! fgets( line, 126, fd )) break;
if( line[strlen( line ) - 1] == '\n' ) line[strlen( line ) - 1] = '\0';
if( ! fgets( line, sizeof( line ), fd )) break;
line_len = strlen( line );
if( line_len > 0 ) line_len--;
if( line[line_len] == '\n' ) line[line_len] = '\0';
if( ! IRC_WriteStrClient( Client, RPL_MOTD_MSG, Client_ID( Client ), line ))
{
fclose( fd );

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-server.c,v 1.36 2004/04/25 15:43:18 alex Exp $";
static char UNUSED id[] = "$Id: irc-server.c,v 1.36.2.1 2004/05/15 23:52:17 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -23,6 +23,7 @@ static char UNUSED id[] = "$Id: irc-server.c,v 1.36 2004/04/25 15:43:18 alex Exp
#include <string.h>
#include <strings.h>
#include "defines.h"
#include "resolve.h"
#include "conn.h"
#include "conn-zip.h"

View File

@@ -1,6 +1,6 @@
/*
* 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
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: lists.c,v 1.15 2004/04/25 15:40:19 alex Exp $";
static char UNUSED id[] = "$Id: lists.c,v 1.15.2.1 2005/01/26 13:27:01 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -360,9 +360,10 @@ Lists_DeleteChannel( CHANNEL *Chan )
GLOBAL CHAR *
Lists_MakeMask( CHAR *Pattern )
{
/* Hier wird aus einem "beliebigen" Pattern eine gueltige IRC-Mask erzeugt.
* Diese ist aber nur bis zum naechsten Aufruf von Lists_MakeMask() gueltig,
* da ein einziger globaler Puffer verwendet wird. ->Umkopieren!*/
/* This function generats a valid IRC mask of "any" string. This
* mask is only valid until the next call to Lists_MakeMask(),
* because a single global buffer is used. You have to copy the
* generated mask to some sane location yourself! */
STATIC CHAR TheMask[MASK_LEN];
CHAR *excl, *at;
@@ -376,7 +377,7 @@ Lists_MakeMask( CHAR *Pattern )
if(( ! at ) && ( ! excl ))
{
/* weder ! noch @ vorhanden: als Nick annehmen */
/* Neither "!" nor "@" found: use string as nick name */
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 );
strlcat( TheMask, "!*@*", sizeof( TheMask ));
return TheMask;
@@ -384,7 +385,7 @@ Lists_MakeMask( CHAR *Pattern )
if(( ! at ) && ( excl ))
{
/* Domain fehlt */
/* Domain part is missing */
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 3 );
strlcat( TheMask, "@*", sizeof( TheMask ));
return TheMask;
@@ -392,15 +393,15 @@ Lists_MakeMask( CHAR *Pattern )
if(( at ) && ( ! excl ))
{
/* User fehlt */
/* User name is missing */
*at = '\0'; at++;
strlcpy( TheMask, Pattern, sizeof( TheMask ) - strlen( at ) - 4 );
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 );
strlcat( TheMask, "!*@", sizeof( TheMask ));
strlcat( TheMask, at, sizeof( TheMask ));
return TheMask;
}
/* alle Teile vorhanden */
/* All parts (nick, user and domain name) are given */
strlcpy( TheMask, Pattern, sizeof( TheMask ));
return TheMask;
} /* Lists_MakeMask */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: log.c,v 1.45 2004/05/07 11:19:21 alex Exp $";
static char UNUSED id[] = "$Id: log.c,v 1.44.2.4 2005/02/03 09:27:09 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -182,7 +182,7 @@ va_dcl
if( NGIRCd_NoDaemon )
{
/* auf Konsole ausgeben */
fprintf( stdout, "[%d] %s\n", Level, msg );
fprintf( stdout, "[%d:%d] %s\n", (INT)getpid( ), Level, msg );
fflush( stdout );
}
#ifdef SYSLOG
@@ -214,12 +214,14 @@ Log_Init_Resolver( VOID )
#ifdef SYSLOG
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
#endif
Log_Resolver( LOG_DEBUG, "Resolver sub-process starting, PID %d.", getpid( ));
} /* Log_Init_Resolver */
GLOBAL VOID
Log_Exit_Resolver( VOID )
{
Log_Resolver( LOG_DEBUG, "Resolver sub-process %d done.", getpid( ));
#ifdef SYSLOG
closelog( );
#endif
@@ -239,17 +241,11 @@ va_dcl
{
/* Eintrag des Resolver in Logfile(s) schreiben */
#ifndef SYSLOG
return;
#else
CHAR msg[MAX_LOG_MSG_LEN];
va_list ap;
assert( Format != NULL );
if( NGIRCd_NoDaemon ) return;
#ifdef DEBUG
if(( Level == LOG_DEBUG ) && ( ! NGIRCd_Debug )) return;
#else
@@ -265,9 +261,15 @@ va_dcl
vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
va_end( ap );
/* ... und ausgeben */
syslog( Level, msg );
/* Output */
if( NGIRCd_NoDaemon )
{
/* Output to console */
fprintf( stdout, "[%d:%d] %s\n", (INT)getpid( ), Level, msg );
fflush( stdout );
}
#ifdef SYSLOG
else syslog( Level, "%s", msg );
#endif
} /* Log_Resolver */

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2004 by Alexander Barton (alex@barton.de)
* Copyright (c)2001-2005 by 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
@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: ngircd.c,v 1.84 2004/05/07 11:19:21 alex Exp $";
static char UNUSED id[] = "$Id: ngircd.c,v 1.83.2.3 2005/01/26 22:02:36 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -31,13 +31,13 @@ static char UNUSED id[] = "$Id: ngircd.c,v 1.84 2004/05/07 11:19:21 alex Exp $";
#include <pwd.h>
#include <grp.h>
#include "defines.h"
#include "resolve.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "conf.h"
#include "cvs-version.h"
#include "defines.h"
#include "lists.h"
#include "log.h"
#include "parse.h"
@@ -545,7 +545,7 @@ LOCAL VOID
Show_Version( VOID )
{
puts( NGIRCd_Version( ));
puts( "Copyright (c)2001-2004 by Alexander Barton (<alex@barton.de>)." );
puts( "Copyright (c)2001-2005 by Alexander Barton (<alex@barton.de>)." );
puts( "Homepage: <http://arthur.ath.cx/~alex/ngircd/>\n" );
puts( "This is free software; see the source for copying conditions. There is NO" );
puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: resolve.c,v 1.8 2004/03/11 22:16:31 alex Exp $";
static char UNUSED id[] = "$Id: resolve.c,v 1.8.2.1 2004/05/15 23:52:17 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -102,6 +102,8 @@ Resolve_Addr( struct sockaddr_in *Addr )
FD_SET( s->pipe[0], &Resolver_FDs );
if( s->pipe[0] > Conn_MaxFD ) Conn_MaxFD = s->pipe[0];
s->pid = pid;
s->stage = 0;
s->bufpos = 0;
return s;
}
else if( pid == 0 )
@@ -160,6 +162,8 @@ Resolve_Name( CHAR *Host )
FD_SET( s->pipe[0], &Resolver_FDs );
if( s->pipe[0] > Conn_MaxFD ) Conn_MaxFD = s->pipe[0];
s->pid = pid;
s->stage = 0;
s->bufpos = 0;
return s;
}
else if( pid == 0 )
@@ -193,13 +197,13 @@ Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd )
CHAR hostname[HOST_LEN];
struct hostent *h;
INT len;
#ifdef IDENTAUTH
CHAR *res;
#endif
Log_Resolver( LOG_DEBUG, "Now resolving %s ...", inet_ntoa( Addr->sin_addr ));
/* Resolve IP address */
Log_Resolver( LOG_DEBUG, "Now resolving %s ...", inet_ntoa( Addr->sin_addr ));
h = gethostbyaddr( (CHAR *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET );
if( h ) strlcpy( hostname, h->h_name, sizeof( hostname ));
else
@@ -211,33 +215,35 @@ Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd )
#endif
strlcpy( hostname, inet_ntoa( Addr->sin_addr ), sizeof( hostname ));
}
Log_Resolver( LOG_DEBUG, "Ok, translated %s to \"%s\".", inet_ntoa( Addr->sin_addr ), hostname );
#ifdef IDENTAUTH
/* Do "IDENT" (aka "AUTH") lookup and write result to parent */
Log_Resolver( LOG_DEBUG, "Doing IDENT lookup on socket %d ...", Sock );
res = ident_id( Sock, 10 );
Log_Resolver( LOG_DEBUG, "IDENT lookup on socket %d done.", Sock );
#endif
/* Write result into pipe to parent */
if( (size_t)write( w_fd, hostname, strlen( hostname ) + 1 ) != (size_t)( strlen( hostname ) + 1 ))
/* Write resolver result into pipe to parent */
len = strlen( hostname );
hostname[len] = '\n'; len++;
if( (size_t)write( w_fd, hostname, len ) != (size_t)len )
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
close( w_fd );
return;
}
#ifdef IDENTAUTH
if( (size_t)write( w_fd, res ? res : "", strlen( res ? res : "" ) + 1 ) != (size_t)( strlen( res ? res : "" ) + 1 ))
/* Do "IDENT" (aka "AUTH") lookup and write result to parent */
Log_Resolver( LOG_DEBUG, "Doing IDENT lookup on socket %d ...", Sock );
res = ident_id( Sock, 10 );
Log_Resolver( LOG_DEBUG, "Ok, IDENT lookup on socket %d done: \"%s\"", Sock, res ? res : "" );
/* Write IDENT result into pipe to parent */
len = strlen( res ? res : "" );
if( res != NULL ) res[len] = '\n';
len++;
if( (size_t)write( w_fd, res ? res : "\n", len ) != (size_t)len )
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent (IDENT): %s!", strerror( errno ));
close( w_fd );
free( res );
return;
}
free( res );
#endif
Log_Resolver( LOG_DEBUG, "Ok, translated %s to \"%s\".", inet_ntoa( Addr->sin_addr ), hostname );
} /* Do_ResolveAddr */
@@ -250,6 +256,7 @@ Do_ResolveName( CHAR *Host, INT w_fd )
CHAR ip[16];
struct hostent *h;
struct in_addr *addr;
INT len;
Log_Resolver( LOG_DEBUG, "Now resolving \"%s\" ...", Host );
@@ -269,16 +276,16 @@ Do_ResolveName( CHAR *Host, INT w_fd )
#endif
strcpy( ip, "" );
}
if( ip[0] ) Log_Resolver( LOG_DEBUG, "Ok, translated \"%s\" to %s.", Host, ip );
/* Write result into pipe to parent */
if( (size_t)write( w_fd, ip, strlen( ip ) + 1 ) != (size_t)( strlen( ip ) + 1 ))
len = strlen( ip );
ip[len] = '\n'; len++;
if( (size_t)write( w_fd, ip, len ) != (size_t)len )
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
close( w_fd );
return;
}
if( ip[0] ) Log_Resolver( LOG_DEBUG, "Ok, translated \"%s\" to %s.", Host, ip );
} /* Do_ResolveName */

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: resolve.h,v 1.6 2003/12/27 13:01:12 alex Exp $
* $Id: resolve.h,v 1.6.2.1 2004/05/15 23:52:17 alex Exp $
*
* Asynchronous resolver (header)
*/
@@ -29,6 +29,9 @@ typedef struct _Res_Stat
{
INT pid; /* PID des Child-Prozess */
INT pipe[2]; /* Pipe fuer IPC */
INT stage; /* Hostname/IP(0) or IDENT(1)? */
INT bufpos; /* Position in buffer */
CHAR buffer[HOST_LEN]; /* Buffer */
} RES_STAT;

View File

@@ -19,7 +19,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: strlcpy.c,v 1.2 2002/12/26 14:34:11 alex Exp $";
static char UNUSED id[] = "$Id: strlcpy.c,v 1.2.4.1 2005/01/18 09:09:05 alex Exp $";
#include "imp.h"
#include <string.h>
@@ -61,12 +61,13 @@ strlcpy( CHAR *dst, CONST CHAR *src, size_t size )
* always null terminates. */
size_t len = strlen( src );
size_t ret = len;
if( size <= 0 ) return len;
if( size <= 0 ) return 0;
if( len >= size ) len = size - 1;
memcpy( dst, src, len );
dst[len] = 0;
return len;
return ret;
} /* strlcpy */
#endif

View File

@@ -9,7 +9,7 @@
# 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.9 2002/11/10 14:28:06 alex Exp $
# $Id: Makefile.am,v 1.9.6.3 2004/09/08 09:45:53 alex Exp $
#
AUTOMAKE_OPTIONS = ../portab/ansi2knr
@@ -17,12 +17,15 @@ AUTOMAKE_OPTIONS = ../portab/ansi2knr
INCLUDES = -I$(srcdir)/../portab
EXTRA_DIST = \
getpid.sh \
README functions.inc getpid.sh \
start-server.sh stop-server.sh tests.sh stress-server.sh \
test-loop.sh wait-tests.sh \
connect-test.e channel-test.e mode-test.e \
stress-A.e stress-B.e check-idle.e \
ngircd-test.conf
all:
clean-local:
rm -rf logs tests *-test ngircd-test.log ngircd-test.motd \
T-ngircd procs.tmp

72
src/testsuite/README Normal file
View File

@@ -0,0 +1,72 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 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.
-- README for the Test Suite --
I. Overview
~~~~~~~~~~~
The purpose of the "test suite" contained in this directory is to detect
bugs and incompatibilities in ngIRCd introduced during coding and after
building ngIRCd on a specific platform.
To run the "standard" tests call "make check". It will build ngIRCd (if
required) and run some tests on it. These tests should be portable and run
on all supported platforms without errors.
Please note: most tests of this suite depend on the external tools expect(1)
and telnet(1), so make sure you have them installed. If not, the tests will
not fail but simply be skipped.
II. Shell Scripts
~~~~~~~~~~~~~~~~
getpid.sh <name>
This script is used to detect the PID of the running process with
the given name in a portable manner. The result is echoed on the
console. It is a helper script for some other scripts of this suite.
start-server.sh
start-server.sh starts up the test binary, "T-ngircd". It makes sure
that getpid.sh is available and working, and that no other instance
of the test binary is already running.
The exit code is 0 if the test binary could be started.
stop-server.sh
This script uses getpid.sh to detect a running test binary "T-ngircd"
and then shuts it down using the TERM signal.
The exit code is 0 if the test binary could be stopped.
stress-server.sh
...
tests.sh
...
III. Scripts for expect(1)
~~~~~~~~~~~~~~~~~~~~~~~~~~
channel-test.e
check-idle.e
connect-test.e
mode-test.e
stress-A.e
stress-B.e
--
$Id: README,v 1.1.2.1 2004/09/04 20:49:36 alex Exp $

View File

@@ -1,4 +1,4 @@
# $Id: check-idle.e,v 1.1 2002/09/09 22:56:07 alex Exp $
# $Id: check-idle.e,v 1.1.8.1 2004/09/04 20:49:36 alex Exp $
spawn telnet localhost 6789
expect {
@@ -10,6 +10,7 @@ send "nick IdleTest\r"
send "user idle . . :Idle-Test\r"
expect {
timeout { exit 1 }
"433 * IdleTest :Nickname already in use" { exit 99 }
"376"
}

View File

@@ -0,0 +1,28 @@
#!/bin/sh
#
# ngIRCd Test Suite
# Copyright (c)2002-2004 by 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: functions.inc,v 1.1.2.1 2004/09/06 22:07:26 alex Exp $
#
# test how to call echo to get output without newline
echo -n | grep -- -n >/dev/null 2>&1
if [ $? -eq 0 ]; then
ECHO_N=""; ECHO_C="\c"
else
ECHO_N="-n"; ECHO_C=""
fi
echo_n()
{
echo $ECHO_N "$*$ECHO_C"
}
# -eof-

View File

@@ -1,10 +1,13 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: start-server.sh,v 1.11 2003/08/22 11:31:18 alex Exp $
# $Id: start-server.sh,v 1.11.2.2 2004/09/06 22:07:26 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
echo " starting server ..."
# read in functions
. ${srcdir}/functions.inc
echo_n " starting server ..."
# remove old logfiles
rm -rf logs *.log
@@ -13,14 +16,14 @@ rm -rf logs *.log
# test-server, because we won't be able to kill it at the end of the test.
./getpid.sh sh > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " error: getpid.sh FAILED!"
echo " getpid.sh failed!"
exit 1
fi
# check if there is a test-server already running
./getpid.sh T-ngircd > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo " error: test-server already running!"
echo " failure: test-server already running!"
exit 1
fi
@@ -28,11 +31,14 @@ fi
echo "This is an ngIRCd Test Server" > ngircd-test.motd
# starting up test-server ...
./T-ngircd -np -f ${srcdir}/ngircd-test.conf > ngircd-test.log 2>&1 &
./T-ngircd -np -f ${srcdir}/ngircd-test.conf $* > ngircd-test.log 2>&1 &
sleep 1
# validate running test-server
pid=`./getpid.sh T-ngircd`
[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1
[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1; r=$?
[ $r -eq 0 ] && echo " ok." || echo " failure!"
exit
# -eof-

View File

@@ -1,25 +1,32 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: stop-server.sh,v 1.10 2003/08/22 11:31:18 alex Exp $
# $Id: stop-server.sh,v 1.10.2.3 2004/09/06 22:07:26 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
echo " stopping server ..."
# read in functions
. ${srcdir}/functions.inc
echo_n " stopping server ..."
# stop test-server ...
pid=`./getpid.sh T-ngircd`
if [ -z "$pid" ]; then
echo " no running server found!?"
echo " failure: no running server found!?"
exit 1
fi
kill $pid > /dev/null 2>&1 || exit 1
# waiting ...
for i in 1 2 3 4 5; do
kill -0 $pid > /dev/null 2>&1 || exit 0
kill -0 $pid > /dev/null 2>&1; r=$?
if [ $r -ne 0 ]; then
echo " ok".
exit 0
fi
sleep 1
done
echo " server still running!?"
echo " failure: server still running!?"
exit 1
# -eof-

View File

@@ -1,15 +1,31 @@
#!/bin/sh
#
# ngIRCd Test Suite
# $Id: stress-server.sh,v 1.8 2003/08/22 11:31:18 alex Exp $
# Copyright (c)2002-2004 by 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: stress-server.sh,v 1.8.2.2 2004/09/06 22:07:26 alex Exp $
#
# detect source directory
[ -z "$srcdir" ] && srcdir=`dirname $0`
# parse command line
[ "$1" -gt 0 ] 2> /dev/null && CLIENTS="$1" || CLIENTS=5
[ "$2" -gt 0 ] 2> /dev/null && MAX="$2" || MAX=-1
# get our name
name=`basename $0`
test=`echo ${name} | cut -d '.' -f 1`
# create directories
mkdir -p logs tests
# test for required external tools
type expect > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " ${name}: \"expect\" not found."; exit 77
@@ -19,7 +35,13 @@ if [ $? -ne 0 ]; then
echo " ${name}: \"telnet\" not found."; exit 77
fi
echo " stressing server with $CLIENTS clients (be patient!) ..."
# hello world! :-)
echo " stressing server with $CLIENTS clients (be patient!):"
# read in functions
. ${srcdir}/functions.inc
# create scripts for expect(1)
no=0
while [ ${no} -lt $CLIENTS ]; do
cat ${srcdir}/stress-A.e > tests/${no}.e
@@ -27,20 +49,31 @@ while [ ${no} -lt $CLIENTS ]; do
cat ${srcdir}/stress-B.e >> tests/${no}.e
no=`expr ${no} + 1`
done
no=0
while [ ${no} -lt $CLIENTS ]; do
expect tests/${no}.e > logs/stress-${no}.log 2> /dev/null &
no=`expr ${no} + 1`
echo " started client $no/$CLIENTS."
[ $MAX -gt 0 ] && $srcdir/wait-tests.sh $MAX
done
echo_n " waiting for clients to complete: ."
touch logs/check-idle.log
while true; do
expect ${srcdir}/check-idle.e >> logs/check-idle.log
res=$?
[ $res -eq 0 ] && exit 0
[ $res -eq 1 ] && exit 1
sleep 1
expect ${srcdir}/check-idle.e >> logs/check-idle.log; res=$?
echo "====================" >> logs/check-idle.log
[ $res -ne 99 ] && break
# there are still clients connected. Wait ...
sleep 3
echo_n "."
done
[ $res -eq 0 ] && echo " ok." || echo " failure!"
exit $res
# -eof-

37
src/testsuite/test-loop.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/sh
#
# ngIRCd Test Suite
# Copyright (c)2002-2004 by 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: test-loop.sh,v 1.2.2.1 2004/09/04 20:49:36 alex Exp $
#
# detect source directory
[ -z "$srcdir" ] && srcdir=`dirname $0`
# parse command line
[ "$1" -gt 0 ] 2> /dev/null && LOOPS="$1" || LOOPS=5
[ "$2" -gt 0 ] 2> /dev/null && WAIT="$2" || WAIT=5
loop=0
while [ ${loop} -lt $LOOPS ]; do
loop=`expr ${loop} + 1`
echo " loop $loop/$LOOPS starting:"
for s in $srcdir/*-test; do
sh $s; r=$?
[ $r -ne 0 ] && exit $r
sleep 1
done
if [ ${loop} -lt $LOOPS ]; then
echo " waiting $WAIT seconds ..."
sleep $WAIT
fi
done
# -eof-

View File

@@ -1,11 +1,22 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: tests.sh,v 1.4 2003/08/22 11:31:18 alex Exp $
# $Id: tests.sh,v 1.4.2.2 2004/09/06 22:07:26 alex Exp $
# detect source directory
[ -z "$srcdir" ] && srcdir=`dirname $0`
name=`basename $0`
test=`echo ${name} | cut -d '.' -f 1`
mkdir -p logs
if [ ! -r "$test" ]; then
echo " ${name}: test \"$test\" not found!"; exit 77
exit 1
fi
# read in functions
. ${srcdir}/functions.inc
type expect > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " ${name}: \"expect\" not found."; exit 77
@@ -15,7 +26,10 @@ if [ $? -ne 0 ]; then
echo " ${name}: \"telnet\" not found."; exit 77
fi
echo " doing ${test} ..."
expect ${srcdir}/${test}.e > logs/${test}.log
echo_n " running ${test} ..."
expect ${srcdir}/${test}.e > logs/${test}.log 2>&1; r=$?
[ $r -eq 0 ] && echo " ok." || echo " failure!"
exit $r
# -eof-

44
src/testsuite/wait-tests.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/sh
#
# ngIRCd Test Suite
# Copyright (c)2002-2004 by 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: wait-tests.sh,v 1.3.2.2 2004/09/06 22:07:26 alex Exp $
#
[ "$1" -gt 0 ] 2> /dev/null && MAX="$1" || MAX=5
PS_FLAGS="-f"
ps $PS_FLAGS >/dev/null 2>&1
[ $? -ne 0 ] && PS_FLAGS="a"
# read in functions
. ${srcdir}/functions.inc
msg=0
while true; do
count=`ps $PS_FLAGS | grep "expect " | wc -l`
count=`expr $count - 1`
[ $count -le $MAX ] && break
if [ $msg -lt 1 ]; then
echo_n " waiting for processes to settle: "
msg=1
fi
# there are still clients connected. Wait ...
echo_n "$count>$MAX "
sleep 1
done
[ $msg -gt 0 ] && echo "done: $count"
exit 0
# -eof-