1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-20 19:24:04 +00:00

Compare commits

...

65 Commits

Author SHA1 Message Date
Alexander Barton
807da1356c Version 0.7.7 2004-02-05 13:33:24 +00:00
Alexander Barton
024c58435e The info text ("real name") of users is set to "-" if none has been specified
using the USER command (e. g. "USER user * * :"). Reason: the original ircd
doesn't like empty ones and would KILL such users.  (from HEAD)
2004-02-04 20:04:54 +00:00
Alexander Barton
e72b817ae6 Updated some copyright notices -- welcome 2004! ;-) 2004-02-03 16:01:29 +00:00
Alexander Barton
47d1cf9b55 Fixed (optional) TCP Wrapper test which was broken and could result in
false results. Thanks to Fuminori Tanizaki <tany@mcnet.ad.jp>!
2004-02-03 13:54:36 +00:00
Alexander Barton
aaaca987cd Adjusted copyright notice to include 2004. 2004-01-02 19:24:46 +00:00
Alexander Barton
a34d8ae59f Removed "USE_" prefixes of configuration #defines (from HEAD). 2003-12-26 16:16:48 +00:00
Alexander Barton
d917f06af8 Fixed error messages related to server name configuration; updated
sample configuration file.
2003-12-19 14:30:49 +00:00
Alexander Barton
715e5532a9 Changed version number back to "0.7-CVS" for this branch. 2003-12-19 14:01:14 +00:00
Alexander Barton
64a8f8a3fd Updated documentation. (from HEAD) 2003-12-08 14:24:13 +00:00
Alexander Barton
7c2d0f20ed Version 0.7.6 2003-12-05 13:40:24 +00:00
Alexander Barton
e75f23cfe8 Fixed abort() ("server crash") when INVITE'ing users to nonexistent
channels. Bug found by <hiddenx@wp.pl>. (from HEAD)
2003-12-05 13:33:12 +00:00
Alexander Barton
c31167572b Added missing file ngircd.postinst to distribution list. 2003-12-05 13:31:22 +00:00
Alexander Barton
dc49d040c2 Changed version number back to "0.7-CVS" for this branch. 2003-12-04 14:20:08 +00:00
Alexander Barton
473feb44bb Extended version reporting of CVS builds. (from HEAD) 2003-12-04 14:13:42 +00:00
Alexander Barton
1ea7b10a82 Updated RPM and Debian package description and configuration. 2003-11-29 20:29:02 +00:00
Alexander Barton
29d430edd5 Release 0.7.5, debian release 0.7.6-0.1ab. 2003-11-07 21:05:15 +00:00
Alexander Barton
2b8052b03a New upstream version. 2003-11-07 21:04:21 +00:00
Alexander Barton
d155ed17c8 Backported all changes up to now from HEAD. 2003-11-07 20:51:08 +00:00
Alexander Barton
0b114e814b Version 0.7.1 2003-07-18 20:55:10 +00:00
Alexander Barton
d72811c9af Updated documentation. 2003-07-18 20:54:47 +00:00
Alexander Barton
4aa0fa7119 Fixed compiler warning. [from HEAD] 2003-07-18 20:50:05 +00:00
Alexander Barton
ad22b3087f Enhanced VERSION command when using debug builds. [from HEAD] 2003-07-18 20:49:35 +00:00
Alexander Barton
c3c4f32145 Made Makefile compatible with parallel builds (make -j). [from HEAD] 2003-07-18 20:49:05 +00:00
Alexander Barton
d72b14b9c8 Updated documentation. [from HEAD] 2003-07-18 20:48:20 +00:00
Alexander Barton
6d7de626c8 Made configure script more portable; added test for GNU Hurd. [from HEAD]. 2003-07-18 20:47:59 +00:00
Alexander Barton
73fc65a35f Updated documentation. 2003-07-18 20:47:08 +00:00
Alexander Barton
01929c161d Fixed up post installation script. 2003-07-12 22:57:00 +00:00
Alexander Barton
b0ea5b7d04 Added interpreter ... 2003-07-12 18:48:17 +00:00
Alexander Barton
f0653cdf24 Added Debian post installation script. 2003-07-12 18:29:19 +00:00
Alexander Barton
0b95570a80 Added /etc/default/ngircd to Debian package. 2003-07-12 18:23:24 +00:00
Alexander Barton
ef907632b8 Updated documentation. 2003-07-09 21:19:40 +00:00
Alexander Barton
810127e2a8 Fixed minor typo. 2003-07-09 21:14:08 +00:00
Alexander Barton
3045ce06ef Included debian packaging files from CVS HEAD. 2003-07-09 21:12:00 +00:00
Alexander Barton
3b17c66068 Added Makefile.am for debian/-subdirectory. 2003-07-09 21:08:55 +00:00
Alexander Barton
25a947f0dd Included debian/-subdirectory in build system. 2003-07-09 21:05:25 +00:00
Alexander Barton
e765124c25 Updated config.guess and config.sub. 2003-07-09 21:04:42 +00:00
Alexander Barton
8186e930aa Changed version number to "0.7-CVS" for this branch. 2003-07-09 18:57:20 +00:00
Alexander Barton
ae683b294f NJOIN propagates user channel modes correctly again. Backport from HEAD. 2003-07-09 18:53:08 +00:00
Alexander Barton
9295fce7cf Version 0.7.0 2003-05-01 10:15:02 +00:00
Alexander Barton
9dfe74ffe2 New FAQ: "why should I use ngIRCd?". [from HEAD] 2003-04-29 13:45:09 +00:00
Alexander Barton
10577f8e36 Fixed spelling, thanks Goetz! [from HEAD] 2003-04-29 13:42:24 +00:00
Alexander Barton
fbead4a15c "ServerName" is checked better now: a dot (".") is required. 2003-04-29 12:37:17 +00:00
Alexander Barton
322d3ebaec The KILL comand verifies and logs more parameters. [from HEAD] 2003-04-29 12:20:14 +00:00
Alexander Barton
bbfeaa953b Updated documentation. 2003-04-28 00:14:04 +00:00
Alexander Barton
26790e960f ngIRCd 0.7.0-pre2 2003-04-27 18:33:26 +00:00
Alexander Barton
4b1711a614 Added missing "Password" variable in "[Global]" section. 2003-04-27 11:50:32 +00:00
Alexander Barton
3630e840e5 Updated documentation. 2003-04-27 11:49:32 +00:00
Alexander Barton
bcd6db9016 Fixed --configtest: There is no variable "ServerPwd", it's "Password". 2003-04-27 11:48:53 +00:00
Alexander Barton
0e7970cfe6 Updated documentation. 2003-04-25 16:59:28 +00:00
Alexander Barton
9a9b4617aa Updated documentation. 2003-04-25 16:51:39 +00:00
Alexander Barton
434a6887f0 The server tried to connect to other servers only once when DNS or socket
failures occured. [from HEAD].
2003-04-25 16:50:53 +00:00
Alexander Barton
a9a605ddb9 Updated documentation. 2003-04-25 15:06:01 +00:00
Alexander Barton
99ab8607c9 Disabling "-ansi" on Cygwin: system headers are incompatible. 2003-04-25 15:02:15 +00:00
Alexander Barton
14b1ae7aea Updated documentation: added i686/pc/cygwin platform. 2003-04-23 23:32:24 +00:00
Alexander Barton
2517c2cb99 Updated documentation. 2003-04-23 01:15:37 +00:00
Alexander Barton
75fb85d029 Check for broken GCC (on Mac OS X) and disable "-pedantic" in this case. [HEAD] 2003-04-23 01:15:20 +00:00
Alexander Barton
1e599eb535 Updated documentation. [from HEAD] 2003-04-23 01:14:40 +00:00
Alexander Barton
36bd5d3ad6 Updated documentation. 2003-04-22 23:53:33 +00:00
Alexander Barton
0be9053c17 New documentation file "Platforms.txt". [from HEAD] 2003-04-22 23:52:48 +00:00
Alexander Barton
cd7d28d743 Made scripts more portable (run on SunOS 5.6 now). [from HEAD] 2003-04-22 20:01:23 +00:00
Alexander Barton
f04a2ce2b4 Updated documentation. 2003-04-22 20:00:32 +00:00
Alexander Barton
4d7a5df0e2 Added defines for SunOS (5.6). [from HEAD] 2003-04-22 20:00:19 +00:00
Alexander Barton
7ba1bde408 Updated documentation. 2003-04-22 10:21:33 +00:00
Alexander Barton
a7d00cd7b1 Made setting of WANT_AUTOMAKE more portable [backport from HEAD]. 2003-04-22 10:18:41 +00:00
Alexander Barton
3585e2bc50 Updated version number to 0.7.0-pre1. 2003-04-21 22:49:45 +00:00
56 changed files with 1455 additions and 546 deletions

17
AUTHORS
View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton, (c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/ alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the ngIRCd is free software and published under the
@@ -12,15 +12,22 @@
Main Authors Main Authors
~~~~~~~~~~~~ ~~~~~~~~~~~~
Alexander Barton, <alex@barton.de>, "alex" Alexander Barton, <alex@barton.de> (alex)
Contributors Contributors
~~~~~~~~~~~~ ~~~~~~~~~~~~
Goetz Hoffart, <goetz@hoffart.de> Goetz Hoffart, <goetz@hoffart.de> (goetz)
Ilja Osthoff, <i.osthoff@gmx.net> Ilja Osthoff, <i.osthoff@gmx.net> (ilja)
Sean Reifschneider, <jafo-rpms@tummy.com> Sean Reifschneider, <jafo-rpms@tummy.com>
Code snippets
~~~~~~~~~~~~~
J. Kercheval: pattern matching functions
Patrick Powell, <papowell@astart.com>: snprintf()-function
Andrew Tridgell & Martin Pool: strl{cpy|cat}()-functions
-- --
$Id: AUTHORS,v 1.5 2003/04/21 21:33:18 alex Exp $ $Id: AUTHORS,v 1.5.2.2 2004/02/03 16:01:29 alex Exp $

View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton, (c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/ alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the ngIRCd is free software and published under the
@@ -10,8 +10,68 @@
-- ChangeLog -- -- ChangeLog --
ngIRCd CVS-HEAD ngIRCd 0.7.7 (2004-02-05)
- The info text ("real name") of users is set to "-" if none has been
specified using the USER command (e. g. "USER user * * :"). Reason:
the original ircd doesn't like empty ones and would KILL such users.
- Fixed (optional) TCP Wrapper test which was broken and could result in
false results. Thanks to Fuminori Tanizaki <tany@mcnet.ad.jp>!
- Removed "USE_" prefixes of configuration #defines.
ngIRCd 0.7.6 (2003-12-05)
- Fixed abort() ("server crash") when INVITE'ing users to nonexistent
channels. Bug found by <hiddenx@wp.pl>.
- Extended version numbering of CVS versions (added date).
- Enhanced/fixed doc/Protocol.txt;
ngIRCd 0.7.5 (2003-11-07)
- Fixed ban behavior: users which are banned from a channel can't no
longer send PRIVMSG's to this channel (fixes Bug #47).
- Fixed and enhanced the "penalty handling" of the server: commands that
require more resources block the client for a short time.
- Changed the internal time resolution to one second.
- New configuration variable "MaxConnectionsIP" to limit the number of
simultaneous connections from a single IP that the server will accept.
This configuration options lowers the risk of denial of service attacks
(DoS), the default is 5 connections per client IP.
- Fixed build problems under Mac OS X 10.3.
- Use "-pipe" when compiling with gcc, speeds things up a little :-)
- Added new configuration variable "Listen" to bind all listening
sockets of the server to a single IP address.
- Suppress misleading error message of diff during make run.
- Enhanced test-suite and made it work on GNU/Hurd.
- Fixed minor typo in debug output :-)
ngIRCd 0.7.1 (2003-07-18)
- Included files to build Debian packages (located in "debian/").
- Updated config.guess and config.sub to newer upstream versions.
- NJOIN propagates user channel modes correctly again ... Upsa.
- Made Makefile more compatible with "make -j<n>".
- Added support for GNU/Hurd.
- Fixed a compiler warning related to an unnecessary assert().
- Enhanced VERSION command when using debug versions.
ngIRCd 0.7.0 (2003-05-01)
- "ServerName" is checked better now: a dot (".") is required.
- The KILL command 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 occurred.
- 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). - New signal handler (more secure, actions are executed outside).
- GCC: the compiler is now called with more warning options enabled. - 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 - Replaced a lot of str[n]cpy(), str[n]cat() and sprintf() calls with the
@@ -433,4 +493,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.24 2004/02/05 13:33:24 alex Exp $

View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton, (c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/ alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the ngIRCd is free software and published under the
@@ -93,6 +93,7 @@ This files will be installed by default:
- /usr/local/sbin/ngircd: executable server - /usr/local/sbin/ngircd: executable server
- /usr/local/etc/ngircd.conf: sample configuration (if not already present) - /usr/local/etc/ngircd.conf: sample configuration (if not already present)
- /usr/local/share/doc/ngircd/: documentation
II. Useful make-targets 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.2 2004/02/03 16:01:29 alex Exp $

View File

@@ -218,7 +218,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = Products; name = Products;
refType = 4; path = "";
refType = 2;
}; };
//1A0 //1A0
//1A1 //1A1
@@ -421,10 +422,10 @@
}; };
F51F791401DFD0DE01D13771 = { F51F791401DFD0DE01D13771 = {
children = ( children = (
FA550F3103D59CB300A85B04,
F5263AEF01E2A9B801CE8F8F, F5263AEF01E2A9B801CE8F8F,
F51F791501DFD0DE01D13771, F51F791501DFD0DE01D13771,
F5E9447D02C9EE2801A85B04, F5E9447D02C9EE2801A85B04,
FA0B193305060CB800A85B04,
F5B565290325412B01A85B04, F5B565290325412B01A85B04,
F5E9447E02C9EE2801A85B04, F5E9447E02C9EE2801A85B04,
F5E9447F02C9EE2801A85B04, F5E9447F02C9EE2801A85B04,
@@ -433,8 +434,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = doc; name = doc;
path = /Users/alex/Develop/ngircd/doc; path = ../doc;
refType = 0; refType = 2;
}; };
F51F791501DFD0DE01D13771 = { F51F791501DFD0DE01D13771 = {
fileEncoding = 5; fileEncoding = 5;
@@ -477,8 +478,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = testsuite; name = testsuite;
path = /Users/alex/Develop/ngircd/src/testsuite; path = ../src/testsuite;
refType = 0; refType = 2;
}; };
F520AEA90335E29001A85B04 = { F520AEA90335E29001A85B04 = {
fileEncoding = 5; fileEncoding = 5;
@@ -593,8 +594,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = man; name = man;
path = /Users/alex/Develop/ngircd/man; path = ../man;
refType = 0; refType = 2;
}; };
F520AF180335F1B801A85B04 = { F520AF180335F1B801A85B04 = {
fileEncoding = 5; fileEncoding = 5;
@@ -691,8 +692,9 @@
F576ABFE01D61D7401A85B03, F576ABFE01D61D7401A85B03,
); );
isa = PBXGroup; isa = PBXGroup;
path = ngircd; name = ngircd;
refType = 4; path = ../src/ngircd;
refType = 2;
}; };
F52162BB01C7B904012300F4 = { F52162BB01C7B904012300F4 = {
fileEncoding = 5; fileEncoding = 5;
@@ -1034,7 +1036,7 @@
); );
isa = PBXGroup; isa = PBXGroup;
path = ngircd.pbproj; path = ngircd.pbproj;
refType = 4; refType = 2;
}; };
F56D8BA101E0BFA00155ADA7 = { F56D8BA101E0BFA00155ADA7 = {
fileEncoding = 5; fileEncoding = 5;
@@ -1275,7 +1277,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = contrib; name = contrib;
refType = 4; path = "";
refType = 2;
}; };
F5D3536203892AD201A85B04 = { F5D3536203892AD201A85B04 = {
fileEncoding = 5; fileEncoding = 5;
@@ -1377,8 +1380,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = portab; name = portab;
path = /Users/alex/Develop/ngircd/src; path = ../src/portab;
refType = 0; refType = 2;
}; };
F5F18133023EC63701A85B04 = { F5F18133023EC63701A85B04 = {
fileEncoding = 5; fileEncoding = 5;
@@ -1443,6 +1446,13 @@
//FA2 //FA2
//FA3 //FA3
//FA4 //FA4
FA0B193305060CB800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = Platforms.txt;
path = ../doc/Platforms.txt;
refType = 2;
};
FA42C8AD03C0A00B00A85B04 = { FA42C8AD03C0A00B00A85B04 = {
fileEncoding = 4; fileEncoding = 4;
isa = PBXFileReference; isa = PBXFileReference;
@@ -1503,7 +1513,8 @@
); );
isa = PBXGroup; isa = PBXGroup;
name = tool; name = tool;
refType = 4; path = ../src;
refType = 2;
}; };
FA550F2A03D59C8200A85B04 = { FA550F2A03D59C8200A85B04 = {
fileEncoding = 5; fileEncoding = 5;
@@ -1550,93 +1561,6 @@
settings = { settings = {
}; };
}; };
FA550F3103D59CB300A85B04 = {
children = (
FA550F3503D59CD800A85B04,
FA550F3403D59CD800A85B04,
FA550F3703D59CD800A85B04,
FA550F3203D59CD800A85B04,
FA550F3303D59CD800A85B04,
FA550F3603D59CD800A85B04,
FA550F3803D59CD800A85B04,
FA550F3903D59CD800A85B04,
FA550F3A03D59CD800A85B04,
FA550F3B03D59CD800A85B04,
);
isa = PBXGroup;
name = de;
refType = 4;
};
FA550F3203D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = CVS.txt;
path = ../doc/de/CVS.txt;
refType = 2;
};
FA550F3303D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = FAQ.txt;
path = ../doc/de/FAQ.txt;
refType = 2;
};
FA550F3403D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = INSTALL;
path = ../doc/de/INSTALL;
refType = 2;
};
FA550F3503D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = Makefile.am;
path = ../doc/de/Makefile.am;
refType = 2;
};
FA550F3603D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = Protocol.txt;
path = ../doc/de/Protocol.txt;
refType = 2;
};
FA550F3703D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = README;
path = ../doc/de/README;
refType = 2;
};
FA550F3803D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = "README-AUX.txt";
path = "../doc/de/README-AUX.txt";
refType = 2;
};
FA550F3903D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = "README-BeOS.txt";
path = "../doc/de/README-BeOS.txt";
refType = 2;
};
FA550F3A03D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = RFC.txt;
path = ../doc/de/RFC.txt;
refType = 2;
};
FA550F3B03D59CD800A85B04 = {
fileEncoding = 5;
isa = PBXFileReference;
name = "sample-ngircd.conf";
path = "../doc/de/sample-ngircd.conf";
refType = 2;
};
FAC0383C03BB318400A85B04 = { FAC0383C03BB318400A85B04 = {
fileRef = F51044520297ABF80173DE11; fileRef = F51044520297ABF80173DE11;
isa = PBXBuildFile; isa = PBXBuildFile;

View File

@@ -1,20 +1,19 @@
# #
# ngIRCd -- The Next Generation IRC Daemon # ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) # Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
# #
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen # This program is free software; you can redistribute it and/or modify
# der GNU General Public License (GPL), wie von der Free Software Foundation # it under the terms of the GNU General Public License as published by
# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 # the Free Software Foundation; either version 2 of the License, or
# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. # (at your option) any later version.
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste # Please read the file COPYING, README and AUTHORS for more information.
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
# #
# $Id: Makefile.am,v 1.10 2002/10/01 09:57:08 alex Exp $ # $Id: Makefile.am,v 1.10.4.2 2003/07/09 21:14:08 alex Exp $
# #
AUTOMAKE_OPTIONS = gnu AUTOMAKE_OPTIONS = gnu
SUBDIRS = doc MacOSX src man contrib SUBDIRS = doc MacOSX src man contrib debian
maintainer-clean-local: maintainer-clean-local:
rm -rf autom4te.cache rm -rf autom4te.cache
@@ -28,4 +27,7 @@ lint:
rpm: distcheck rpm: distcheck
rpm -ta ngircd-*.tar.gz rpm -ta ngircd-*.tar.gz
deb:
dpkg-buildpackage -rfakeroot
# -eof- # -eof-

19
NEWS
View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton, (c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/ alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the ngIRCd is free software and published under the
@@ -10,7 +10,20 @@
-- NEWS -- -- NEWS --
ngIRCd CVS-HEAD ngIRCd 0.7.5 (2003-07-11)
- New configuration variable "MaxConnectionsIP" to limit the number of
simultaneous connections from a single IP that the server will accept.
This configuration options lowers the risk of denial of service attacks
(DoS), the default is 5 connections per client IP.
- Added new configuration variable "Listen" to bind all listening
sockets of the server to a single IP address.
ngIRCd 0.7.1 (2003-07-18)
- Added support for GNU/Hurd.
ngIRCd 0.7.0 (2003-05-01)
- New command CONNECT to enable and add server links. The syntax is not - New command CONNECT to enable and add server links. The syntax is not
RFC-compatible: use "CONNECT <name> <port>" to enable and connect an RFC-compatible: use "CONNECT <name> <port>" to enable and connect an
@@ -161,4 +174,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.6 2004/02/03 16:01:29 alex Exp $

4
README
View File

@@ -1,7 +1,7 @@
ngIRCd - Next Generation IRC Server ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton, (c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/ alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the ngIRCd is free software and published under the
@@ -83,4 +83,4 @@ mail to: <alex@barton.de> or <alex@arthur.ath.cx>
-- --
$Id: README,v 1.17 2003/03/09 22:03:58 alex Exp $ $Id: README,v 1.17.2.1 2004/02/03 16:01:29 alex Exp $

View File

@@ -1,9 +1,10 @@
#!/bin/sh #!/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 && \ aclocal && \
autoheader && \ autoheader && \

340
config.guess vendored
View File

@@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc. # 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2002-03-04' timestamp='2003-10-07'
# This file is free software; you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by
@@ -88,30 +88,42 @@ if test $# != 0; then
exit 1 exit 1
fi fi
trap 'exit 1' 1 2 15
dummy=dummy-$$ # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated. # use `HOST_CC' if defined, but it is deprecated.
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in # Portable tmp directory creation inspired by the Autoconf team.
,,) echo "int dummy(){}" > $dummy.c ;
for c in cc gcc c89 ; do set_cc_for_build='
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
if test $? = 0 ; then trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ; CC_FOR_BUILD="$c"; break ;
fi ; fi ;
done ; done ;
rm -f $dummy.c $dummy.o $dummy.rel ;
if test x"$CC_FOR_BUILD" = x ; then if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ; CC_FOR_BUILD=no_compiler_found ;
fi fi
;; ;;
,,*) CC_FOR_BUILD=$CC ;; ,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac' esac ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24) # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -142,6 +154,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)` /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;; arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;; sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;; sh3eb) machine=sh-unknown ;;
@@ -167,7 +180,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;; ;;
esac esac
# The OS release # The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form: # contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
@@ -216,65 +240,52 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
if test $UNAME_RELEASE = "V4.0"; then if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi fi
# 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
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Vn.n version is a released version. # A Vn.n version is a released version.
# A Tn.n version is a released field test version. # A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
esac
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;; exit 0 ;;
Alpha*:OpenVMS:*:*)
echo alpha-hp-vms
exit 0 ;;
Alpha\ *:Windows_NT*:*) Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead # Should we change UNAME_MACHINE based on the output of uname instead
@@ -313,6 +324,13 @@ EOF
NILE*:*:*:dcosx) NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4 echo pyramid-pyramid-svr4
exit 0 ;; exit 0 ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
sun4H:SunOS:5.*:*) sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit 0 ;;
@@ -419,15 +437,20 @@ EOF
exit (-1); exit (-1);
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy \ $CC_FOR_BUILD -o $dummy $dummy.c \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm -f $dummy.c $dummy && exit 0 && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE} echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
Motorola:PowerMAX_OS:*:*) Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax echo powerpc-motorola-powermax
exit 0 ;; exit 0 ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*) Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix echo powerpc-harris-powerunix
exit 0 ;; exit 0 ;;
@@ -500,8 +523,7 @@ EOF
exit(0); exit(0);
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5 echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4 echo rs6000-ibm-aix3.2.4
@@ -599,11 +621,21 @@ EOF
exit (0); exit (0);
} }
EOF EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi test -z "$HP_ARCH" && HP_ARCH=hppa
rm -f $dummy.c $dummy
fi ;; fi ;;
esac esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
# avoid double evaluation of $set_cc_for_build
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV} echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;; exit 0 ;;
ia64:HP-UX:*:*) ia64:HP-UX:*:*)
@@ -637,8 +669,7 @@ EOF
exit (0); exit (0);
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2 echo unknown-hitachi-hiuxwe2
exit 0 ;; exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -696,15 +727,15 @@ EOF
CRAY*TS:*:*:*) CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit 0 ;;
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*) CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit 0 ;;
CRAY*SV1:*:*:*) CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit 0 ;;
*:UNICOS/mp:*:*)
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
@@ -721,7 +752,21 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` # 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}
exit 0 ;; exit 0 ;;
i*:CYGWIN*:*) i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin echo ${UNAME_MACHINE}-pc-cygwin
@@ -732,14 +777,17 @@ EOF
i*:PW*:*) i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32 echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;; exit 0 ;;
x86:Interix*:3*) x86:Interix*:[34]*)
echo i386-pc-interix3 echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit 0 ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit 0 ;; exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386? # UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix echo i586-pc-interix
exit 0 ;; exit 0 ;;
i*:UWIN*:*) i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin echo ${UNAME_MACHINE}-pc-uwin
@@ -751,16 +799,24 @@ EOF
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit 0 ;;
*:GNU:*:*) *:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;; exit 0 ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit 0 ;;
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
exit 0 ;; exit 0 ;;
arm*:Linux:*:*) arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit 0 ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit 0 ;;
ia64:Linux:*:*) ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit 0 ;;
m68*:Linux:*:*) m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -771,19 +827,37 @@ EOF
#undef CPU #undef CPU
#undef mips #undef mips
#undef mipsel #undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel CPU=mipsel
#else #else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips CPU=mips
#else #else
CPU= CPU=
#endif #endif
#endif #endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
rm -f $dummy.c test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;; ;;
ppc:Linux:*:*) ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu echo powerpc-unknown-linux-gnu
@@ -819,6 +893,9 @@ EOF
s390:Linux:*:* | s390x:Linux:*:*) s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;; exit 0 ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sh*:Linux:*:*) sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit 0 ;;
@@ -845,7 +922,7 @@ EOF
;; ;;
a.out-i386-linux) a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout" echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 ;; exit 0 ;;
coff-i386) coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff" echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;; exit 0 ;;
@@ -876,9 +953,11 @@ EOF
LIBC=gnuaout LIBC=gnuaout
#endif #endif
#endif #endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
rm -f $dummy.c
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;; ;;
@@ -896,6 +975,23 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it. # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;; exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -917,22 +1013,19 @@ EOF
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586 && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686 && UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686 && UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else else
echo ${UNAME_MACHINE}-pc-sysv32 echo ${UNAME_MACHINE}-pc-sysv32
fi fi
exit 0 ;; exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*) pc:*:*:*)
# Left here for compatibility: # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -956,9 +1049,15 @@ EOF
# "miniframe" # "miniframe"
echo m68010-convergent-sysv echo m68010-convergent-sysv
exit 0 ;; exit 0 ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit 0 ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
M68*:*:R3V[567]*:*) M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*: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)
OS_REL='' OS_REL=''
test -r /etc/.relid \ test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -975,9 +1074,6 @@ EOF
mc68030:UNIX_System_V:4.*:*) mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4 echo m68k-atari-sysv4
exit 0 ;; exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*) TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE} echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
@@ -1049,6 +1145,9 @@ EOF
SX-5:SUPER-UX:*:*) SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE} echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*) Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE} echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
@@ -1056,20 +1155,24 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:Darwin:*:*) *:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE} case `uname -p` in
*86) UNAME_PROCESSOR=i686 ;;
powerpc) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*) *:procnto*:*:* | *:QNX:[0123456789]*:*)
if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc UNAME_MACHINE=pc
echo i386-${UNAME_MACHINE}-nto-qnx
else
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
fi fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:QNX:*:4*) *:QNX:*:4*)
echo i386-pc-qnx echo i386-pc-qnx
exit 0 ;; exit 0 ;;
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE} echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:NonStop-UX:*:*) *:NonStop-UX:*:*)
@@ -1092,11 +1195,6 @@ EOF
fi fi
echo ${UNAME_MACHINE}-unknown-plan9 echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;; exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*) *:TOPS-10:*:*)
echo pdp10-unknown-tops10 echo pdp10-unknown-tops10
exit 0 ;; exit 0 ;;
@@ -1115,11 +1213,8 @@ EOF
*:ITS:*:*) *:ITS:*:*)
echo pdp10-unknown-its echo pdp10-unknown-its
exit 0 ;; exit 0 ;;
i*86:XTS-300:*:STOP) SEI:*:*:SEIUX)
echo ${UNAME_MACHINE}-unknown-stop echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;; exit 0 ;;
esac esac
@@ -1241,8 +1336,7 @@ main ()
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment. # Apollos put the system type in the environment.

191
config.sub vendored
View File

@@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc. # 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2002-03-04' timestamp='2003-10-07'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
@@ -118,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
@@ -228,28 +228,42 @@ case $basic_machine in
| a29k \ | a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \ | c4x | clipper \
| d10v | d30v | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
| fr30 \ | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m68000 | m68k | m88k | mcore \ | m32r | m68000 | m68k | m88k | mcore \
| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips16 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mips64 | mips64el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mips64vr | mips64vrel \
| mipsisa32 \ | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \ | mn10200 | mn10300 \
| msp430 \
| ns16k | ns32k \ | ns16k | ns32k \
| openrisc | or32 \ | openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \ | pyramid \
| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ | 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 | sparcv9 | sparcv9b \
| strongarm \ | strongarm \
| tahoe | thumb | tic80 | tron \ | tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \ | v850 | v850e \
| we32k \ | we32k \
| x86 | xscale | xstormy16 | xtensa \ | x86 | xscale | xstormy16 | xtensa \
@@ -281,34 +295,50 @@ case $basic_machine in
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armv*-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \ | avr-* \
| bs2000-* \ | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \ | clipper-* | cydra-* \
| d10v-* | d30v-* \ | d10v-* | d30v-* | dlx-* \
| elxsi-* \ | elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \ | h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \ | i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32r-* \ | m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \ | m88110-* | m88k-* | mcore-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips16-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mips64-* | mips64el-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | mips64vr-* | mips64vrel-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* \ | romp-* | rs6000-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \ | v850-* | v850e-* | vax-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
@@ -346,6 +376,9 @@ case $basic_machine in
basic_machine=a29k-none basic_machine=a29k-none
os=-bsd os=-bsd
;; ;;
amd64)
basic_machine=x86_64-pc
;;
amdahl) amdahl)
basic_machine=580-amdahl basic_machine=580-amdahl
os=-sysv os=-sysv
@@ -695,6 +728,10 @@ case $basic_machine in
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
@@ -728,49 +765,55 @@ case $basic_machine in
pbb) pbb)
basic_machine=m68k-tti basic_machine=m68k-tti
;; ;;
pc532 | pc532-*) pc532 | pc532-*)
basic_machine=ns32k-pc532 basic_machine=ns32k-pc532
;; ;;
pentium | p5 | k5 | k6 | nexgen | viac3) pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | 6x86 | athlon) pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-* | athlon-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-*) pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
;; ;;
power) basic_machine=power-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc) basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
;; ;;
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown ppc64) basic_machine=powerpc64-unknown
;; ;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little) ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown basic_machine=powerpc64le-unknown
;; ;;
ppc64le-* | powerpc64little-*) ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
@@ -801,6 +844,16 @@ case $basic_machine in
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
@@ -808,6 +861,9 @@ case $basic_machine in
basic_machine=sh-hitachi basic_machine=sh-hitachi
os=-hms os=-hms
;; ;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs) sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs basic_machine=sparclite-wrs
os=-vxworks os=-vxworks
@@ -866,7 +922,7 @@ case $basic_machine in
sun386 | sun386i | roadrunner) sun386 | sun386i | roadrunner)
basic_machine=i386-sun basic_machine=i386-sun
;; ;;
sv1) sv1)
basic_machine=sv1-cray basic_machine=sv1-cray
os=-unicos os=-unicos
;; ;;
@@ -874,10 +930,6 @@ case $basic_machine in
basic_machine=i386-sequent basic_machine=i386-sequent
os=-dynix os=-dynix
;; ;;
t3d)
basic_machine=alpha-cray
os=-unicos
;;
t3e) t3e)
basic_machine=alphaev5-cray basic_machine=alphaev5-cray
os=-unicos os=-unicos
@@ -890,6 +942,14 @@ case $basic_machine in
basic_machine=tic54x-unknown basic_machine=tic54x-unknown
os=-coff os=-coff
;; ;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tx39) tx39)
basic_machine=mipstx39-unknown basic_machine=mipstx39-unknown
;; ;;
@@ -924,8 +984,8 @@ case $basic_machine in
os=-vms os=-vms
;; ;;
vpp*|vx|vx-*) vpp*|vx|vx-*)
basic_machine=f301-fujitsu basic_machine=f301-fujitsu
;; ;;
vxworks960) vxworks960)
basic_machine=i960-wrs basic_machine=i960-wrs
os=-vxworks os=-vxworks
@@ -946,11 +1006,7 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
windows32) xps | xps100)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
ymp) ymp)
@@ -996,7 +1052,7 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4 | sh3eb | sh4eb) sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sh64) sh64)
@@ -1005,7 +1061,7 @@ case $basic_machine in
sparc | sparcv9 | sparcv9b) sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
cydra) cydra)
basic_machine=cydra-cydrome basic_machine=cydra-cydrome
;; ;;
orion) orion)
@@ -1020,10 +1076,6 @@ case $basic_machine in
pmac | pmac-mpw) pmac | pmac-mpw)
basic_machine=powerpc-apple basic_machine=powerpc-apple
;; ;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown) *-unknown)
# Make sure to match an already-canonicalized machine name. # Make sure to match an already-canonicalized machine name.
;; ;;
@@ -1079,18 +1131,19 @@ case $os in
| -aos* \ | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \ | -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova*) | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@@ -1102,8 +1155,10 @@ case $os in
;; ;;
esac esac
;; ;;
-nto-qnx*)
;;
-nto*) -nto*)
os=-nto-qnx os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1112,6 +1167,9 @@ case $os in
-mac*) -mac*)
os=`echo $os | sed -e 's|mac|macos|'` os=`echo $os | sed -e 's|mac|macos|'`
;; ;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*) -linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'` os=`echo $os | sed -e 's|linux|linux-gnu|'`
;; ;;
@@ -1155,7 +1213,7 @@ case $os in
os=-rtmk-nova os=-rtmk-nova
;; ;;
-ns2 ) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*) -nsk*)
os=-nsk os=-nsk
@@ -1194,8 +1252,14 @@ case $os in
-xenix) -xenix)
os=-xenix os=-xenix
;; ;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;; ;;
-none) -none)
;; ;;
@@ -1228,11 +1292,14 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry. # This must come before the *-dec entry.
pdp10-*) pdp10-*)
os=-tops20 os=-tops20
;; ;;
pdp11-*) pdp11-*)
os=-none os=-none
;; ;;
*-dec | vax-*) *-dec | vax-*)
@@ -1325,19 +1392,19 @@ case $basic_machine in
*-next) *-next)
os=-nextstep3 os=-nextstep3
;; ;;
*-gould) *-gould)
os=-sysv os=-sysv
;; ;;
*-highlevel) *-highlevel)
os=-bsd os=-bsd
;; ;;
*-encore) *-encore)
os=-bsd os=-bsd
;; ;;
*-sgi) *-sgi)
os=-irix os=-irix
;; ;;
*-siemens) *-siemens)
os=-sysv4 os=-sysv4
;; ;;
*-masscomp) *-masscomp)
@@ -1409,7 +1476,7 @@ case $basic_machine in
-ptx*) -ptx*)
vendor=sequent vendor=sequent
;; ;;
-vxsim* | -vxworks*) -vxsim* | -vxworks* | -windiss*)
vendor=wrs vendor=wrs
;; ;;
-aux*) -aux*)

View File

@@ -8,13 +8,13 @@
# (at your option) any later version. # (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information. # Please read the file COPYING, README and AUTHORS for more information.
# #
# $Id: configure.in,v 1.89 2003/04/21 10:51:44 alex Exp $ # $Id: configure.in,v 1.89.2.16 2004/02/05 13:33:24 alex Exp $
# #
# -- Initialisierung -- # -- Initialisierung --
AC_PREREQ(2.50) AC_PREREQ(2.50)
AC_INIT(ngircd, CVSHEAD) AC_INIT(ngircd, 0.7.7)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c) AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6) AM_INIT_AUTOMAKE(1.6)
@@ -26,9 +26,9 @@ AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists]) AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled]) AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant]) AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging]) AH_TEMPLATE([SYSLOG], [Define if syslog should be used for logging])
AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled]) AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
AH_TEMPLATE([USE_TCPWRAP], [Define if TCP wrappers should be used]) AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used])
AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used]) AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
AH_TEMPLATE([RENDEZVOUS], [Define if Rendezvous support should be included]) AH_TEMPLATE([RENDEZVOUS], [Define if Rendezvous support should be included])
@@ -57,25 +57,34 @@ AC_C_CONST
# -- Defines -- # -- Defines --
if test `uname` = "Linux"; then os=`uname`
if test "$os" = "Linux" -o $os = "GNU"; then
# define _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE when compiling # define _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE when compiling
# on Linux (glibc-based systems): # on Linux or Hurd (glibc-based systems):
AC_MSG_RESULT([detected Linux, defining _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE]) AC_MSG_RESULT([detected ${os}, defining _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE])
add_DEFINES="-D_POSIX_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE $add_DEFINES" add_DEFINES="-D_POSIX_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE $add_DEFINES"
fi fi
if test `uname` = "A/UX"; then if test "$os" = "A/UX"; then
# define _POSIX_SOURCE when compiling on A/UX: # define _POSIX_SOURCE when compiling on A/UX:
AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE]) AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
add_DEFINES="-D_POSIX_SOURCE $add_DEFINES" add_DEFINES="-D_POSIX_SOURCE $add_DEFINES"
fi fi
if test `uname` = "HP-UX"; then if test "$os" = "HP-UX"; then
# define _XOPEN_SOURCE_EXTENDED when compiling on HP-UX (11.11): # define _XOPEN_SOURCE_EXTENDED when compiling on HP-UX (11.11):
AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED]) AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
add_DEFINES="-D_XOPEN_SOURCE_EXTENDED $add_DEFINES" add_DEFINES="-D_XOPEN_SOURCE_EXTENDED $add_DEFINES"
fi fi
if test "$os" = "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 -- # -- Header --
AC_HEADER_STDC AC_HEADER_STDC
@@ -153,7 +162,7 @@ AC_ARG_WITH(syslog,
] ]
) )
if test "$x_syslog_on" = "yes"; then if test "$x_syslog_on" = "yes"; then
AC_DEFINE(USE_SYSLOG, 1) AC_DEFINE(SYSLOG, 1)
AC_CHECK_HEADERS(syslog.h) AC_CHECK_HEADERS(syslog.h)
fi fi
@@ -172,7 +181,7 @@ AC_ARG_WITH(zlib,
] ]
) )
if test "$x_zlib_on" = "yes"; then if test "$x_zlib_on" = "yes"; then
AC_DEFINE(USE_ZLIB, 1) AC_DEFINE(ZLIB, 1)
AC_CHECK_HEADERS(zlib.h) AC_CHECK_HEADERS(zlib.h)
fi fi
@@ -189,7 +198,7 @@ AC_ARG_WITH(tcp-wrappers,
ptr = hosts_access; ptr = hosts_access;
],[ ],[
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
AC_DEFINE(USE_TCPWRAP, 1) AC_DEFINE(TCPWRAP, 1)
x_tcpwrap_on=yes x_tcpwrap_on=yes
],[ ],[
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
@@ -259,7 +268,35 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
if test "$GCC" = "yes"; then if test "$GCC" = "yes"; then
the_CFLAGS="-Wmissing-declarations -Wpointer-arith -Wstrict-prototypes" 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
$CC --version | grep 20030304 >/dev/null 2>&1
if test $? -eq 0; then
# Mac OS X 10.3 (and Darwin 7.0?) have a strange gcc (or
# system header files?) which produces lots of errors when
# using -ansi; so we don't =:-)
AC_MSG_RESULT([detected broken GNU C compiler, disabling "-ansi"])
ansi=""
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="-pipe -Wall -W${ansi}${pedantic} $CFLAGS $CFLAGS_ADD"
else else
the_CFLAGS="$CFLAGS" the_CFLAGS="$CFLAGS"
add_CFLAGS="$CFLAGS_ADD" add_CFLAGS="$CFLAGS_ADD"
@@ -281,6 +318,7 @@ AC_OUTPUT([ \
src/testsuite/Makefile \ src/testsuite/Makefile \
man/Makefile \ man/Makefile \
contrib/Makefile \ contrib/Makefile \
debian/Makefile \
]) ])
# -- Result -- # -- Result --

View File

@@ -1,9 +1,9 @@
%define name ngircd %define name ngircd
%define version CurrentCVS %define version 0.7.7
%define release 1 %define release 1
%define prefix %{_prefix} %define prefix %{_prefix}
Summary: Next Generation Internet Relay Chat Daemon Summary: A lightweight daemon for the Internet Relay Chat (IRC)
Name: %{name} Name: %{name}
Version: %{version} Version: %{version}
Release: %{release} Release: %{release}
@@ -15,17 +15,18 @@ Packager: Sean Reifschneider <jafo-rpms@tummy.com>
BuildRoot: /var/tmp/%{name}-root BuildRoot: /var/tmp/%{name}-root
%description %description
ngIRCd is a free open source daemon for Internet Relay Chat (IRC), ngIRCd is a free open source daemon for the Internet Relay Chat (IRC),
developed under the GNU General Public License (GPL). It's written from developed under the GNU General Public License (GPL). It's written from
scratch and is not based upon the original IRCd like many others. scratch and is not based upon the original IRCd like many others.
Why should you use ngIRCd? Because ... Advantages:
- no problems with servers using changing/non-static IP addresses.
- small and lean configuration file.
- free, modern and open source C code.
- still under active development.
* ... there are no problems with servers on changing or non-static IP ngIRCd is compatible to the "original" ircd 2.10.3p3, so you can run
addresses. mixed networks.
* ... there is a small and lean configuration file.
* ... there is a free, modern and open source C source code.
* ... it is still under active development.
%prep %prep
%setup %setup

20
debian/Makefile.am vendored Normal file
View File

@@ -0,0 +1,20 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 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: Makefile.am,v 1.1.2.2 2003/12/05 13:31:22 alex Exp $
#
EXTRA_DIST = rules changelog compat control copyright \
ngircd.init ngircd.postinst
maintainer-clean-local:
rm -f Makefile Makefile.in
# -eof-

78
debian/changelog vendored Normal file
View File

@@ -0,0 +1,78 @@
ngircd (0.7.7-0ab1) unstable; urgency=low
* New upstream version.
-- Alexander Barton <alex@Arthur.Ath.CX> Thu, 5 Feb 2004 14:11:08 +0100
ngircd (0.7.6-0ab1) unstable; urgency=medium
* New upstream version.
* Changed version numvering scheme of debian package.
-- Alexander Barton <alex@Arthur.Ath.CX> Fri, 5 Dec 2003 14:26:41 +0100
ngircd (0.7.5-0.2ab) unstable; urgency=low
* Updated RPM and Debian package description and configuration.
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 29 Nov 2003 21:24:32 +0100
ngircd (0.7.5-0.1ab) unstable; urgency=low
* New upstream version.
-- Alexander Barton <alex@Arthur.Ath.CX> Fri, 7 Nov 2003 21:59:58 +0100
ngircd (0.7.1-0.1ab) unstable; urgency=low
* New upstream version :-)
-- Alexander Barton <alex@Arthur.Ath.CX> Fri, 18 Jul 2003 22:53:02 +0200
ngircd (0.7.0-0.7ab) unstable; urgency=low
* Fixed up post installation script (added interpreter, fixed chmod call).
-- Alexander Barton <alex@Arthur.Ath.CX> Sun, 13 Jul 2003 00:52:38 +0200
ngircd (0.7.0-0.6ab) unstable; urgency=low
* Added /etc/default/ngircd.
* Included own post installation script.
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 12 Jul 2003 20:31:09 +0200
ngircd (0.7.0-0.5ab) unstable; urgency=low
* Enhanced init script.
* Included NJOIN fix from actual CVS "HEAD" branch.
-- Alexander Barton <alex@Arthur.Ath.CX> Wed, 9 Jul 2003 22:40:49 +0200
ngircd (0.7.0-0.4ab) unstable; urgency=low
* Reverted use of dh_installexamples.
-- Alexander Barton <alex@Arthur.Ath.CX> Thu, 22 May 2003 00:15:03 +0200
ngircd (0.7.0-0.3ab) unstable; urgency=low
* Removed "debian/docs" and "debian/conffiles"; debhelper takes care of
this for us automagically.
* Excluded "etc/ngircd.conf" from dh_fixperms.
-- Alexander Barton <alex@Arthur.Ath.CX> Wed, 21 May 2003 23:25:05 +0200
ngircd (0.7.0-0.2ab) unstable; urgency=low
* Fixed wrong variable substitution in init script.
* Added some CVS "Id-Tags" (but not checked in, yet).
* Removed own "Provides:" from control file.
-- Alexander Barton <alex@barton.de> Wed, 21 May 2003 12:32:34 +0200
ngircd (0.7.0-0.1ab) unstable; urgency=low
* Initial Release.
-- Alexander Barton <alex@barton.de> Wed, 21 May 2003 02:36:52 +0200

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
4

23
debian/control vendored Normal file
View File

@@ -0,0 +1,23 @@
Source: ngircd
Section: net
Priority: optional
Maintainer: Alexander Barton <alex@barton.de>
Build-Depends: debhelper (>> 4.0.0), libz-dev
Standards-Version: 3.5.8
Package: ngircd
Architecture: any
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
IRCd like many others.
.
Advantages:
- no problems with servers using changing/non-static IP addresses.
- small and lean configuration file.
- free, modern and open source C code.
- still under active development.
.
ngIRCd is compatible to the "original" ircd 2.10.3p3, so you can run
mixed networks.

13
debian/copyright vendored Normal file
View File

@@ -0,0 +1,13 @@
This package was debianized by Alexander Barton <alex@barton.de> on
Tue, 20 May 2003 15:47:40 +0200.
It was downloaded from ftp://Arthur.Ath.CX/pub/Users/alex/ngircd/
Upstream Author: Alexander Barton <alex@barton.de>
This software is copyright (c) 1999-2003 by Alexander Barton.
You are free to distribute this software under the terms of the
GNU General Public License.
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL file.

12
debian/ngircd.default vendored Normal file
View File

@@ -0,0 +1,12 @@
#
# Defaults for ngIRCd start and stop script
#
# $Id: ngircd.default,v 1.1.2.1 2003/07/12 18:23:24 alex Exp $
#
# Parameters to pass to the ngircd daemon on startup, see ngircd(8) for
# possible options (default: empty).
PARAMS=""
# -eof-

71
debian/ngircd.init vendored Normal file
View File

@@ -0,0 +1,71 @@
#!/bin/sh
#
# ngIRCd start and stop script for Debian-based systems
#
# $Id: ngircd.init,v 1.1.2.1 2003/07/09 21:12:00 alex Exp $
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/ngircd
NAME=ngIRCd
DESC="IRC daemon"
PARAMS=""
test -x $DAEMON || exit 0
test -f /etc/default/ngircd && . /etc/default/ngircd
Check_Config()
{
$DAEMON --configtest >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Configuration of $NAME is not valide, won't (re)start!"
echo "Please run \"$DAEMON --configtest\" manually and fix it up ..."
exit 1
fi
}
Try_Start()
{
start-stop-daemon --start --quiet --exec $DAEMON -- $PARAMS
if [ $? -ne 0 ]; then
echo "$NAME failed!"
exit 1
fi
echo "$NAME."
}
case "$1" in
start)
Check_Config
echo -n "Starting $DESC: "
Try_Start
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --exec $DAEMON \
&& echo "$NAME." \
|| echo "(none running)"
;;
reload|force-reload)
Check_Config
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
;;
restart)
Check_Config
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
sleep 1
Try_Start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
# -eof-

14
debian/ngircd.postinst vendored Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
#
# Debian post-installation script
# $Id: ngircd.postinst,v 1.1.2.4 2003/11/29 20:29:02 alex Exp $
#
if [ -f /etc/ngircd/ngircd.conf ]; then
# make sure that configuration file is not world readable
chmod o= /etc/ngircd/ngircd.conf
fi
#DEBHELPER#
# -eof-

110
debian/rules vendored Normal file
View File

@@ -0,0 +1,110 @@
#!/usr/bin/make -f
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 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.
#
# debian/rules for ngIRCd
#
# $Id: rules,v 1.1.2.2 2003/11/29 20:29:02 alex Exp $
#
# Based on the sample debian/rules that uses debhelper,
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
config.status: configure
dh_testdir
# Add here commands to configure the package.
./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--sysconfdir=/etc/ngircd \
--mandir=\$${prefix}/share/man \
--with-syslog --with-zlib
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/ngircd.
$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
rm -f $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
rm -f $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installinit
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
# -eof-

View File

@@ -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? Q: Is there a homepage with further information and downloads?
A: Yes. Please visit <http://arthur.ath.cx/~alex/ngircd/>. 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 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 $

View File

@@ -9,11 +9,11 @@
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste # Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. # 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 \ EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt Platforms.txt \
README-BeOS.txt RFC.txt sample-ngircd.conf README-AUX.txt README-BeOS.txt RFC.txt sample-ngircd.conf
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile Makefile.in rm -f Makefile Makefile.in

56
doc/Platforms.txt Normal file
View File

@@ -0,0 +1,56 @@
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.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/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 03-05-15 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
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
sparc/sun/solaris2.7 gcc 3.3 CVSHEAD 03-07-06 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.5 2003/07/18 20:48:20 alex Exp $

View File

@@ -22,9 +22,10 @@ in all details. But because the ngIRCd should be a fully compatible
replacement for this server ("ircd") it tries to emulate these differences. replacement for this server ("ircd") it tries to emulate these differences.
If you don't like this behavior please ./configure the ngIRCd using the 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 keep in mind: not all IRC
clients are compatible with such an server, some can't even connect at all! clients are compatible with a server configured that way, some can't even
Therefore this option isn't desired for "normal operation". connect at all! Therefore this option usually isn't desired for "normal
server operation".
II. The IRC+ Protocol II. The IRC+ Protocol
@@ -35,8 +36,8 @@ as defined in RFC 2810-2813. This enhanced protocol is named "IRC+". It is
backwards compatible to the "plain" IRC protocol and will only be used by backwards compatible to the "plain" IRC protocol and will only be used by
the ngIRCd if it detects that the peer supports it as well. the ngIRCd if it detects that the peer supports it as well.
The "PASSV" command is used to detect the protocol and peer versions (see The "PASS" command is used to detect the protocol and peer versions see
RFC 2813, section 4.1.1). RFC 2813 (section 4.1.1) and below.
II.1 Register new server link II.1 Register new server link
@@ -57,9 +58,11 @@ The following optional(!) 10 bytes contain an implementation-dependent
version number. Servers supporting the IRC+ protocol as defined in this version number. Servers supporting the IRC+ protocol as defined in this
document provide the string "-IRC+" here. document provide the string "-IRC+" here.
Example for <version>: "0210-IRC+".
<flags> consists of two parts separated with the character "|" and is at <flags> consists of two parts separated with the character "|" and is at
most 100 bytes long. The first part contains the name of the implementation most 100 bytes long. The first part contains the name of the implementation
(ngIRCd sets this to "ngIRCd", the original ircd to "IRC", e.g.). The second (ngIRCd sets this to "ngircd", the original ircd to "IRC", e.g.). The second
part is implementation-dependent and should only be parsed if the peer part is implementation-dependent and should only be parsed if the peer
supports the IRC+ protocol as well. In this case the following syntax is supports the IRC+ protocol as well. In this case the following syntax is
used: "<serverversion>[:<serverflags>]". used: "<serverversion>[:<serverflags>]".
@@ -68,15 +71,19 @@ used: "<serverversion>[:<serverflags>]".
number, <serverflags> indicates the supported IRC+ protocol extensions (and number, <serverflags> indicates the supported IRC+ protocol extensions (and
may be empty!). may be empty!).
The optional parameter <options> is used to propagate server options as
defined in RFC 2813, section 4.1.1.
The following <serverflags> are defined at the moment: The following <serverflags> are defined at the moment:
- C: The server supports the CHANINFO command.
- o: IRC operators are allowed to change channel- and channel-user-modes - o: IRC operators are allowed to change channel- and channel-user-modes
even if they aren't channel-operator of the affected channel. even if they aren't channel-operator of the affected channel.
- C: The server supports the CHANINFO command. - Z: Compressed server links are supported by the server.
Example for a complete <flags> string: "ngircd|0.7.5:CZ".
The optional parameter <options> is used to propagate server options as
defined in RFC 2813, section 4.1.1.
II.2 Exchange channel-modes, topics, and persistent channels II.2 Exchange channel-modes, topics, and persistent channels
@@ -104,4 +111,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.2 2003/12/08 14:24:13 alex Exp $

View File

@@ -10,10 +10,10 @@
-- README-BeOS.txt -- -- README-BeOS.txt --
+--------------------------------------------------------------+ +-------------------------------------------------------------+
| This text is only available in german at the moment, sorry! | | This text is only available in german at the moment, sorry! |
| Contributors are welcome :-) | | Contributors for this text or the BeOS port are welcome :-) |
+--------------------------------------------------------------+ +-------------------------------------------------------------+
BeOS gehoert im Moment (noch?) nicht zu den offiziell unterstuetzten Plat- BeOS gehoert im Moment (noch?) nicht zu den offiziell unterstuetzten Plat-
@@ -50,4 +50,4 @@ mir in Verbindung setzen (alex@barton.de), ich maile gerne meine Patches zu.
Fuer eine Aenderung im CVS ist es aber meiner Meinung nach noch zu frueh ... Fuer eine Aenderung im CVS ist es aber meiner Meinung nach noch zu frueh ...
-- --
$Id: README-BeOS.txt,v 1.6 2003/04/21 12:55:39 alex Exp $ $Id: README-BeOS.txt,v 1.6.2.1 2003/07/18 20:48:20 alex Exp $

View File

@@ -1,13 +1,13 @@
# $Id: sample-ngircd.conf,v 1.20 2003/03/10 00:23:34 alex Exp $ # $Id: sample-ngircd.conf,v 1.20.2.4 2003/12/19 14:30:49 alex Exp $
# #
# This is a sample configuration file for the ngIRCd, which must adept to # This is a sample configuration file for the ngIRCd, which must be adepted
# the local preferences and needs. # to the local preferences and needs.
# #
# Comments are started with "#" or ";". # Comments are started with "#" or ";".
# #
# Author: Alexander Barton, <alex@barton.de> # Use "ngircd --configtest" (see manual page ngircd(8)) to validate that the
# Initial translation by Ilja Osthoff, <ilja@glide.ath.cx> # server interpreted the configuration file as expected!
# #
[Global] [Global]
@@ -16,15 +16,19 @@
# configuration of the server, like the server name and the ports # configuration of the server, like the server name and the ports
# on which the server should be listening. # 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. Required!
Name = irc.the.net Name = irc.the.net
# Info text of the server. This will be shown by WHOIS and # Info text of the server. This will be shown by WHOIS and
# LINKS requests for example. # LINKS requests for example.
Info = Server Info Text 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 # Information about the server and the administrator, used by the
# ADMIN command. # ADMIN command. Not required by server but by RFC!
;AdminInfo1 = Description ;AdminInfo1 = Description
;AdminInfo2 = Location ;AdminInfo2 = Location
;AdminEMail = admin@irc.server ;AdminEMail = admin@irc.server
@@ -32,6 +36,10 @@
# Ports on which the server should listen. There may be more than # Ports on which the server should listen. There may be more than
# one port, separated with ";". (Default: 6667) # one port, separated with ";". (Default: 6667)
;Ports = 6667, 6668, 66694 ;Ports = 6667, 6668, 66694
# IP address on which the server should listen. (Default: empty,
# so the server listens on all IP addresses of the system)
;Listen = 1.2.3.4
# Text file with the "message of the day" (MOTD). This message will # Text file with the "message of the day" (MOTD). This message will
# be shown to all users connecting to the server: # be shown to all users connecting to the server:
@@ -68,6 +76,10 @@
# Maximum number of simultaneous connection the server is allowed # Maximum number of simultaneous connection the server is allowed
# to accept (<=0: unlimited): # to accept (<=0: unlimited):
;MaxConnections = -1 ;MaxConnections = -1
# Maximum number of simultaneous connections from a single IP address
# the server will accept (<=0: unlimited):
;MaxConnectionsIP = 5
# Maximum number of channels a user can be member of (<=0: no limit): # Maximum number of channels a user can be member of (<=0: no limit):
;MaxJoins = 10 ;MaxJoins = 10

View File

@@ -1,7 +1,7 @@
.\" .\"
.\" $Id: ngircd.conf.5,v 1.9 2003/03/10 00:58:06 alex Exp $ .\" $Id: ngircd.conf.5,v 1.9.2.2 2003/11/07 20:51:10 alex Exp $
.\" .\"
.TH ngircd.conf 5 "March 2003" ngircd "ngIRCd Manual" .TH ngircd.conf 5 "Mai 2003" ngircd "ngIRCd Manual"
.SH NAME .SH NAME
ngircd.conf \- configuration file of ngIRCd ngircd.conf \- configuration file of ngIRCd
.SH SYNOPSIS .SH SYNOPSIS
@@ -67,6 +67,10 @@ command.
Ports on which the server should listen. There may be more than one port, Ports on which the server should listen. There may be more than one port,
separated with ';'. Default: 6667. separated with ';'. Default: 6667.
.TP .TP
\fBListen\fR
The ip address on which the server should listen. Default is empty, so
the server listens on all configured ip addresses and interfaces.
.TP
\fBMotdFile\fR \fBMotdFile\fR
Text file with the "message of the day" (MOTD). This message will be shown Text file with the "message of the day" (MOTD). This message will be shown
to all users connecting to the server. to all users connecting to the server.
@@ -101,7 +105,7 @@ the peer to test whether it is alive or not. Default: 120.
\fBPongTimeout\fR \fBPongTimeout\fR
If a client fails to answer a PING with a PONG within <PongTimeout> If a client fails to answer a PING with a PONG within <PongTimeout>
seconds, it will be disconnected by the server. Default: 20. seconds, it will be disconnected by the server. Default: 20.
.IT .TP
\fBConnectRetry\fR \fBConnectRetry\fR
The server tries every <ConnectRetry> seconds to establish a link to not yet The server tries every <ConnectRetry> seconds to establish a link to not yet
(or no longer) connected servers. Default: 60. (or no longer) connected servers. Default: 60.
@@ -114,6 +118,11 @@ not(!) channel-operators? Default: no.
Maximum number of simultaneous connection the server is allowed to accept Maximum number of simultaneous connection the server is allowed to accept
(<=0: unlimited). Default: -1. (<=0: unlimited). Default: -1.
.TP .TP
\fBMaxConnectionsIP\fR
Maximum number of simultaneous connections from a single IP address that
the server will accept (<=0: unlimited). This configuration options lowers
the risk of denial of service attacks (DoS). Default: 5.
.TP
\fBMaxJoins\fR \fBMaxJoins\fR
Maximum number of channels a user can be member of (<=0: no limit). Maximum number of channels a user can be member of (<=0: no limit).
Default: 10. Default: 10.

View File

@@ -8,7 +8,7 @@
# (at your option) any later version. # (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information. # Please read the file COPYING, README and AUTHORS for more information.
# #
# $Id: Makefile.am,v 1.39 2003/03/31 19:01:02 alex Exp $ # $Id: Makefile.am,v 1.39.2.3 2003/12/04 14:13:42 alex Exp $
# #
AUTOMAKE_OPTIONS = ../portab/ansi2knr AUTOMAKE_OPTIONS = ../portab/ansi2knr
@@ -61,7 +61,13 @@ lint:
fi; \ fi; \
done; done;
ngircd.c: cvs-date cvs-version.h ngircd.c: cvs-version.h
irc-login.c: cvs-version.h
irc-info.c: cvs-version.h
cvs-version.h: cvs-date
cvs-date: cvs-date:
grep VERSION ../config.h | grep "CVS" \ grep VERSION ../config.h | grep "CVS" \
@@ -69,7 +75,8 @@ cvs-date:
| $(AWK) "{ print \$$9 }" | sort | tail -1 \ | $(AWK) "{ print \$$9 }" | sort | tail -1 \
| sed -e "s/\//-/g" )\"" > cvs-version.new \ | sed -e "s/\//-/g" )\"" > cvs-version.new \
|| echo "" > cvs-version.new || echo "" > cvs-version.new
diff cvs-version.h cvs-version.new || cp cvs-version.new cvs-version.h diff cvs-version.h cvs-version.new 2>/dev/null \
|| cp cvs-version.new cvs-version.h
TESTS = check-version check-help TESTS = check-version check-help

View File

@@ -17,7 +17,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: channel.c,v 1.42 2002/12/30 17:15:42 alex Exp $"; static char UNUSED id[] = "$Id: channel.c,v 1.42.2.1 2003/11/07 20:51:10 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -669,7 +669,7 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
{ {
BOOLEAN is_member, has_voice, is_op, ok; BOOLEAN is_member, has_voice, is_op, ok;
/* Okay, Ziel ist ein Channel */ /* Okay, target is a channel */
is_member = has_voice = is_op = FALSE; is_member = has_voice = is_op = FALSE;
if( Channel_IsMemberOf( Chan, From )) if( Channel_IsMemberOf( Chan, From ))
{ {
@@ -678,14 +678,21 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
if( strchr( Channel_UserModes( Chan, From ), 'o' )) is_op = TRUE; if( strchr( Channel_UserModes( Chan, From ), 'o' )) is_op = TRUE;
} }
/* pruefen, ob Client in Channel schreiben darf */ /* Check weather client is allowed to write to channel */
ok = TRUE; ok = TRUE;
if( strchr( Channel_Modes( Chan ), 'n' ) && ( ! is_member )) ok = FALSE; if( strchr( Channel_Modes( Chan ), 'n' ) && ( ! is_member )) ok = FALSE;
if( strchr( Channel_Modes( Chan ), 'm' ) && ( ! is_op ) && ( ! has_voice )) ok = FALSE; if( strchr( Channel_Modes( Chan ), 'm' ) && ( ! is_op ) && ( ! has_voice )) ok = FALSE;
/* Is the client banned? */
if( Lists_CheckBanned( From, Chan ))
{
/* Client is banned, bus is he channel operator or has voice? */
if(( ! has_voice ) && ( ! is_op )) ok = FALSE;
}
if( ! ok ) return IRC_WriteStrClient( From, ERR_CANNOTSENDTOCHAN_MSG, Client_ID( From ), Channel_Name( Chan )); if( ! ok ) return IRC_WriteStrClient( From, ERR_CANNOTSENDTOCHAN_MSG, Client_ID( From ), Channel_Name( Chan ));
/* Text senden */ /* Send text */
if( Client_Conn( From ) > NONE ) Conn_UpdateIdle( Client_Conn( From )); if( Client_Conn( From ) > NONE ) Conn_UpdateIdle( Client_Conn( From ));
return IRC_WriteStrChannelPrefix( Client, Chan, From, TRUE, "PRIVMSG %s :%s", Channel_Name( Chan ), Text ); return IRC_WriteStrChannelPrefix( Client, Chan, From, TRUE, "PRIVMSG %s :%s", Channel_Name( Chan ), Text );
} /* Channel_Write */ } /* Channel_Write */

View File

@@ -14,7 +14,7 @@
#include "portab.h" #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.4 2003/12/19 14:30:49 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -108,7 +108,7 @@ Conf_Test( VOID )
puts( "[GLOBAL]" ); puts( "[GLOBAL]" );
printf( " ServerName = %s\n", Conf_ServerName ); printf( " ServerName = %s\n", Conf_ServerName );
printf( " ServerInfo = %s\n", Conf_ServerInfo ); 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( " AdminInfo1 = %s\n", Conf_ServerAdmin1 );
printf( " AdminInfo2 = %s\n", Conf_ServerAdmin2 ); printf( " AdminInfo2 = %s\n", Conf_ServerAdmin2 );
printf( " AdminEMail = %s\n", Conf_ServerAdminMail ); printf( " AdminEMail = %s\n", Conf_ServerAdminMail );
@@ -120,6 +120,7 @@ Conf_Test( VOID )
printf( "%u", Conf_ListenPorts[i] ); printf( "%u", Conf_ListenPorts[i] );
} }
puts( "" ); puts( "" );
printf( " Listen = %s\n", Conf_ListenAddress );
pwd = getpwuid( Conf_UID ); pwd = getpwuid( Conf_UID );
if( pwd ) printf( " ServerUID = %s\n", pwd->pw_name ); if( pwd ) printf( " ServerUID = %s\n", pwd->pw_name );
else printf( " ServerUID = %ld\n", (LONG)Conf_UID ); else printf( " ServerUID = %ld\n", (LONG)Conf_UID );
@@ -132,6 +133,8 @@ Conf_Test( VOID )
printf( " OperCanUseMode = %s\n", Conf_OperCanMode == TRUE ? "yes" : "no" ); printf( " OperCanUseMode = %s\n", Conf_OperCanMode == TRUE ? "yes" : "no" );
if( Conf_MaxConnections > 0 ) printf( " MaxConnections = %ld\n", Conf_MaxConnections ); if( Conf_MaxConnections > 0 ) printf( " MaxConnections = %ld\n", Conf_MaxConnections );
else printf( " MaxConnections = -1\n" ); else printf( " MaxConnections = -1\n" );
if( Conf_MaxConnectionsIP > 0 ) printf( " MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP );
else printf( " MaxConnectionsIP = -1\n" );
if( Conf_MaxJoins > 0 ) printf( " MaxJoins = %d\n", Conf_MaxJoins ); if( Conf_MaxJoins > 0 ) printf( " MaxJoins = %d\n", Conf_MaxJoins );
else printf( " MaxJoins = -1\n" ); else printf( " MaxJoins = -1\n" );
puts( "" ); puts( "" );
@@ -340,6 +343,7 @@ Set_Defaults( BOOLEAN InitServers )
strlcat( Conf_MotdFile, MOTD_FILE, sizeof( Conf_MotdFile )); strlcat( Conf_MotdFile, MOTD_FILE, sizeof( Conf_MotdFile ));
Conf_ListenPorts_Count = 0; Conf_ListenPorts_Count = 0;
strcpy( Conf_ListenAddress, "" );
Conf_UID = Conf_GID = 0; Conf_UID = Conf_GID = 0;
@@ -354,6 +358,7 @@ Set_Defaults( BOOLEAN InitServers )
Conf_OperCanMode = FALSE; Conf_OperCanMode = FALSE;
Conf_MaxConnections = -1; Conf_MaxConnections = -1;
Conf_MaxConnectionsIP = 5;
Conf_MaxJoins = 10; Conf_MaxJoins = 10;
/* Initialize server configuration structures */ /* Initialize server configuration structures */
@@ -689,6 +694,16 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
Conf_MaxConnections = atol( Arg ); Conf_MaxConnections = atol( Arg );
return; return;
} }
if( strcasecmp( Var, "MaxConnectionsIP" ) == 0 )
{
/* Maximum number of simoultanous connections from one IP. Values <= 0 are equal to "no limit". */
#ifdef HAVE_ISDIGIT
if( ! isdigit( *Arg )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"MaxConnectionsIP\" is not a number!", NGIRCd_ConfFile, Line );
else
#endif
Conf_MaxConnectionsIP = atoi( Arg );
return;
}
if( strcasecmp( Var, "MaxJoins" ) == 0 ) if( strcasecmp( Var, "MaxJoins" ) == 0 )
{ {
/* Maximum number of channels a user can join. Values <= 0 are equal to "no limit". */ /* Maximum number of channels a user can join. Values <= 0 are equal to "no limit". */
@@ -699,6 +714,15 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
Conf_MaxJoins = atoi( Arg ); Conf_MaxJoins = atoi( Arg );
return; return;
} }
if( strcasecmp( Var, "Listen" ) == 0 )
{
/* IP-Address to bind sockets */
if( strlcpy( Conf_ListenAddress, Arg, sizeof( Conf_ListenAddress )) >= sizeof( Conf_ListenAddress ))
{
Config_Error( LOG_WARNING, "%s, line %d: Value of \"Listen\" too long!", NGIRCd_ConfFile, Line );
}
return;
}
Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var ); Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
} /* Handle_GLOBAL */ } /* Handle_GLOBAL */
@@ -830,7 +854,18 @@ Validate_Config( BOOLEAN Configtest )
if( ! Conf_ServerName[0] ) if( ! Conf_ServerName[0] )
{ {
/* No server name configured! */ /* No server name configured! */
Config_Error( LOG_ALERT, "No server name configured in \"%s\" ('ServerName')!", NGIRCd_ConfFile ); Config_Error( LOG_ALERT, "No server name configured in \"%s\" (section 'Global': 'Name')!", NGIRCd_ConfFile );
if( ! Configtest )
{
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
}
if( Conf_ServerName[0] && ! strchr( Conf_ServerName, '.' ))
{
/* No dot in server name! */
Config_Error( LOG_ALERT, "Invalid server name configured in \"%s\" (section 'Global': 'Name'): Dot missing!", NGIRCd_ConfFile );
if( ! Configtest ) if( ! Configtest )
{ {
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME ); Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );

View File

@@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: conf.h,v 1.26 2002/12/31 16:12:50 alex Exp $ * $Id: conf.h,v 1.26.2.1 2003/11/07 20:51:11 alex Exp $
* *
* Configuration management (header) * Configuration management (header)
*/ */
@@ -76,6 +76,9 @@ GLOBAL CHAR Conf_MotdFile[FNAME_LEN];
GLOBAL UINT Conf_ListenPorts[MAX_LISTEN_PORTS]; GLOBAL UINT Conf_ListenPorts[MAX_LISTEN_PORTS];
GLOBAL INT Conf_ListenPorts_Count; GLOBAL INT Conf_ListenPorts_Count;
/* Address to which the socket should be bound or empty (=all) */
GLOBAL CHAR Conf_ListenAddress[16];
/* User and group ID the server should run with */ /* User and group ID the server should run with */
GLOBAL UINT Conf_UID; GLOBAL UINT Conf_UID;
GLOBAL UINT Conf_GID; GLOBAL UINT Conf_GID;
@@ -107,6 +110,9 @@ GLOBAL LONG Conf_MaxConnections;
/* Maximum number of channels a user can join */ /* Maximum number of channels a user can join */
GLOBAL INT Conf_MaxJoins; GLOBAL INT Conf_MaxJoins;
/* Maximum number of connections per IP address */
GLOBAL INT Conf_MaxConnectionsIP;
GLOBAL VOID Conf_Init PARAMS((VOID )); GLOBAL VOID Conf_Init PARAMS((VOID ));
GLOBAL VOID Conf_Rehash PARAMS((VOID )); GLOBAL VOID Conf_Rehash PARAMS((VOID ));

View File

@@ -16,10 +16,11 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: conn-func.c,v 1.1 2002/12/30 17:14:28 alex Exp $"; static char UNUSED id[] = "$Id: conn-func.c,v 1.1.2.2 2003/12/26 16:16:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
#include <log.h>
#include "conn.h" #include "conn.h"
@@ -69,7 +70,7 @@ Conn_SetPenalty( CONN_ID Idx, time_t Seconds )
assert( Idx > NONE ); assert( Idx > NONE );
assert( Seconds >= 0 ); assert( Seconds >= 0 );
t = time( NULL ) + Seconds; t = time( NULL ) + Seconds;
if( t > My_Connections[Idx].delaytime ) My_Connections[Idx].delaytime = t; if( t > My_Connections[Idx].delaytime ) My_Connections[Idx].delaytime = t;
} /* Conn_SetPenalty */ } /* Conn_SetPenalty */
@@ -197,7 +198,7 @@ Conn_SendQ( CONN_ID Idx )
/* Laenge der Daten im Schreibbuffer liefern */ /* Laenge der Daten im Schreibbuffer liefern */
assert( Idx > NONE ); assert( Idx > NONE );
#ifdef USE_ZLIB #ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) return My_Connections[Idx].zip.wdatalen; if( My_Connections[Idx].options & CONN_ZIP ) return My_Connections[Idx].zip.wdatalen;
else else
#endif #endif
@@ -231,7 +232,7 @@ Conn_RecvQ( CONN_ID Idx )
/* Laenge der Daten im Lesebuffer liefern */ /* Laenge der Daten im Lesebuffer liefern */
assert( Idx > NONE ); assert( Idx > NONE );
#ifdef USE_ZLIB #ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) return My_Connections[Idx].zip.rdatalen; if( My_Connections[Idx].options & CONN_ZIP ) return My_Connections[Idx].zip.rdatalen;
else else
#endif #endif

View File

@@ -17,9 +17,9 @@
#define CONN_MODULE #define CONN_MODULE
#ifdef USE_ZLIB #ifdef ZLIB
static char UNUSED id[] = "$Id: conn-zip.c,v 1.3 2003/04/21 10:52:26 alex Exp $"; static char UNUSED id[] = "$Id: conn-zip.c,v 1.3.2.1 2003/12/26 16:16:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>

View File

@@ -8,13 +8,13 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: conn-zip.h,v 1.1 2002/12/30 16:07:23 alex Exp $ * $Id: conn-zip.h,v 1.1.2.1 2003/12/26 16:16:48 alex Exp $
* *
* Connection compression using ZLIB (header) * Connection compression using ZLIB (header)
*/ */
#ifdef USE_ZLIB #ifdef ZLIB
#ifndef __conn_zip_h__ #ifndef __conn_zip_h__
#define __conn_zip_h__ #define __conn_zip_h__
@@ -32,7 +32,7 @@ GLOBAL LONG Zip_RecvBytes PARAMS(( CONN_ID Idx ));
#endif /* __conn_zip_h__ */ #endif /* __conn_zip_h__ */
#endif /* USE_ZLIB */ #endif /* ZLIB */
/* -eof- */ /* -eof- */

View File

@@ -16,7 +16,7 @@
#include "portab.h" #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.4 2004/02/03 13:54:36 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -43,7 +43,7 @@ static char UNUSED id[] = "$Id: conn.c,v 1.122 2003/04/21 10:52:26 alex Exp $";
#include <stdint.h> /* e.g. for Mac OS X */ #include <stdint.h> /* e.g. for Mac OS X */
#endif #endif
#ifdef USE_TCPWRAP #ifdef TCPWRAP
#include <tcpd.h> /* for TCP Wrappers */ #include <tcpd.h> /* for TCP Wrappers */
#endif #endif
@@ -87,12 +87,13 @@ LOCAL BOOLEAN Init_Socket PARAMS(( INT Sock ));
LOCAL VOID New_Server PARAMS(( INT Server, CONN_ID Idx )); LOCAL VOID New_Server PARAMS(( INT Server, CONN_ID Idx ));
LOCAL VOID Read_Resolver_Result PARAMS(( INT r_fd )); LOCAL VOID Read_Resolver_Result PARAMS(( INT r_fd ));
LOCAL VOID Simple_Message PARAMS(( INT Sock, CHAR *Msg )); LOCAL VOID Simple_Message PARAMS(( INT Sock, CHAR *Msg ));
LOCAL INT Count_Connections PARAMS(( struct sockaddr_in addr ));
LOCAL fd_set My_Listeners; LOCAL fd_set My_Listeners;
LOCAL fd_set My_Sockets; LOCAL fd_set My_Sockets;
LOCAL fd_set My_Connects; LOCAL fd_set My_Connects;
#ifdef USE_TCPWRAP #ifdef TCPWRAP
INT allow_severity = LOG_INFO; INT allow_severity = LOG_INFO;
INT deny_severity = LOG_ERR; INT deny_severity = LOG_ERR;
#endif #endif
@@ -119,7 +120,9 @@ Conn_Init( VOID )
Log( LOG_EMERG, "Can't allocate memory! [Conn_Init]" ); Log( LOG_EMERG, "Can't allocate memory! [Conn_Init]" );
exit( 1 ); exit( 1 );
} }
Log( LOG_DEBUG, "Allocted connection pool for %d items (%ld bytes).", Pool_Size, sizeof( CONNECTION ) * Pool_Size ); #ifdef DEBUG
Log( LOG_DEBUG, "Allocated connection pool for %d items (%ld bytes).", Pool_Size, sizeof( CONNECTION ) * Pool_Size );
#endif
/* zu Beginn haben wir keine Verbindungen */ /* zu Beginn haben wir keine Verbindungen */
FD_ZERO( &My_Listeners ); FD_ZERO( &My_Listeners );
@@ -146,12 +149,14 @@ Conn_Exit( VOID )
CONN_ID idx; CONN_ID idx;
INT i; INT i;
#ifdef DEBUG
Log( LOG_DEBUG, "Shutting down all connections ..." ); Log( LOG_DEBUG, "Shutting down all connections ..." );
#endif
#ifdef RENDEZVOUS #ifdef RENDEZVOUS
Rendezvous_UnregisterListeners( ); Rendezvous_UnregisterListeners( );
#endif #endif
/* Sockets schliessen */ /* Sockets schliessen */
for( i = 0; i < Conn_MaxFD + 1; i++ ) for( i = 0; i < Conn_MaxFD + 1; i++ )
{ {
@@ -164,12 +169,16 @@ Conn_Exit( VOID )
if( FD_ISSET( i, &My_Listeners )) if( FD_ISSET( i, &My_Listeners ))
{ {
close( i ); close( i );
#ifdef DEBUG
Log( LOG_DEBUG, "Listening socket %d closed.", i ); Log( LOG_DEBUG, "Listening socket %d closed.", i );
#endif
} }
else if( FD_ISSET( i, &My_Connects )) else if( FD_ISSET( i, &My_Connects ))
{ {
close( i ); close( i );
#ifdef DEBUG
Log( LOG_DEBUG, "Connection %d closed during creation (socket %d).", idx, i ); Log( LOG_DEBUG, "Connection %d closed during creation (socket %d).", idx, i );
#endif
} }
else if( idx < Pool_Size ) else if( idx < Pool_Size )
{ {
@@ -183,7 +192,7 @@ Conn_Exit( VOID )
} }
} }
} }
free( My_Connections ); free( My_Connections );
My_Connections = NULL; My_Connections = NULL;
Pool_Size = 0; Pool_Size = 0;
@@ -217,14 +226,16 @@ Conn_ExitListeners( VOID )
#ifdef RENDEZVOUS #ifdef RENDEZVOUS
Rendezvous_UnregisterListeners( ); Rendezvous_UnregisterListeners( );
#endif #endif
Log( LOG_INFO, "Shutting down all listening sockets ..." ); Log( LOG_INFO, "Shutting down all listening sockets ..." );
for( i = 0; i < Conn_MaxFD + 1; i++ ) for( i = 0; i < Conn_MaxFD + 1; i++ )
{ {
if( FD_ISSET( i, &My_Sockets ) && FD_ISSET( i, &My_Listeners )) if( FD_ISSET( i, &My_Sockets ) && FD_ISSET( i, &My_Listeners ))
{ {
close( i ); close( i );
#ifdef DEBUG
Log( LOG_DEBUG, "Listening socket %d closed.", i ); Log( LOG_DEBUG, "Listening socket %d closed.", i );
#endif
} }
} }
} /* Conn_ExitListeners */ } /* Conn_ExitListeners */
@@ -236,16 +247,32 @@ Conn_NewListener( CONST UINT Port )
/* Create new listening socket on specified port */ /* Create new listening socket on specified port */
struct sockaddr_in addr; struct sockaddr_in addr;
struct in_addr inaddr;
INT sock; INT sock;
#ifdef RENDEZVOUS #ifdef RENDEZVOUS
CHAR name[CLIENT_ID_LEN], *info; CHAR name[CLIENT_ID_LEN], *info;
#endif #endif
/* Server-"Listen"-Socket initialisieren */ /* Server-"Listen"-Socket initialisieren */
memset( &addr, 0, sizeof( addr )); memset( &addr, 0, sizeof( addr ));
memset( &inaddr, 0, sizeof( inaddr ));
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons( Port ); addr.sin_port = htons( Port );
addr.sin_addr.s_addr = htonl( INADDR_ANY ); if( Conf_ListenAddress[0] )
{
#ifdef HAVE_INET_ATON
if( inet_aton( Conf_ListenAddress, &inaddr ) == 0 )
#else
inaddr.s_addr = inet_addr( Conf_ListenAddress );
if( inaddr.s_addr == (unsigned)-1 )
#endif
{
Log( LOG_CRIT, "Can't listen on %s:%u: can't convert ip address %s!", Conf_ListenAddress, Port, Conf_ListenAddress );
return FALSE;
}
}
else inaddr.s_addr = htonl( INADDR_ANY );
addr.sin_addr = inaddr;
/* Socket erzeugen */ /* Socket erzeugen */
sock = socket( PF_INET, SOCK_STREAM, 0); sock = socket( PF_INET, SOCK_STREAM, 0);
@@ -279,7 +306,8 @@ Conn_NewListener( CONST UINT Port )
if( sock > Conn_MaxFD ) Conn_MaxFD = sock; if( sock > Conn_MaxFD ) Conn_MaxFD = sock;
Log( LOG_INFO, "Now listening on port %d (socket %d).", Port, sock ); if( Conf_ListenAddress[0]) Log( LOG_INFO, "Now listening on %s:%d (socket %d).", Conf_ListenAddress, Port, sock );
else Log( LOG_INFO, "Now listening on 0.0.0.0:%d (socket %d).", Port, sock );
#ifdef RENDEZVOUS #ifdef RENDEZVOUS
/* Get best server description text */ /* Get best server description text */
@@ -350,10 +378,13 @@ Conn_Handler( VOID )
Check_Servers( ); Check_Servers( );
Check_Connections( ); Check_Connections( );
t = time( NULL );
/* noch volle Lese-Buffer suchen */ /* noch volle Lese-Buffer suchen */
for( i = 0; i < Pool_Size; i++ ) for( i = 0; i < Pool_Size; i++ )
{ {
if(( My_Connections[i].sock > NONE ) && ( My_Connections[i].rdatalen > 0 )) if(( My_Connections[i].sock > NONE ) && ( My_Connections[i].rdatalen > 0 ) &&
( My_Connections[i].delaytime < t ))
{ {
/* Kann aus dem Buffer noch ein Befehl extrahiert werden? */ /* Kann aus dem Buffer noch ein Befehl extrahiert werden? */
if( Handle_Buffer( i )) timeout = FALSE; if( Handle_Buffer( i )) timeout = FALSE;
@@ -364,7 +395,7 @@ Conn_Handler( VOID )
FD_ZERO( &write_sockets ); FD_ZERO( &write_sockets );
for( i = 0; i < Pool_Size; i++ ) for( i = 0; i < Pool_Size; i++ )
{ {
#ifdef USE_ZLIB #ifdef ZLIB
if(( My_Connections[i].sock > NONE ) && (( My_Connections[i].wdatalen > 0 ) || ( My_Connections[i].zip.wdatalen > 0 ))) if(( My_Connections[i].sock > NONE ) && (( My_Connections[i].wdatalen > 0 ) || ( My_Connections[i].zip.wdatalen > 0 )))
#else #else
if(( My_Connections[i].sock > NONE ) && ( My_Connections[i].wdatalen > 0 )) if(( My_Connections[i].sock > NONE ) && ( My_Connections[i].wdatalen > 0 ))
@@ -382,7 +413,6 @@ Conn_Handler( VOID )
} }
/* von welchen Sockets koennte gelesen werden? */ /* von welchen Sockets koennte gelesen werden? */
t = time( NULL );
read_sockets = My_Sockets; read_sockets = My_Sockets;
for( i = 0; i < Pool_Size; i++ ) for( i = 0; i < Pool_Size; i++ )
{ {
@@ -413,9 +443,9 @@ Conn_Handler( VOID )
/* Timeout initialisieren */ /* Timeout initialisieren */
tv.tv_usec = 0; tv.tv_usec = 0;
if( timeout ) tv.tv_sec = TIME_RES; if( timeout ) tv.tv_sec = 1;
else tv.tv_sec = 0; else tv.tv_sec = 0;
/* Auf Aktivitaet warten */ /* Auf Aktivitaet warten */
i = select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv ); i = select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv );
if( i == 0 ) if( i == 0 )
@@ -443,7 +473,7 @@ Conn_Handler( VOID )
/* Es kann geschrieben werden ... */ /* Es kann geschrieben werden ... */
idx = Socket2Index( i ); idx = Socket2Index( i );
if( idx == NONE ) continue; if( idx == NONE ) continue;
if( ! Handle_Write( idx )) if( ! Handle_Write( idx ))
{ {
/* Fehler beim Schreiben! Diesen Socket nun /* Fehler beim Schreiben! Diesen Socket nun
@@ -527,7 +557,9 @@ Conn_Write( CONN_ID Idx, CHAR *Data, INT Len )
* In diesem Fall wird hier einfach ein Fehler geliefert. */ * In diesem Fall wird hier einfach ein Fehler geliefert. */
if( My_Connections[Idx].sock <= NONE ) if( My_Connections[Idx].sock <= NONE )
{ {
#ifdef DEBUG
Log( LOG_DEBUG, "Skipped write on closed socket (connection %d).", Idx ); Log( LOG_DEBUG, "Skipped write on closed socket (connection %d).", Idx );
#endif
return FALSE; return FALSE;
} }
@@ -549,7 +581,7 @@ Conn_Write( CONN_ID Idx, CHAR *Data, INT Len )
} }
} }
#ifdef USE_ZLIB #ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) if( My_Connections[Idx].options & CONN_ZIP )
{ {
/* Daten komprimieren und in Puffer kopieren */ /* Daten komprimieren und in Puffer kopieren */
@@ -579,7 +611,7 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
CLIENT *c; CLIENT *c;
DOUBLE in_k, out_k; DOUBLE in_k, out_k;
#ifdef USE_ZLIB #ifdef ZLIB
DOUBLE in_z_k, out_z_k; DOUBLE in_z_k, out_z_k;
INT in_p, out_p; INT in_p, out_p;
#endif #endif
@@ -641,7 +673,7 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
/* Calculate statistics and log information */ /* Calculate statistics and log information */
in_k = (DOUBLE)My_Connections[Idx].bytes_in / 1024; in_k = (DOUBLE)My_Connections[Idx].bytes_in / 1024;
out_k = (DOUBLE)My_Connections[Idx].bytes_out / 1024; out_k = (DOUBLE)My_Connections[Idx].bytes_out / 1024;
#ifdef USE_ZLIB #ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) if( My_Connections[Idx].options & CONN_ZIP )
{ {
in_z_k = (DOUBLE)My_Connections[Idx].zip.bytes_in / 1024; in_z_k = (DOUBLE)My_Connections[Idx].zip.bytes_in / 1024;
@@ -669,7 +701,7 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
/* Servers: Modify time of next connect attempt? */ /* Servers: Modify time of next connect attempt? */
Conf_UnsetServer( Idx ); Conf_UnsetServer( Idx );
#ifdef USE_ZLIB #ifdef ZLIB
/* Clean up zlib, if link was compressed */ /* Clean up zlib, if link was compressed */
if( Conn_Options( Idx ) & CONN_ZIP ) if( Conn_Options( Idx ) & CONN_ZIP )
{ {
@@ -730,7 +762,7 @@ Try_Write( CONN_ID Idx )
assert( My_Connections[Idx].sock > NONE ); assert( My_Connections[Idx].sock > NONE );
/* sind ueberhaupt Daten vorhanden? */ /* sind ueberhaupt Daten vorhanden? */
#ifdef USE_ZLIB #ifdef ZLIB
if(( ! My_Connections[Idx].wdatalen > 0 ) && ( ! My_Connections[Idx].zip.wdatalen )) return TRUE; if(( ! My_Connections[Idx].wdatalen > 0 ) && ( ! My_Connections[Idx].zip.wdatalen )) return TRUE;
#else #else
if( ! My_Connections[Idx].wdatalen > 0 ) return TRUE; if( ! My_Connections[Idx].wdatalen > 0 ) return TRUE;
@@ -836,14 +868,16 @@ Handle_Write( CONN_ID Idx )
return FALSE; return FALSE;
} }
#ifdef DEBUG
Log( LOG_DEBUG, "Connection %d with \"%s:%d\" established, now sendig PASS and SERVER ...", Idx, My_Connections[Idx].host, Conf_Server[Conf_GetServer( Idx )].port ); Log( LOG_DEBUG, "Connection %d with \"%s:%d\" established, now sendig PASS and SERVER ...", Idx, My_Connections[Idx].host, Conf_Server[Conf_GetServer( Idx )].port );
#endif
/* PASS und SERVER verschicken */ /* PASS und SERVER verschicken */
Conn_WriteStr( Idx, "PASS %s %s", Conf_Server[Conf_GetServer( Idx )].pwd_out, NGIRCd_ProtoID ); Conn_WriteStr( Idx, "PASS %s %s", Conf_Server[Conf_GetServer( Idx )].pwd_out, NGIRCd_ProtoID );
return Conn_WriteStr( Idx, "SERVER %s :%s", Conf_ServerName, Conf_ServerInfo ); return Conn_WriteStr( Idx, "SERVER %s :%s", Conf_ServerName, Conf_ServerInfo );
} }
#ifdef USE_ZLIB #ifdef ZLIB
/* Schreibpuffer leer, aber noch Daten im Kompressionsbuffer? /* Schreibpuffer leer, aber noch Daten im Kompressionsbuffer?
* Dann muss dieser nun geflushed werden! */ * Dann muss dieser nun geflushed werden! */
if( My_Connections[Idx].wdatalen == 0 ) Zip_Flush( Idx ); if( My_Connections[Idx].wdatalen == 0 ) Zip_Flush( Idx );
@@ -878,7 +912,7 @@ New_Connection( INT Sock )
/* Neue Client-Verbindung von Listen-Socket annehmen und /* Neue Client-Verbindung von Listen-Socket annehmen und
* CLIENT-Struktur anlegen. */ * CLIENT-Struktur anlegen. */
#ifdef USE_TCPWRAP #ifdef TCPWRAP
struct request_info req; struct request_info req;
#endif #endif
struct sockaddr_in new_addr; struct sockaddr_in new_addr;
@@ -887,7 +921,7 @@ New_Connection( INT Sock )
CONN_ID idx; CONN_ID idx;
CLIENT *c; CLIENT *c;
POINTER *ptr; POINTER *ptr;
LONG new_size; LONG new_size, cnt;
assert( Sock > NONE ); assert( Sock > NONE );
@@ -899,10 +933,11 @@ New_Connection( INT Sock )
Log( LOG_CRIT, "Can't accept connection: %s!", strerror( errno )); Log( LOG_CRIT, "Can't accept connection: %s!", strerror( errno ));
return; return;
} }
#ifdef USE_TCPWRAP #ifdef TCPWRAP
/* Validate socket using TCP Wrappers */ /* Validate socket using TCP Wrappers */
request_init( &req, RQ_DAEMON, PACKAGE_NAME, RQ_FILE, new_sock, RQ_CLIENT_SIN, &new_addr, NULL ); request_init( &req, RQ_DAEMON, PACKAGE_NAME, RQ_FILE, new_sock, RQ_CLIENT_SIN, &new_addr, NULL );
fromhost(&req);
if( ! hosts_access( &req )) if( ! hosts_access( &req ))
{ {
/* Access denied! */ /* Access denied! */
@@ -915,16 +950,27 @@ New_Connection( INT Sock )
/* Socket initialisieren */ /* Socket initialisieren */
Init_Socket( new_sock ); Init_Socket( new_sock );
/* Check IP-based connection limit */
cnt = Count_Connections( new_addr );
if(( Conf_MaxConnectionsIP > 0 ) && ( cnt >= Conf_MaxConnectionsIP ))
{
/* Access denied, too many connections from this IP! */
Log( LOG_ERR, "Refused connection from %s: too may connections (%ld) from this IP!", inet_ntoa( new_addr.sin_addr ), cnt);
Simple_Message( new_sock, "ERROR :Connection refused, too many connections from your IP!" );
close( new_sock );
return;
}
/* Freie Connection-Struktur suchen */ /* Freie Connection-Struktur suchen */
for( idx = 0; idx < Pool_Size; idx++ ) if( My_Connections[idx].sock == NONE ) break; for( idx = 0; idx < Pool_Size; idx++ ) if( My_Connections[idx].sock == NONE ) break;
if( idx >= Pool_Size ) if( idx >= Pool_Size )
{ {
new_size = Pool_Size + CONNECTION_POOL; new_size = Pool_Size + CONNECTION_POOL;
/* Im bisherigen Pool wurde keine freie Connection-Struktur mehr gefunden. /* Im bisherigen Pool wurde keine freie Connection-Struktur mehr gefunden.
* Wenn erlaubt und moeglich muss nun der Pool vergroessert werden: */ * Wenn erlaubt und moeglich muss nun der Pool vergroessert werden: */
if( Conf_MaxConnections > 0 ) if( Conf_MaxConnections > 0 )
{ {
/* Es ist ein Limit konfiguriert */ /* Es ist ein Limit konfiguriert */
@@ -945,7 +991,7 @@ New_Connection( INT Sock )
close( new_sock ); close( new_sock );
return; return;
} }
/* zunaechst realloc() versuchen; wenn das scheitert, malloc() versuchen /* zunaechst realloc() versuchen; wenn das scheitert, malloc() versuchen
* und Daten ggf. "haendisch" umkopieren. (Haesslich! Eine wirklich * und Daten ggf. "haendisch" umkopieren. (Haesslich! Eine wirklich
* dynamische Verwaltung waere wohl _deutlich_ besser ...) */ * dynamische Verwaltung waere wohl _deutlich_ besser ...) */
@@ -962,21 +1008,25 @@ New_Connection( INT Sock )
close( new_sock ); close( new_sock );
return; return;
} }
/* Struktur umkopieren ... */ /* Struktur umkopieren ... */
memcpy( ptr, My_Connections, sizeof( CONNECTION ) * Pool_Size ); memcpy( ptr, My_Connections, sizeof( CONNECTION ) * Pool_Size );
#ifdef DEBUG
Log( LOG_DEBUG, "Allocated new connection pool for %ld items (%ld bytes). [malloc()/memcpy()]", new_size, sizeof( CONNECTION ) * new_size ); Log( LOG_DEBUG, "Allocated new connection pool for %ld items (%ld bytes). [malloc()/memcpy()]", new_size, sizeof( CONNECTION ) * new_size );
#endif
} }
#ifdef DEBUG
else Log( LOG_DEBUG, "Allocated new connection pool for %ld items (%ld bytes). [realloc()]", 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 );
#endif
/* Adjust pointer to new block */ /* Adjust pointer to new block */
My_Connections = ptr; My_Connections = ptr;
/* Initialize new items */ /* Initialize new items */
for( idx = Pool_Size; idx < new_size; idx++ ) Init_Conn_Struct( idx ); for( idx = Pool_Size; idx < new_size; idx++ ) Init_Conn_Struct( idx );
idx = Pool_Size; idx = Pool_Size;
/* Adjust new pool size */ /* Adjust new pool size */
Pool_Size = new_size; Pool_Size = new_size;
} }
@@ -1011,7 +1061,7 @@ New_Connection( INT Sock )
/* Sub-Prozess wurde asyncron gestartet */ /* Sub-Prozess wurde asyncron gestartet */
My_Connections[idx].res_stat = s; My_Connections[idx].res_stat = s;
} }
/* Penalty-Zeit setzen */ /* Penalty-Zeit setzen */
Conn_SetPenalty( idx, 4 ); Conn_SetPenalty( idx, 4 );
} /* New_Connection */ } /* New_Connection */
@@ -1032,7 +1082,9 @@ Socket2Index( INT Sock )
{ {
/* die Connection wurde vermutlich (wegen eines /* die Connection wurde vermutlich (wegen eines
* Fehlers) bereits wieder abgebaut ... */ * Fehlers) bereits wieder abgebaut ... */
#ifdef DEBUG
Log( LOG_DEBUG, "Socket2Index: can't get connection for socket %d!", Sock ); Log( LOG_DEBUG, "Socket2Index: can't get connection for socket %d!", Sock );
#endif
return NONE; return NONE;
} }
else return idx; else return idx;
@@ -1046,7 +1098,7 @@ Read_Request( CONN_ID Idx )
* Tritt ein Fehler auf, so wird der Socket geschlossen. */ * Tritt ein Fehler auf, so wird der Socket geschlossen. */
INT len, bsize; INT len, bsize;
#ifdef USE_ZLIB #ifdef ZLIB
CLIENT *c; CLIENT *c;
#endif #endif
@@ -1056,12 +1108,12 @@ Read_Request( CONN_ID Idx )
/* wenn noch nicht registriert: maximal mit ZREADBUFFER_LEN arbeiten, /* wenn noch nicht registriert: maximal mit ZREADBUFFER_LEN arbeiten,
* ansonsten koennen Daten ggf. nicht umkopiert werden. */ * ansonsten koennen Daten ggf. nicht umkopiert werden. */
bsize = READBUFFER_LEN; bsize = READBUFFER_LEN;
#ifdef USE_ZLIB #ifdef ZLIB
c = Client_GetFromConn( Idx ); c = Client_GetFromConn( Idx );
if(( Client_Type( c ) != CLIENT_USER ) && ( Client_Type( c ) != CLIENT_SERVER ) && ( Client_Type( c ) != CLIENT_SERVICE ) && ( bsize > ZREADBUFFER_LEN )) bsize = ZREADBUFFER_LEN; if(( Client_Type( c ) != CLIENT_USER ) && ( Client_Type( c ) != CLIENT_SERVER ) && ( Client_Type( c ) != CLIENT_SERVICE ) && ( bsize > ZREADBUFFER_LEN )) bsize = ZREADBUFFER_LEN;
#endif #endif
#ifdef USE_ZLIB #ifdef ZLIB
if(( bsize - My_Connections[Idx].rdatalen - 1 < 1 ) || ( ZREADBUFFER_LEN - My_Connections[Idx].zip.rdatalen < 1 )) if(( bsize - My_Connections[Idx].rdatalen - 1 < 1 ) || ( ZREADBUFFER_LEN - My_Connections[Idx].zip.rdatalen < 1 ))
#else #else
if( bsize - My_Connections[Idx].rdatalen - 1 < 1 ) if( bsize - My_Connections[Idx].rdatalen - 1 < 1 )
@@ -1073,7 +1125,7 @@ Read_Request( CONN_ID Idx )
return; return;
} }
#ifdef USE_ZLIB #ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) if( My_Connections[Idx].options & CONN_ZIP )
{ {
len = recv( My_Connections[Idx].sock, My_Connections[Idx].zip.rbuf + My_Connections[Idx].zip.rdatalen, ( ZREADBUFFER_LEN - My_Connections[Idx].zip.rdatalen ), 0 ); len = recv( My_Connections[Idx].sock, My_Connections[Idx].zip.rbuf + My_Connections[Idx].zip.rdatalen, ( ZREADBUFFER_LEN - My_Connections[Idx].zip.rdatalen ), 0 );
@@ -1128,28 +1180,31 @@ Handle_Buffer( CONN_ID Idx )
CHAR *ptr; CHAR *ptr;
INT len, delta; INT len, delta;
BOOLEAN action, result; BOOLEAN action, result;
#ifdef USE_ZLIB #ifdef ZLIB
BOOLEAN old_z; BOOLEAN old_z;
#endif #endif
result = FALSE; result = FALSE;
do do
{ {
#ifdef USE_ZLIB /* Check penalty */
if( My_Connections[Idx].delaytime > time( NULL )) return result;
#ifdef ZLIB
/* ggf. noch unkomprimiete Daten weiter entpacken */ /* ggf. noch unkomprimiete Daten weiter entpacken */
if( My_Connections[Idx].options & CONN_ZIP ) if( My_Connections[Idx].options & CONN_ZIP )
{ {
if( ! Unzip_Buffer( Idx )) return FALSE; if( ! Unzip_Buffer( Idx )) return FALSE;
} }
#endif #endif
if( My_Connections[Idx].rdatalen < 1 ) break; if( My_Connections[Idx].rdatalen < 1 ) break;
/* Eine komplette Anfrage muss mit CR+LF enden, vgl. /* Eine komplette Anfrage muss mit CR+LF enden, vgl.
* RFC 2812. Haben wir eine? */ * RFC 2812. Haben wir eine? */
My_Connections[Idx].rbuf[My_Connections[Idx].rdatalen] = '\0'; My_Connections[Idx].rbuf[My_Connections[Idx].rdatalen] = '\0';
ptr = strstr( My_Connections[Idx].rbuf, "\r\n" ); ptr = strstr( My_Connections[Idx].rbuf, "\r\n" );
if( ptr ) delta = 2; if( ptr ) delta = 2;
#ifndef STRICT_RFC #ifndef STRICT_RFC
else else
@@ -1164,7 +1219,7 @@ Handle_Buffer( CONN_ID Idx )
else if( ptr2 ) ptr = ptr2; else if( ptr2 ) ptr = ptr2;
} }
#endif #endif
action = FALSE; action = FALSE;
if( ptr ) if( ptr )
{ {
@@ -1181,7 +1236,7 @@ Handle_Buffer( CONN_ID Idx )
return FALSE; return FALSE;
} }
#ifdef USE_ZLIB #ifdef ZLIB
/* merken, ob Stream bereits komprimiert wird */ /* merken, ob Stream bereits komprimiert wird */
old_z = My_Connections[Idx].options & CONN_ZIP; old_z = My_Connections[Idx].options & CONN_ZIP;
#endif #endif
@@ -1198,7 +1253,7 @@ Handle_Buffer( CONN_ID Idx )
My_Connections[Idx].rdatalen -= len; My_Connections[Idx].rdatalen -= len;
memmove( My_Connections[Idx].rbuf, My_Connections[Idx].rbuf + len, My_Connections[Idx].rdatalen ); memmove( My_Connections[Idx].rbuf, My_Connections[Idx].rbuf + len, My_Connections[Idx].rdatalen );
#ifdef USE_ZLIB #ifdef ZLIB
if(( ! old_z ) && ( My_Connections[Idx].options & CONN_ZIP ) && ( My_Connections[Idx].rdatalen > 0 )) if(( ! old_z ) && ( My_Connections[Idx].options & CONN_ZIP ) && ( My_Connections[Idx].rdatalen > 0 ))
{ {
/* Mit dem letzten Befehl wurde Socket-Kompression aktiviert. /* Mit dem letzten Befehl wurde Socket-Kompression aktiviert.
@@ -1214,15 +1269,17 @@ Handle_Buffer( CONN_ID Idx )
memcpy( My_Connections[Idx].zip.rbuf, My_Connections[Idx].rbuf, My_Connections[Idx].rdatalen ); 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].zip.rdatalen = My_Connections[Idx].rdatalen;
My_Connections[Idx].rdatalen = 0; My_Connections[Idx].rdatalen = 0;
#ifdef DEBUG
Log( LOG_DEBUG, "Moved already received data (%d bytes) to uncompression buffer.", My_Connections[Idx].zip.rdatalen ); Log( LOG_DEBUG, "Moved already received data (%d bytes) to uncompression buffer.", My_Connections[Idx].zip.rdatalen );
#endif
} }
} }
#endif #endif
} }
if( action ) result = TRUE; if( action ) result = TRUE;
} while( action ); } while( action );
return result; return result;
} /* Handle_Buffer */ } /* Handle_Buffer */
@@ -1251,14 +1308,18 @@ Check_Connections( VOID )
if( My_Connections[i].lastping < time( NULL ) - Conf_PongTimeout ) if( My_Connections[i].lastping < time( NULL ) - Conf_PongTimeout )
{ {
/* Timeout */ /* Timeout */
#ifdef DEBUG
Log( LOG_DEBUG, "Connection %d: Ping timeout: %d seconds.", i, Conf_PongTimeout ); Log( LOG_DEBUG, "Connection %d: Ping timeout: %d seconds.", i, Conf_PongTimeout );
#endif
Conn_Close( i, NULL, "Ping timeout", TRUE ); Conn_Close( i, NULL, "Ping timeout", TRUE );
} }
} }
else if( My_Connections[i].lastdata < time( NULL ) - Conf_PingTimeout ) else if( My_Connections[i].lastdata < time( NULL ) - Conf_PingTimeout )
{ {
/* es muss ein PING gesendet werden */ /* es muss ein PING gesendet werden */
#ifdef DEBUG
Log( LOG_DEBUG, "Connection %d: sending PING ...", i ); Log( LOG_DEBUG, "Connection %d: sending PING ...", i );
#endif
My_Connections[i].lastping = time( NULL ); My_Connections[i].lastping = time( NULL );
Conn_WriteStr( i, "PING :%s", Client_ID( Client_ThisServer( ))); Conn_WriteStr( i, "PING :%s", Client_ID( Client_ThisServer( )));
} }
@@ -1269,7 +1330,9 @@ Check_Connections( VOID )
if( My_Connections[i].lastdata < time( NULL ) - Conf_PingTimeout ) if( My_Connections[i].lastdata < time( NULL ) - Conf_PingTimeout )
{ {
/* Timeout */ /* Timeout */
#ifdef DEBUG
Log( LOG_DEBUG, "Connection %d timed out ...", i ); Log( LOG_DEBUG, "Connection %d timed out ...", i );
#endif
Conn_Close( i, NULL, "Timeout", FALSE ); Conn_Close( i, NULL, "Timeout", FALSE );
} }
} }
@@ -1325,7 +1388,9 @@ Check_Servers( VOID )
Log( LOG_ALERT, "Can't establist server connection: connection limit reached (%d)!", Pool_Size ); Log( LOG_ALERT, "Can't establist server connection: connection limit reached (%d)!", Pool_Size );
return; return;
} }
#ifdef DEBUG
Log( LOG_DEBUG, "Preparing connection %d for \"%s\" ...", idx, Conf_Server[i].host ); Log( LOG_DEBUG, "Preparing connection %d for \"%s\" ...", idx, Conf_Server[i].host );
#endif
/* Verbindungs-Struktur initialisieren */ /* Verbindungs-Struktur initialisieren */
Init_Conn_Struct( idx ); Init_Conn_Struct( idx );
@@ -1348,7 +1413,7 @@ Check_Servers( VOID )
LOCAL VOID LOCAL VOID
New_Server( INT Server, CONN_ID Idx ) New_Server( INT Server, CONN_ID Idx )
{ {
/* Neue Server-Verbindung aufbauen */ /* Establish new server link */
struct sockaddr_in new_addr; struct sockaddr_in new_addr;
struct in_addr inaddr; struct in_addr inaddr;
@@ -1358,11 +1423,12 @@ New_Server( INT Server, CONN_ID Idx )
assert( Server > NONE ); assert( Server > NONE );
assert( Idx > NONE ); assert( Idx > NONE );
/* Wurde eine gueltige IP-Adresse gefunden? */ /* Did we get a valid IP address? */
if( ! Conf_Server[Server].ip[0] ) if( ! Conf_Server[Server].ip[0] )
{ {
/* Nein. Verbindung wieder freigeben: */ /* No. Free connection structure and abort: */
Init_Conn_Struct( Idx ); 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 ); Log( LOG_ERR, "Can't connect to \"%s\" (connection %d): ip address unknown!", Conf_Server[Server].host, Idx );
return; return;
} }
@@ -1377,8 +1443,9 @@ New_Server( INT Server, CONN_ID Idx )
if( inaddr.s_addr == (unsigned)-1 ) if( inaddr.s_addr == (unsigned)-1 )
#endif #endif
{ {
/* Konnte Adresse nicht konvertieren */ /* Can't convert IP address */
Init_Conn_Struct( Idx ); 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 ); 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; return;
} }
@@ -1391,7 +1458,9 @@ New_Server( INT Server, CONN_ID Idx )
new_sock = socket( PF_INET, SOCK_STREAM, 0 ); new_sock = socket( PF_INET, SOCK_STREAM, 0 );
if ( new_sock < 0 ) if ( new_sock < 0 )
{ {
/* Can't create socket */
Init_Conn_Struct( Idx ); Init_Conn_Struct( Idx );
Conf_Server[Server].conn_id = NONE;
Log( LOG_CRIT, "Can't create socket: %s!", strerror( errno )); Log( LOG_CRIT, "Can't create socket: %s!", strerror( errno ));
return; return;
} }
@@ -1401,9 +1470,11 @@ New_Server( INT Server, CONN_ID Idx )
res = connect( new_sock, (struct sockaddr *)&new_addr, sizeof( new_addr )); res = connect( new_sock, (struct sockaddr *)&new_addr, sizeof( new_addr ));
if(( res != 0 ) && ( errno != EINPROGRESS )) if(( res != 0 ) && ( errno != EINPROGRESS ))
{ {
/* Can't connect socket */
Log( LOG_CRIT, "Can't connect socket: %s!", strerror( errno )); Log( LOG_CRIT, "Can't connect socket: %s!", strerror( errno ));
close( new_sock ); close( new_sock );
Init_Conn_Struct( Idx ); Init_Conn_Struct( Idx );
Conf_Server[Server].conn_id = NONE;
return; return;
} }
@@ -1411,25 +1482,29 @@ New_Server( INT Server, CONN_ID Idx )
c = Client_NewLocal( Idx, inet_ntoa( new_addr.sin_addr ), CLIENT_UNKNOWNSERVER, FALSE ); c = Client_NewLocal( Idx, inet_ntoa( new_addr.sin_addr ), CLIENT_UNKNOWNSERVER, FALSE );
if( ! c ) if( ! c )
{ {
/* Can't create new client structure */
close( new_sock ); close( new_sock );
Init_Conn_Struct( Idx ); Init_Conn_Struct( Idx );
Conf_Server[Server].conn_id = NONE;
Log( LOG_ALERT, "Can't establish connection: can't create client structure!" ); Log( LOG_ALERT, "Can't establish connection: can't create client structure!" );
return; return;
} }
Client_SetIntroducer( c, c ); Client_SetIntroducer( c, c );
Client_SetToken( c, TOKEN_OUTBOUND ); Client_SetToken( c, TOKEN_OUTBOUND );
/* Verbindung registrieren */ /* Register connection */
My_Connections[Idx].sock = new_sock; My_Connections[Idx].sock = new_sock;
My_Connections[Idx].addr = new_addr; My_Connections[Idx].addr = new_addr;
strlcpy( My_Connections[Idx].host, Conf_Server[Server].host, sizeof( My_Connections[Idx].host )); 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_Sockets );
FD_SET( new_sock, &My_Connects ); FD_SET( new_sock, &My_Connects );
if( new_sock > Conn_MaxFD ) Conn_MaxFD = new_sock; if( new_sock > Conn_MaxFD ) Conn_MaxFD = new_sock;
#ifdef DEBUG
Log( LOG_DEBUG, "Registered new connection %d on socket %d.", Idx, My_Connections[Idx].sock ); Log( LOG_DEBUG, "Registered new connection %d on socket %d.", Idx, My_Connections[Idx].sock );
#endif
} /* New_Server */ } /* New_Server */
@@ -1457,7 +1532,7 @@ Init_Conn_Struct( CONN_ID Idx )
My_Connections[Idx].flag = 0; My_Connections[Idx].flag = 0;
My_Connections[Idx].options = 0; My_Connections[Idx].options = 0;
#ifdef USE_ZLIB #ifdef ZLIB
My_Connections[Idx].zip.rbuf[0] = '\0'; My_Connections[Idx].zip.rbuf[0] = '\0';
My_Connections[Idx].zip.rdatalen = 0; My_Connections[Idx].zip.rdatalen = 0;
My_Connections[Idx].zip.wbuf[0] = '\0'; My_Connections[Idx].zip.wbuf[0] = '\0';
@@ -1526,12 +1601,16 @@ Read_Resolver_Result( INT r_fd )
/* Opsa! Keine passende Connection gefunden!? Vermutlich /* Opsa! Keine passende Connection gefunden!? Vermutlich
* wurde sie schon wieder geschlossen. */ * wurde sie schon wieder geschlossen. */
close( r_fd ); close( r_fd );
#ifdef DEBUG
Log( LOG_DEBUG, "Resolver: Got result for unknown connection!?" ); Log( LOG_DEBUG, "Resolver: Got result for unknown connection!?" );
#endif
return; return;
} }
#ifdef DEBUG
Log( LOG_DEBUG, "Resolver: %s is \"%s\".", My_Connections[i].host, result ); Log( LOG_DEBUG, "Resolver: %s is \"%s\".", My_Connections[i].host, result );
#endif
/* Aufraeumen */ /* Aufraeumen */
close( My_Connections[i].res_stat->pipe[0] ); close( My_Connections[i].res_stat->pipe[0] );
close( My_Connections[i].res_stat->pipe[1] ); close( My_Connections[i].res_stat->pipe[1] );
@@ -1574,4 +1653,18 @@ Simple_Message( INT Sock, CHAR *Msg )
} /* Simple_Error */ } /* Simple_Error */
LOCAL INT
Count_Connections( struct sockaddr_in addr_in )
{
INT i, cnt;
cnt = 0;
for( i = 0; i < Pool_Size; i++ )
{
if(( My_Connections[i].sock > NONE ) && ( My_Connections[i].addr.sin_addr.s_addr == addr_in.sin_addr.s_addr )) cnt++;
}
return cnt;
} /* Count_Connections */
/* -eof- */ /* -eof- */

View File

@@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: conn.h,v 1.31 2003/03/27 01:20:22 alex Exp $ * $Id: conn.h,v 1.31.2.1 2003/12/26 16:16:48 alex Exp $
* *
* Connection management (header) * Connection management (header)
*/ */
@@ -23,7 +23,7 @@
#define CONN_ISCLOSING 1 /* Conn_Close() already called */ #define CONN_ISCLOSING 1 /* Conn_Close() already called */
#ifdef USE_ZLIB #ifdef ZLIB
#define CONN_ZIP 2 /* zlib compressed link */ #define CONN_ZIP 2 /* zlib compressed link */
#endif #endif
@@ -36,7 +36,7 @@ typedef INT CONN_ID;
#include "defines.h" #include "defines.h"
#include "resolve.h" #include "resolve.h"
#ifdef USE_ZLIB #ifdef ZLIB
#include <zlib.h> #include <zlib.h>
typedef struct _ZipData typedef struct _ZipData
{ {
@@ -48,7 +48,7 @@ typedef struct _ZipData
INT wdatalen; /* Length of data in write buffer (uncompressed) */ INT wdatalen; /* Length of data in write buffer (uncompressed) */
LONG bytes_in, bytes_out; /* Counter for statistics (uncompressed!) */ LONG bytes_in, bytes_out; /* Counter for statistics (uncompressed!) */
} ZIPDATA; } ZIPDATA;
#endif /* USE_ZLIB */ #endif /* ZLIB */
typedef struct _Connection typedef struct _Connection
{ {
@@ -69,9 +69,9 @@ typedef struct _Connection
LONG msg_in, msg_out; /* Received and sent IRC messages */ LONG msg_in, msg_out; /* Received and sent IRC messages */
INT flag; /* Flag (see "irc-write" module) */ INT flag; /* Flag (see "irc-write" module) */
INT options; /* Link options */ INT options; /* Link options */
#ifdef USE_ZLIB #ifdef ZLIB
ZIPDATA zip; /* Compression information */ ZIPDATA zip; /* Compression information */
#endif /* USE_ZLIB */ #endif /* ZLIB */
} CONNECTION; } CONNECTION;
GLOBAL CONNECTION *My_Connections; GLOBAL CONNECTION *My_Connections;

View File

@@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: defines.h,v 1.42 2003/02/23 12:03:39 alex Exp $ * $Id: defines.h,v 1.42.2.2 2003/12/26 16:16:48 alex Exp $
* *
* Global defines of ngIRCd. * Global defines of ngIRCd.
*/ */
@@ -19,8 +19,6 @@
#define NONE -1 #define NONE -1
#define TIME_RES 2 /* Zeit-Aufloesung des Servers in Sekunden */
#define FNAME_LEN 256 /* max. Laenge eines Dateinamen */ #define FNAME_LEN 256 /* max. Laenge eines Dateinamen */
#define LINE_LEN 256 /* max. Laenge einer Konfigurationszeile */ #define LINE_LEN 256 /* max. Laenge einer Konfigurationszeile */
@@ -59,7 +57,7 @@
#define READBUFFER_LEN 2048 /* Laenge des Lesepuffers je Verbindung (Bytes) */ #define READBUFFER_LEN 2048 /* Laenge des Lesepuffers je Verbindung (Bytes) */
#define WRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers je Verbindung (Bytes) */ #define WRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers je Verbindung (Bytes) */
#ifdef USE_ZLIB #ifdef ZLIB
#define ZREADBUFFER_LEN 1024 /* Laenge des Lesepuffers je Verbindung (Bytes) */ #define ZREADBUFFER_LEN 1024 /* Laenge des Lesepuffers je Verbindung (Bytes) */
#define ZWRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers fuer Kompression (Bytes) */ #define ZWRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers fuer Kompression (Bytes) */
#endif #endif

View File

@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.16 2003/04/21 10:54:30 alex Exp $"; static char UNUSED id[] = "$Id: irc-info.c,v 1.16.2.4 2003/12/26 16:16:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -23,6 +23,7 @@ static char UNUSED id[] = "$Id: irc-info.c,v 1.16 2003/04/21 10:54:30 alex Exp $
#include <string.h> #include <string.h>
#include "ngircd.h" #include "ngircd.h"
#include "cvs-version.h"
#include "conn-func.h" #include "conn-func.h"
#include "conn-zip.h" #include "conn-zip.h"
#include "client.h" #include "client.h"
@@ -76,6 +77,7 @@ IRC_ADMIN(CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( Client, RPL_ADMINLOC2_MSG, Client_ID( prefix ), Conf_ServerAdmin2 )) return DISCONNECTED; if( ! IRC_WriteStrClient( Client, RPL_ADMINLOC2_MSG, Client_ID( prefix ), Conf_ServerAdmin2 )) return DISCONNECTED;
if( ! IRC_WriteStrClient( Client, RPL_ADMINEMAIL_MSG, Client_ID( prefix ), Conf_ServerAdminMail )) return DISCONNECTED; if( ! IRC_WriteStrClient( Client, RPL_ADMINEMAIL_MSG, Client_ID( prefix ), Conf_ServerAdminMail )) return DISCONNECTED;
IRC_SetPenalty( Client, 1 );
return CONNECTED; return CONNECTED;
} /* IRC_ADMIN */ } /* IRC_ADMIN */
@@ -160,7 +162,8 @@ IRC_LINKS( CLIENT *Client, REQUEST *Req )
} }
c = Client_Next( c ); c = Client_Next( c );
} }
IRC_SetPenalty( target, 1 );
return IRC_WriteStrClient( target, RPL_ENDOFLINKS_MSG, Client_ID( target ), mask ); return IRC_WriteStrClient( target, RPL_ENDOFLINKS_MSG, Client_ID( target ), mask );
} /* IRC_LINKS */ } /* IRC_LINKS */
@@ -196,6 +199,7 @@ IRC_LUSERS( CLIENT *Client, REQUEST *Req )
IRC_Send_LUSERS( target ); IRC_Send_LUSERS( target );
IRC_SetPenalty( target, 1 );
return CONNECTED; return CONNECTED;
} /* IRC_LUSERS */ } /* IRC_LUSERS */
@@ -229,6 +233,7 @@ IRC_MOTD( CLIENT *Client, REQUEST *Req )
} }
} }
IRC_SetPenalty( from, 3 );
return IRC_Show_MOTD( from ); return IRC_Show_MOTD( from );
} /* IRC_MOTD */ } /* IRC_MOTD */
@@ -323,6 +328,7 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( from, "%s", rpl )) return DISCONNECTED; if( ! IRC_WriteStrClient( from, "%s", rpl )) return DISCONNECTED;
} }
IRC_SetPenalty( from, 1 );
return IRC_WriteStrClient( from, RPL_ENDOFNAMES_MSG, Client_ID( from ), "*" ); return IRC_WriteStrClient( from, RPL_ENDOFNAMES_MSG, Client_ID( from ), "*" );
} /* IRC_NAMES */ } /* IRC_NAMES */
@@ -373,7 +379,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
if( cl && (( Client_Type( cl ) == CLIENT_SERVER ) || ( cl == Client ))) if( cl && (( Client_Type( cl ) == CLIENT_SERVER ) || ( cl == Client )))
{ {
/* Server link or our own connection */ /* Server link or our own connection */
#ifdef USE_ZLIB #ifdef ZLIB
if( Conn_Options( con ) & CONN_ZIP ) if( Conn_Options( con ) & CONN_ZIP )
{ {
if( ! IRC_WriteStrClient( from, RPL_STATSLINKINFOZIP_MSG, Client_ID( from ), Client_Mask( cl ), Conn_SendQ( con ), Conn_SendMsg( con ), Zip_SendBytes( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Zip_RecvBytes( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED; if( ! IRC_WriteStrClient( from, RPL_STATSLINKINFOZIP_MSG, Client_ID( from ), Client_Mask( cl ), Conn_SendQ( con ), Conn_SendMsg( con ), Zip_SendBytes( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Zip_RecvBytes( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED;
@@ -401,6 +407,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
break; break;
} }
IRC_SetPenalty( from, 2 );
return IRC_WriteStrClient( from, RPL_ENDOFSTATS_MSG, Client_ID( from ), query ); return IRC_WriteStrClient( from, RPL_ENDOFSTATS_MSG, Client_ID( from ), query );
} /* IRC_STATS */ } /* IRC_STATS */
@@ -486,6 +493,9 @@ GLOBAL BOOLEAN
IRC_VERSION( CLIENT *Client, REQUEST *Req ) IRC_VERSION( CLIENT *Client, REQUEST *Req )
{ {
CLIENT *target, *prefix; CLIENT *target, *prefix;
#ifdef CVSDATE
CHAR ver[12], vertxt[30];
#endif
assert( Client != NULL ); assert( Client != NULL );
assert( Req != NULL ); assert( Req != NULL );
@@ -513,7 +523,16 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
} }
/* mit Versionsinfo antworten */ /* mit Versionsinfo antworten */
IRC_SetPenalty( Client, 1 );
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, vertxt, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
#else
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( )); return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
#endif
} /* IRC_VERSION */ } /* IRC_VERSION */

View File

@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-login.c,v 1.34 2003/03/31 15:54:21 alex Exp $"; static char UNUSED id[] = "$Id: irc-login.c,v 1.34.2.3 2004/02/04 20:04:54 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -34,6 +34,7 @@ static char UNUSED id[] = "$Id: irc-login.c,v 1.34 2003/03/31 15:54:21 alex Exp
#include "irc.h" #include "irc.h"
#include "irc-info.h" #include "irc-info.h"
#include "irc-write.h" #include "irc-write.h"
#include "cvs-version.h"
#include "exp.h" #include "exp.h"
#include "irc-login.h" #include "irc-login.h"
@@ -223,6 +224,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
/* neuen Client-Nick speichern */ /* neuen Client-Nick speichern */
Client_SetID( target, Req->argv[0] ); Client_SetID( target, Req->argv[0] );
IRC_SetPenalty( target, 2 );
} }
return CONNECTED; return CONNECTED;
@@ -292,11 +294,17 @@ IRC_USER( CLIENT *Client, REQUEST *Req )
if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS ) if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS )
#endif #endif
{ {
/* Falsche Anzahl Parameter? */ /* Wrong number of parameters? */
if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* User name */
Client_SetUser( Client, Req->argv[0], FALSE ); Client_SetUser( Client, Req->argv[0], FALSE );
Client_SetInfo( Client, Req->argv[3] );
/* "Real name" or user info text: Don't set it to the empty
* string, the original ircd can't deal with such "real names"
* (e. g. "USER user * * :") ... */
if( *Req->argv[3] ) Client_SetInfo( Client, Req->argv[3] );
else Client_SetInfo( Client, "-" );
Log( LOG_DEBUG, "Connection %d: got valid USER command ...", Client_Conn( Client )); Log( LOG_DEBUG, "Connection %d: got valid USER command ...", Client_Conn( Client ));
if( Client_Type( Client ) == CLIENT_GOTNICK ) return Hello_User( Client ); if( Client_Type( Client ) == CLIENT_GOTNICK ) return Hello_User( Client );
@@ -428,12 +436,16 @@ IRC_PONG( CLIENT *Client, REQUEST *Req )
LOCAL BOOLEAN LOCAL BOOLEAN
Hello_User( CLIENT *Client ) Hello_User( CLIENT *Client )
{ {
#ifdef CVSDATE
CHAR ver[12], vertxt[30];
#endif
assert( Client != NULL ); assert( Client != NULL );
/* Passwort ueberpruefen */ /* Check password ... */
if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 ) if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 )
{ {
/* Falsches Passwort */ /* Bad password! */
Log( LOG_ERR, "User \"%s\" rejected (connection %d): Bad password!", Client_Mask( Client ), Client_Conn( Client )); Log( LOG_ERR, "User \"%s\" rejected (connection %d): Bad password!", Client_Mask( Client ), Client_Conn( Client ));
Conn_Close( Client_Conn( Client ), NULL, "Bad password", TRUE ); Conn_Close( Client_Conn( Client ), NULL, "Bad password", TRUE );
return DISCONNECTED; return DISCONNECTED;
@@ -441,13 +453,29 @@ Hello_User( CLIENT *Client )
Log( LOG_NOTICE, "User \"%s\" registered (connection %d).", Client_Mask( Client ), Client_Conn( Client )); Log( LOG_NOTICE, "User \"%s\" registered (connection %d).", Client_Mask( Client ), Client_Conn( Client ));
/* Andere Server informieren */ /* Inform other servers */
IRC_WriteStrServers( NULL, "NICK %s 1 %s %s 1 +%s :%s", Client_ID( Client ), Client_User( Client ), Client_Hostname( Client ), Client_Modes( Client ), Client_Info( Client )); IRC_WriteStrServers( NULL, "NICK %s 1 %s %s 1 +%s :%s", Client_ID( Client ), Client_User( Client ), Client_Hostname( Client ), Client_Modes( Client ), Client_Info( Client ));
/* Welcome :-) */
if( ! IRC_WriteStrClient( Client, RPL_WELCOME_MSG, Client_ID( Client ), Client_Mask( Client ))) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_WELCOME_MSG, Client_ID( Client ), Client_Mask( Client ))) return FALSE;
/* Version and system type */
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE;
#else
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE;
#endif
if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE;
#ifdef CVSDATE
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, USERMODES, CHANMODES )) return FALSE;
#else
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, USERMODES, CHANMODES )) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, USERMODES, CHANMODES )) return FALSE;
#endif
/* Features */ /* Features */
if( ! IRC_WriteStrClient( Client, RPL_ISUPPORT_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED; if( ! IRC_WriteStrClient( Client, RPL_ISUPPORT_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED;
@@ -457,6 +485,9 @@ Hello_User( CLIENT *Client )
if( ! IRC_Send_LUSERS( Client )) return DISCONNECTED; if( ! IRC_Send_LUSERS( Client )) return DISCONNECTED;
if( ! IRC_Show_MOTD( Client )) return DISCONNECTED; if( ! IRC_Show_MOTD( Client )) return DISCONNECTED;
/* Suspend the client for a second ... */
IRC_SetPenalty( Client, 1 );
return CONNECTED; return CONNECTED;
} /* Hello_User */ } /* Hello_User */

View File

@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-mode.c,v 1.31 2003/01/21 21:04:16 alex Exp $"; static char UNUSED id[] = "$Id: irc-mode.c,v 1.31.2.1 2003/11/07 20:51:11 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -230,7 +230,8 @@ client_exit:
} }
Log( LOG_DEBUG, "User \"%s\": Mode change, now \"%s\".", Client_Mask( Target ), Client_Modes( Target )); Log( LOG_DEBUG, "User \"%s\": Mode change, now \"%s\".", Client_Mask( Target ), Client_Modes( Target ));
} }
IRC_SetPenalty( Client, 1 );
return ok; return ok;
} /* Client_Mode */ } /* Client_Mode */
@@ -598,6 +599,7 @@ chan_exit:
} }
} }
IRC_SetPenalty( Client, 1 );
return CONNECTED; return CONNECTED;
} /* Channel_Mode */ } /* Channel_Mode */

View File

@@ -1,6 +1,6 @@
/* /*
* ngIRCd -- The Next Generation IRC Daemon * ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-op.c,v 1.11 2002/12/12 12:24:18 alex Exp $"; static char UNUSED id[] = "$Id: irc-op.c,v 1.11.4.1 2003/12/05 13:33:12 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -69,14 +69,14 @@ IRC_INVITE( CLIENT *Client, REQUEST *Req )
assert( Client != NULL ); assert( Client != NULL );
assert( Req != NULL ); assert( Req != NULL );
/* Falsche Anzahl Parameter? */ /* Wrong number of parameters? */
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix ); if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client; else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix ); if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* User suchen */ /* Search user */
target = Client_Search( Req->argv[0] ); target = Client_Search( Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_USER )) return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] ); if(( ! target ) || ( Client_Type( target ) != CLIENT_USER )) return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] );
@@ -84,36 +84,38 @@ IRC_INVITE( CLIENT *Client, REQUEST *Req )
if( chan ) if( chan )
{ {
/* Der Channel existiert bereits; ist der User Mitglied? */ /* Channel exists. Is the user a valid member of the channel? */
if( ! Channel_IsMemberOf( chan, from )) return IRC_WriteStrClient( from, ERR_NOTONCHANNEL_MSG, Client_ID( Client ), Req->argv[1] ); if( ! Channel_IsMemberOf( chan, from )) return IRC_WriteStrClient( from, ERR_NOTONCHANNEL_MSG, Client_ID( Client ), Req->argv[1] );
/* Ist der Channel "invite-only"? */ /* Is the channel "invite-only"? */
if( strchr( Channel_Modes( chan ), 'i' )) if( strchr( Channel_Modes( chan ), 'i' ))
{ {
/* Ja. Der User muss Channel-Operator sein! */ /* Yes. The user must be channel operator! */
if( ! strchr( Channel_UserModes( chan, from ), 'o' )) return IRC_WriteStrClient( from, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( from ), Channel_Name( chan )); if( ! strchr( Channel_UserModes( chan, from ), 'o' )) return IRC_WriteStrClient( from, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( from ), Channel_Name( chan ));
remember = TRUE; remember = TRUE;
} }
/* Ist der Ziel-User bereits Mitglied? */ /* Is the target user already member of the channel? */
if( Channel_IsMemberOf( chan, target )) return IRC_WriteStrClient( from, ERR_USERONCHANNEL_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] ); if( Channel_IsMemberOf( chan, target )) return IRC_WriteStrClient( from, ERR_USERONCHANNEL_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] );
}
/* Wenn der User gebanned ist, so muss das Invite auch gespeichert werden */ /* If the target user is banned on that channel: remember invite */
if( Lists_CheckBanned( target, chan )) remember = TRUE; if( Lists_CheckBanned( target, chan )) remember = TRUE;
if( remember )
{
/* We must memember this invite */
if( ! Lists_AddInvited( from, Client_Mask( target ), chan, TRUE )) return CONNECTED;
}
}
Log( LOG_DEBUG, "User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask( from ), Req->argv[0], Req->argv[1] ); Log( LOG_DEBUG, "User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask( from ), Req->argv[0], Req->argv[1] );
if( remember )
{
if( ! Lists_AddInvited( from, Client_Mask( target ), chan, TRUE )) return CONNECTED;
}
/* an Ziel-Client forwarden ... */ /* Inform target client */
IRC_WriteStrClientPrefix( target, from, "INVITE %s %s", Req->argv[0], Req->argv[1] ); IRC_WriteStrClientPrefix( target, from, "INVITE %s %s", Req->argv[0], Req->argv[1] );
if( Client_Conn( target ) > NONE ) if( Client_Conn( target ) > NONE )
{ {
/* lokaler Ziel-Client, Status-Code melden */ /* The target user is local, so we have to send the status code */
if( ! IRC_WriteStrClientPrefix( from, target, RPL_INVITING_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] )) return DISCONNECTED; if( ! IRC_WriteStrClientPrefix( from, target, RPL_INVITING_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] )) return DISCONNECTED;
} }

View File

@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-server.c,v 1.32 2003/04/20 23:09:26 alex Exp $"; static char UNUSED id[] = "$Id: irc-server.c,v 1.32.2.2 2003/12/26 16:16:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -117,7 +117,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
Client_SetType( Client, CLIENT_SERVER ); Client_SetType( Client, CLIENT_SERVER );
Conf_SetServer( i, con ); Conf_SetServer( i, con );
#ifdef USE_ZLIB #ifdef ZLIB
/* Kompression initialisieren, wenn erforderlich */ /* Kompression initialisieren, wenn erforderlich */
if( strchr( Client_Flags( Client ), 'Z' )) if( strchr( Client_Flags( Client ), 'Z' ))
{ {
@@ -344,6 +344,8 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
} }
if( nick_out[0] != '\0' ) strlcat( nick_out, ",", sizeof( nick_out )); if( nick_out[0] != '\0' ) strlcat( nick_out, ",", sizeof( nick_out ));
if( is_op ) strlcat( nick_out, "@", sizeof( nick_out ));
if( is_voiced ) strlcat( nick_out, "+", sizeof( nick_out ));
strlcat( nick_out, ptr, sizeof( nick_out )); strlcat( nick_out, ptr, sizeof( nick_out ));
} }
else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", ptr, channame ); else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", ptr, channame );

View File

@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc-write.c,v 1.14 2002/12/30 17:15:42 alex Exp $"; static char UNUSED id[] = "$Id: irc-write.c,v 1.14.2.1 2003/11/07 20:51:11 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -395,6 +395,21 @@ va_dcl
} /* IRC_WriteStrRelatedPrefix */ } /* IRC_WriteStrRelatedPrefix */
GLOBAL VOID
IRC_SetPenalty( CLIENT *Client, INT Seconds )
{
CONN_ID c;
assert( Client != NULL );
assert( Seconds > 0 );
if( Client_Type( Client ) == CLIENT_SERVER ) return;
c = Client_Conn( Client );
if( c > NONE ) Conn_SetPenalty( c, Seconds );
} /* IRC_SetPenalty */
LOCAL CHAR * LOCAL CHAR *
Get_Prefix( CLIENT *Target, CLIENT *Client ) Get_Prefix( CLIENT *Target, CLIENT *Client )
{ {

View File

@@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: irc-write.h,v 1.5 2002/12/12 12:23:43 alex Exp $ * $Id: irc-write.h,v 1.5.4.1 2003/11/07 20:51:11 alex Exp $
* *
* Sending IRC commands over the network (header) * Sending IRC commands over the network (header)
*/ */
@@ -18,17 +18,19 @@
#define __irc_write_h__ #define __irc_write_h__
GLOBAL BOOLEAN IRC_WriteStrClient PARAMS((CLIENT *Client, CHAR *Format, ... )); GLOBAL BOOLEAN IRC_WriteStrClient PARAMS(( CLIENT *Client, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrClientPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... )); GLOBAL BOOLEAN IRC_WriteStrClientPrefix PARAMS(( CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrChannel PARAMS((CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... )); GLOBAL BOOLEAN IRC_WriteStrChannel PARAMS(( CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrChannelPrefix PARAMS((CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )); GLOBAL BOOLEAN IRC_WriteStrChannelPrefix PARAMS(( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServers PARAMS((CLIENT *ExceptOf, CHAR *Format, ... )); GLOBAL VOID IRC_WriteStrServers PARAMS(( CLIENT *ExceptOf, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... )); GLOBAL VOID IRC_WriteStrServersPrefix PARAMS(( CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServersPrefixFlag PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR Flag, CHAR *Format, ... )); GLOBAL VOID IRC_WriteStrServersPrefixFlag PARAMS(( CLIENT *ExceptOf, CLIENT *Prefix, CHAR Flag, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )); GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix PARAMS(( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL VOID IRC_SetPenalty PARAMS(( CLIENT *Client, INT Seconds ));
#endif #endif

View File

@@ -14,7 +14,7 @@
#include "portab.h" #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.3 2003/12/26 16:16:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -95,8 +95,30 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
if( c ) if( c )
{ {
/* Yes, there is such a client -- but is it a valid user? */ /* 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 )); if( Client_Type( c ) == CLIENT_SERVER )
else if( Client_Type( c ) != CLIENT_USER )IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); {
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 else
{ {
/* Kill user NOW! */ /* Kill user NOW! */
@@ -243,6 +265,7 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
/* Some information about us */ /* Some information about us */
if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Conf_ServerName, Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( Client )))) return DISCONNECTED; if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Conf_ServerName, Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( Client )))) return DISCONNECTED;
IRC_SetPenalty( Client, 3 );
return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel ); return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel );
} /* IRC_TRACE */ } /* IRC_TRACE */
@@ -264,6 +287,8 @@ IRC_HELP( CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED; if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
cmd++; cmd++;
} }
IRC_SetPenalty( Client, 2 );
return CONNECTED; return CONNECTED;
} /* IRC_HELP */ } /* IRC_HELP */
@@ -277,7 +302,7 @@ Option_String( CONN_ID Idx )
options = Conn_Options( Idx ); options = Conn_Options( Idx );
strcpy( option_txt, "F" ); /* No idea what this means but the original ircd sends it ... */ strcpy( option_txt, "F" ); /* No idea what this means but the original ircd sends it ... */
#ifdef USE_ZLIB #ifdef ZLIB
if( options & CONN_ZIP ) strcat( option_txt, "z" ); if( options & CONN_ZIP ) strcat( option_txt, "z" );
#endif #endif

View File

@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: log.c,v 1.43 2003/03/31 15:54:21 alex Exp $"; static char UNUSED id[] = "$Id: log.c,v 1.43.2.1 2003/12/26 16:16:48 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -25,7 +25,7 @@ static char UNUSED id[] = "$Id: log.c,v 1.43 2003/03/31 15:54:21 alex Exp $";
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#ifdef USE_SYSLOG #ifdef SYSLOG
#include <syslog.h> #include <syslog.h>
#endif #endif
@@ -50,7 +50,7 @@ LOCAL VOID Wall_ServerNotice PARAMS(( CHAR *Msg ));
GLOBAL VOID GLOBAL VOID
Log_Init( VOID ) Log_Init( VOID )
{ {
#ifdef USE_SYSLOG #ifdef SYSLOG
/* Syslog initialisieren */ /* Syslog initialisieren */
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 ); openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
#endif #endif
@@ -125,7 +125,7 @@ Log_Exit( VOID )
/* Error-File (stderr) loeschen */ /* Error-File (stderr) loeschen */
if( unlink( Error_File ) != 0 ) Log( LOG_ERR, "Can't delete \"%s\": %s", Error_File, strerror( errno )); if( unlink( Error_File ) != 0 ) Log( LOG_ERR, "Can't delete \"%s\": %s", Error_File, strerror( errno ));
#ifdef USE_SYSLOG #ifdef SYSLOG
/* syslog abmelden */ /* syslog abmelden */
closelog( ); closelog( );
#endif #endif
@@ -180,7 +180,7 @@ va_dcl
fprintf( stdout, "[%d] %s\n", Level, msg ); fprintf( stdout, "[%d] %s\n", Level, msg );
fflush( stdout ); fflush( stdout );
} }
#ifdef USE_SYSLOG #ifdef SYSLOG
else else
{ {
/* Syslog */ /* Syslog */
@@ -206,7 +206,7 @@ va_dcl
GLOBAL VOID GLOBAL VOID
Log_Init_Resolver( VOID ) Log_Init_Resolver( VOID )
{ {
#ifdef USE_SYSLOG #ifdef SYSLOG
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 ); openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
#endif #endif
} /* Log_Init_Resolver */ } /* Log_Init_Resolver */
@@ -215,7 +215,7 @@ Log_Init_Resolver( VOID )
GLOBAL VOID GLOBAL VOID
Log_Exit_Resolver( VOID ) Log_Exit_Resolver( VOID )
{ {
#ifdef USE_SYSLOG #ifdef SYSLOG
closelog( ); closelog( );
#endif #endif
} /* Log_Exit_Resolver */ } /* Log_Exit_Resolver */
@@ -234,7 +234,7 @@ va_dcl
{ {
/* Eintrag des Resolver in Logfile(s) schreiben */ /* Eintrag des Resolver in Logfile(s) schreiben */
#ifndef USE_SYSLOG #ifndef SYSLOG
return; return;
#else #else

View File

@@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: log.h,v 1.13 2002/12/12 12:23:43 alex Exp $ * $Id: log.h,v 1.13.4.1 2003/12/26 16:16:48 alex Exp $
* *
* Logging functions (header) * Logging functions (header)
*/ */
@@ -18,7 +18,7 @@
#define __log_h__ #define __log_h__
#ifdef USE_SYSLOG #ifdef SYSLOG
# include <syslog.h> # include <syslog.h>
#else #else
# define LOG_EMERG 0 # define LOG_EMERG 0

View File

@@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: messages.h,v 1.64 2003/03/19 21:16:16 alex Exp $ * $Id: messages.h,v 1.64.2.1 2003/12/26 16:16:48 alex Exp $
* *
* IRC numerics (Header) * IRC numerics (Header)
*/ */
@@ -117,7 +117,7 @@
#define ERR_UMODEUNKNOWNFLAG2_MSG "501 %s :Unknown mode \"%c%c\"" #define ERR_UMODEUNKNOWNFLAG2_MSG "501 %s :Unknown mode \"%c%c\""
#define ERR_USERSDONTMATCH_MSG "502 %s :Can't set/get mode for other users" #define ERR_USERSDONTMATCH_MSG "502 %s :Can't set/get mode for other users"
#ifdef USE_ZLIB #ifdef ZLIB
#define RPL_STATSLINKINFOZIP_MSG "211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld" #define RPL_STATSLINKINFOZIP_MSG "211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld"
#endif #endif

View File

@@ -1,6 +1,6 @@
/* /*
* ngIRCd -- The Next Generation IRC Daemon * ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de) * Copyright (c)2001-2004 by Alexander Barton (alex@barton.de)
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: ngircd.c,v 1.76 2003/03/31 15:54:21 alex Exp $"; static char UNUSED id[] = "$Id: ngircd.c,v 1.76.2.3 2004/01/02 19:24:46 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@@ -298,7 +298,7 @@ main( int argc, const char *argv[] )
* sind in doc/Protocol.txt beschrieben. */ * sind in doc/Protocol.txt beschrieben. */
#ifdef IRCPLUS #ifdef IRCPLUS
sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS ); sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS );
#ifdef USE_ZLIB #ifdef ZLIB
strcat( NGIRCd_ProtoID, "Z" ); strcat( NGIRCd_ProtoID, "Z" );
#endif #endif
if( Conf_OperCanMode ) strcat( NGIRCd_ProtoID, "o" ); if( Conf_OperCanMode ) strcat( NGIRCd_ProtoID, "o" );
@@ -306,7 +306,7 @@ main( int argc, const char *argv[] )
sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION ); sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION );
#endif #endif
strcat( NGIRCd_ProtoID, " P" ); strcat( NGIRCd_ProtoID, " P" );
#ifdef USE_ZLIB #ifdef ZLIB
strcat( NGIRCd_ProtoID, "Z" ); strcat( NGIRCd_ProtoID, "Z" );
#endif #endif
Log( LOG_DEBUG, "Protocol and server ID is \"%s\".", NGIRCd_ProtoID ); Log( LOG_DEBUG, "Protocol and server ID is \"%s\".", NGIRCd_ProtoID );
@@ -361,15 +361,15 @@ NGIRCd_VersionAddition( VOID )
strcpy( txt, "" ); strcpy( txt, "" );
#ifdef USE_SYSLOG #ifdef SYSLOG
if( txt[0] ) strcat( txt, "+" ); if( txt[0] ) strcat( txt, "+" );
strcat( txt, "SYSLOG" ); strcat( txt, "SYSLOG" );
#endif #endif
#ifdef USE_ZLIB #ifdef ZLIB
if( txt[0] ) strcat( txt, "+" ); if( txt[0] ) strcat( txt, "+" );
strcat( txt, "ZLIB" ); strcat( txt, "ZLIB" );
#endif #endif
#ifdef USE_TCPWRAP #ifdef TCPWRAP
if( txt[0] ) strcat( txt, "+" ); if( txt[0] ) strcat( txt, "+" );
strcat( txt, "TCPWRAP" ); strcat( txt, "TCPWRAP" );
#endif #endif
@@ -417,7 +417,9 @@ NGIRCd_Rehash( VOID )
Conn_ExitListeners( ); Conn_ExitListeners( );
/* Alten Server-Namen merken */ /* Alten Server-Namen merken */
#ifdef DEBUG
assert( sizeof( old_name ) == sizeof( Conf_ServerName )); assert( sizeof( old_name ) == sizeof( Conf_ServerName ));
#endif
strcpy( old_name, Conf_ServerName ); strcpy( old_name, Conf_ServerName );
/* Konfiguration neu lesen ... */ /* Konfiguration neu lesen ... */
@@ -527,7 +529,7 @@ LOCAL VOID
Show_Version( VOID ) Show_Version( VOID )
{ {
puts( NGIRCd_Version( )); puts( NGIRCd_Version( ));
puts( "Copyright (c)2001-2003 by Alexander Barton (<alex@barton.de>)." ); puts( "Copyright (c)2001-2004 by Alexander Barton (<alex@barton.de>)." );
puts( "Homepage: <http://arthur.ath.cx/~alex/ngircd/>\n" ); puts( "Homepage: <http://arthur.ath.cx/~alex/ngircd/>\n" );
puts( "This is free software; see the source for copying conditions. There is NO" ); 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." ); puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );

View File

@@ -1,26 +1,35 @@
#!/bin/sh #!/bin/sh
# ngIRCd Test Suite # ngIRCd Test Suite
# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $ # $Id: getpid.sh,v 1.2.4.2 2003/11/07 20:51:11 alex Exp $
# wurde ein Name uebergeben? # did we get a name?
[ $# -ne 1 ] && exit 1 [ $# -ne 1 ] && exit 1
# Flags fuer "ps" ermitteln # detect flags for "ps" and "head"
if [ `uname` = "FreeBSD" ]; then if [ `uname` = "FreeBSD" ]; then
PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1" PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
elif [ `uname` = "A/UX" ]; then elif [ `uname` = "A/UX" ]; then
PS_FLAGS="-ae"; PS_PIDCOL="1"; HEAD_FLAGS="-1" PS_FLAGS="-ae"; PS_PIDCOL="1"; HEAD_FLAGS="-1"
elif [ `uname` = "GNU" ]; then
PS_FLAGS="-ax"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
else else
PS_FLAGS="-f"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1" PS_FLAGS="-f"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
ps $PS_FLAGS > /dev/null 2>&1 ps $PS_FLAGS > /dev/null 2>&1
if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi
fi fi
# PID ermitteln # debug output
ps $PS_FLAGS > procs.tmp #echo "$0: PS_FLAGS=$PS_FLAGS"
pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS ) #echo "$0: PS_PIDCOL=$PS_PIDCOL"
#echo "$0: HEAD_FLAGS=$HEAD_FLAGS"
# ermittelte PID validieren # search PID
ps $PS_FLAGS > procs.tmp
cat procs.tmp | grep -v "$0" | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n > pids.tmp
pid=`head $HEAD_FLAGS pids.tmp`
rm -rf procs.tmp pids.tmp
# validate PID
[ "$pid" -gt 1 ] > /dev/null 2>&1 [ "$pid" -gt 1 ] > /dev/null 2>&1
[ $? -ne 0 ] && exit 1 [ $? -ne 0 ] && exit 1

View File

@@ -1,4 +1,4 @@
# $Id: ngircd-test.conf,v 1.3 2002/10/21 13:45:23 alex Exp $ # $Id: ngircd-test.conf,v 1.3.4.1 2003/11/07 20:51:11 alex Exp $
[Global] [Global]
Name = ngircd.test.server Name = ngircd.test.server
@@ -6,6 +6,7 @@
Ports = 6789 Ports = 6789
MotdFile = ngircd-test.motd MotdFile = ngircd-test.motd
AdminEMail = admin@irc.server AdminEMail = admin@irc.server
MaxConnectionsIP = 0
[Operator] [Operator]
Name = TestOp Name = TestOp

View File

@@ -1,31 +1,37 @@
#!/bin/sh #!/bin/sh
# ngIRCd Test Suite # ngIRCd Test Suite
# $Id: start-server.sh,v 1.10 2002/11/10 14:28:06 alex Exp $ # $Id: start-server.sh,v 1.10.4.1 2003/11/07 20:51:11 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0` [ -z "$srcdir" ] && srcdir=`dirname $0`
echo " starting server ..." echo " starting server ..."
# alte Logfiles loeschen # remove old logfiles
rm -rf logs *.log rm -rf logs *.log
# pruefen, ob getpid.sh gueltige PID's liefert. Wenn dem nicht so ist, # check weather getpid.sh returns valid PIDs. If not, don't start up the
# wird kein ngIRCd gestartet, da dieser ansonsten nicht mehr am Ende # test-server, because we won't be able to kill it at the end of the test.
# des Testlaufs beendet werden koennte!
./getpid.sh sh > /dev/null 2>&1 ./getpid.sh sh > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo " error: getpid.sh FAILED!" echo " error: getpid.sh FAILED!"
exit 1 exit 1
fi fi
# MOTD fuer Test-Server erzeugen # 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!"
exit 1
fi
# generate MOTD for test-server
echo "This is an ngIRCd Test Server" > ngircd-test.motd echo "This is an ngIRCd Test Server" > ngircd-test.motd
# Test-Server starten ... # 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 sleep 1
# validieren, dass Server laeuft # validate running test-server
pid=`./getpid.sh T-ngircd` 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 || exit 1

View File

@@ -1,17 +1,25 @@
#!/bin/sh #!/bin/sh
# ngIRCd Test Suite # ngIRCd Test Suite
# $Id: stop-server.sh,v 1.9 2002/11/10 14:28:06 alex Exp $ # $Id: stop-server.sh,v 1.9.4.1 2003/11/07 20:51:11 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0` [ -z "$srcdir" ] && srcdir=`dirname $0`
echo " stopping server ..." echo " stopping server ..."
# Test-Server stoppen ... # stop test-server ...
pid=`./getpid.sh T-ngircd` pid=`./getpid.sh T-ngircd`
[ -n "$pid" ] && kill $pid > /dev/null 2>&1 || exit 1 if [ -z "$pid" ]; then
sleep 1 echo " no running server found!?"
exit 1
fi
kill $pid > /dev/null 2>&1 || exit 1
# jetzt duerfte der Prozess nicht mehr laufen # waiting ...
kill -0 $pid > /dev/null 2>&1 && exit 1 || exit 0 for i in 1 2 3 4 5; do
kill -0 $pid > /dev/null 2>&1 || exit 0
sleep 1
done
echo " server still running!?"
exit 1
# -eof- # -eof-

View File

@@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
# ngIRCd Test Suite # 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.2 2003/11/07 20:51:11 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0` [ -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` name=`basename $0`
test=`echo ${name} | cut -d '.' -f 1` test=`echo ${name} | cut -d '.' -f 1`
@@ -12,11 +12,11 @@ mkdir -p logs tests
type expect > /dev/null 2>&1 type expect > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "SKIP: ${name} -- \"expect\" not found."; exit 77 echo " ${name}: \"expect\" not found."; exit 77
fi fi
type telnet > /dev/null 2>&1 type telnet > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "SKIP: ${name} -- \"telnet\" not found."; exit 77 echo " ${name}: \"telnet\" not found."; exit 77
fi fi
echo " stressing server with $CLIENTS clients (be patient!) ..." echo " stressing server with $CLIENTS clients (be patient!) ..."

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# ngIRCd Test Suite # ngIRCd Test Suite
# $Id: tests.sh,v 1.3 2002/09/12 02:29:03 alex Exp $ # $Id: tests.sh,v 1.3.6.1 2003/11/07 20:51:11 alex Exp $
name=`basename $0` name=`basename $0`
test=`echo ${name} | cut -d '.' -f 1` test=`echo ${name} | cut -d '.' -f 1`
@@ -8,11 +8,11 @@ mkdir -p logs
type expect > /dev/null 2>&1 type expect > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "SKIP: ${name} -- \"expect\" not found."; exit 77 echo " ${name}: \"expect\" not found."; exit 77
fi fi
type telnet > /dev/null 2>&1 type telnet > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "SKIP: ${name} -- \"telnet\" not found."; exit 77 echo " ${name}: \"telnet\" not found."; exit 77
fi fi
echo " doing ${test} ..." echo " doing ${test} ..."