mirror of
https://github.com/osmarks/ngircd.git
synced 2025-09-18 18:24:03 +00:00
Compare commits
39 Commits
rel-24
...
branch-0-9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ab1e81841b | ||
![]() |
957cdda1c0 | ||
![]() |
c35b810b90 | ||
![]() |
3179bd3090 | ||
![]() |
f95d813064 | ||
![]() |
a854a38616 | ||
![]() |
51b22759b6 | ||
![]() |
521782ad05 | ||
![]() |
84e23f09fc | ||
![]() |
4429afe3c2 | ||
![]() |
216eb30c73 | ||
![]() |
ff91c6db38 | ||
![]() |
a8d50a1ee4 | ||
![]() |
7962ba5fe0 | ||
![]() |
04766b8f3d | ||
![]() |
2019324741 | ||
![]() |
99e718eff9 | ||
![]() |
61776e9a57 | ||
![]() |
eccf4ea5f2 | ||
![]() |
914fbac0f1 | ||
![]() |
b6ce4ce002 | ||
![]() |
1246ec04b8 | ||
![]() |
6335461bc1 | ||
![]() |
8e5d37efc8 | ||
![]() |
ac8559171b | ||
![]() |
d052fdff78 | ||
![]() |
fe9525d105 | ||
![]() |
5b29518ae5 | ||
![]() |
b715a5f061 | ||
![]() |
0b31b46353 | ||
![]() |
8a7ae2dfc1 | ||
![]() |
01ee1bdf2c | ||
![]() |
13ee3e62be | ||
![]() |
fc038ae444 | ||
![]() |
8d1fe3b89a | ||
![]() |
d74029851f | ||
![]() |
8ff1a4b666 | ||
![]() |
5f68d5f1e1 | ||
![]() |
db2a41e5bc |
25
ChangeLog
25
ChangeLog
@@ -10,8 +10,29 @@
|
||||
-- ChangeLog --
|
||||
|
||||
|
||||
ngIRCd CVSHEAD
|
||||
ngIRCd 0.9.2 (2005-10-15)
|
||||
|
||||
- Fixed a bug that could cause the damon to crash when outgoing server
|
||||
connections can't be established.
|
||||
- Fixed a bug that caused the daemon to leak file descriptors when no
|
||||
resolver subprocesses could be created.
|
||||
- Fixed server NOTICEs to users with "s" mode ("server messages").
|
||||
- Fixed a format string bug in "connection statistics" messages to clients.
|
||||
|
||||
ngIRCd 0.9.1 (2005-08-03)
|
||||
|
||||
- The KILL command killed much more than desired (including server links!)
|
||||
when the target user is connected to a remote server. Bug introduced in
|
||||
ngIRCd 0.9.0 ... Reported by <qssl@fastmail.fm>, Thanks!
|
||||
- Changed some constants to be "signed" (instead of unsigned) to solve
|
||||
problems with old (pre-ANSI) compilers.
|
||||
|
||||
ngIRCd 0.9.0 (2005-07-24)
|
||||
|
||||
ngIRCd 0.9.0-pre1 (2005-07-09)
|
||||
- Fixed maximum length of user names, now allow up to 9 characters.
|
||||
- Cut off oversized IRC messages that should be sent to the network instead
|
||||
of shuttding down the (wrong) connection.
|
||||
- Don't generate error messages for unknown commands received before the
|
||||
client is registered with the server (like the original ircd).
|
||||
- Never run with root privileges but always switch the user ID.
|
||||
@@ -608,4 +629,4 @@ ngIRCd 0.0.1, 31.12.2001
|
||||
|
||||
|
||||
--
|
||||
$Id: ChangeLog,v 1.276 2005/06/26 21:54:01 alex Exp $
|
||||
$Id: ChangeLog,v 1.276.2.12 2005/10/15 12:44:08 alex Exp $
|
||||
|
4
NEWS
4
NEWS
@@ -10,7 +10,7 @@
|
||||
-- NEWS --
|
||||
|
||||
|
||||
ngIRCd 0.9.0
|
||||
ngIRCd 0.9.0 (2005-07-24)
|
||||
|
||||
- Never run with root privileges but always switch the user ID.
|
||||
- Make "netsplit" messages RFC compliant.
|
||||
@@ -208,4 +208,4 @@ ngIRCd 0.0.1, 31.12.2001
|
||||
|
||||
|
||||
--
|
||||
$Id: NEWS,v 1.74 2005/06/26 21:54:02 alex Exp $
|
||||
$Id: NEWS,v 1.74.2.1 2005/07/24 21:39:45 alex Exp $
|
||||
|
14
README
14
README
@@ -53,15 +53,15 @@ IV. Documentation
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
More documentation can be found in the "doc/" directory and the homepage of
|
||||
the ngIRCd: <http://arthur.ath.cx/~alex/ngircd/>.
|
||||
the ngIRCd: <http://ngircd.barton.de/>.
|
||||
|
||||
|
||||
V. Download
|
||||
~~~~~~~~~~~
|
||||
|
||||
The homepage of the ngIRCd is: <http://arthur.ath.cx/~alex/ngircd>; you
|
||||
will find the newest information about the ngIRCd and the most recent
|
||||
("stable") releases there.
|
||||
The homepage of the ngIRCd is: <http://ngircd.barton.de/>; you will find
|
||||
the newest information about the ngIRCd and the most recent ("stable")
|
||||
releases there.
|
||||
|
||||
If you are interested in the latest development versions (which are not
|
||||
always stable), then please read the section "CVS" on the homepage and
|
||||
@@ -75,13 +75,13 @@ VI. Bugs
|
||||
If you find bugs in the ngIRCd (which might be there :-), please report
|
||||
them at the following URL:
|
||||
|
||||
<http://arthur.ath.cx/~alex/ngircd/#bugs>
|
||||
<http://ngircd.barton.de/#bugs>
|
||||
|
||||
There you can read about known bugs and limitations, too.
|
||||
|
||||
If you have critics, patches or something else, please feel free to post a
|
||||
mail to: <alex@barton.de> or <alex@arthur.ath.cx>
|
||||
mail to <alex@barton.de>.
|
||||
|
||||
|
||||
--
|
||||
$Id: README,v 1.20 2005/06/26 21:54:01 alex Exp $
|
||||
$Id: README,v 1.20.2.1 2005/07/09 14:41:39 alex Exp $
|
||||
|
20
config.guess
vendored
20
config.guess
vendored
@@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2004-11-12'
|
||||
timestamp='2005-04-22'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -53,7 +53,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
@@ -804,6 +804,9 @@ EOF
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
exit 0 ;;
|
||||
amd64:CYGWIN*:*:*)
|
||||
echo x86_64-unknown-cygwin
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin
|
||||
exit 0 ;;
|
||||
@@ -1137,6 +1140,10 @@ EOF
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
i*86:VOS:*:*)
|
||||
# From Paul.Green@stratus.com.
|
||||
echo ${UNAME_MACHINE}-stratus-vos
|
||||
exit 0 ;;
|
||||
*:VOS:*:*)
|
||||
# From Paul.Green@stratus.com.
|
||||
echo hppa1.1-stratus-vos
|
||||
@@ -1197,6 +1204,9 @@ EOF
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSE-?:NONSTOP_KERNEL:*:*)
|
||||
echo nse-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -1413,7 +1423,9 @@ This script, last modified $timestamp, has failed to recognize
|
||||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
ftp://ftp.gnu.org/pub/gnu/config/
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
and
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
19
config.sub
vendored
19
config.sub
vendored
@@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2004-11-30'
|
||||
timestamp='2005-04-22'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -70,7 +70,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
@@ -231,13 +231,14 @@ case $basic_machine in
|
||||
| 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 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | mcore \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@@ -262,7 +263,8 @@ case $basic_machine in
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
|
||||
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
@@ -298,7 +300,7 @@ case $basic_machine in
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
@@ -310,7 +312,7 @@ case $basic_machine in
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
@@ -336,7 +338,8 @@ case $basic_machine in
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
|
@@ -8,13 +8,13 @@
|
||||
# (at your option) any later version.
|
||||
# Please read the file COPYING, README and AUTHORS for more information.
|
||||
#
|
||||
# $Id: configure.in,v 1.111 2005/06/26 13:42:11 alex Exp $
|
||||
# $Id: configure.in,v 1.111.2.6 2005/10/15 12:44:08 alex Exp $
|
||||
#
|
||||
|
||||
# -- Initialisation --
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(ngircd, CVSHEAD)
|
||||
AC_INIT(ngircd, 0.9.2)
|
||||
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE(1.6)
|
||||
|
@@ -1,3 +1,28 @@
|
||||
ngircd (0.9.2-0ab1) stable; urgency=low
|
||||
|
||||
* New "upstream release" fixing a few bugs in 0.9.1.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Sat, 15 Oct 2005 14:10:34 +0200
|
||||
|
||||
ngircd (0.9.1-0ab1) unstable; urgency=medium
|
||||
|
||||
* New "upstream release" addressing two problems in ngIRCd 0.9.0.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Wed, 3 Aug 2005 15:10:41 +0200
|
||||
|
||||
ngircd (0.9.0-0ab2) unstable; urgency=medium
|
||||
|
||||
* Init script: fixed a problem with symbolic links in runlevel directories
|
||||
that could prevent the init script from working correctly.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Tue, 26 Jul 2005 21:31:18 +0200
|
||||
|
||||
ngircd (0.9.0-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream release".
|
||||
|
||||
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 24 Jul 2005 23:30:00 +0200
|
||||
|
||||
ngircd (0.8.3-0ab1) unstable; urgency=high
|
||||
|
||||
* New "upstream release", including security fixes.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# ngIRCd start and stop script for Debian-based systems
|
||||
#
|
||||
# $Id: ngircd.init,v 1.5 2005/06/01 21:51:11 alex Exp $
|
||||
# $Id: ngircd.init,v 1.5.2.1 2005/07/26 19:30:54 alex Exp $
|
||||
#
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
@@ -11,7 +11,8 @@ NAME=ngIRCd
|
||||
DESC="IRC daemon"
|
||||
PARAMS=""
|
||||
|
||||
test -h "$0" && BASENAME=`readlink $0` || BASENAME=`basename $0`
|
||||
test -h "$0" && me=`readlink $0` || me="$0"
|
||||
BASENAME=`basename $me`
|
||||
|
||||
test -f /etc/default/$BASENAME && . /etc/default/$BASENAME
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version CVSHEAD
|
||||
%define version 0.9.2
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
26
doc/FAQ.txt
26
doc/FAQ.txt
@@ -17,7 +17,7 @@ A: Yes. ngIRCd is compatible to the original ircd used by IRCNet. Actually
|
||||
this is being tested with version 2.10.3p3.
|
||||
|
||||
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://ngircd.barton.de/>.
|
||||
|
||||
Q: Why should I use ngIRCd instead of the original one?
|
||||
A: ngIRCd offers several benefits: no problems with dynamic IPs, easy to
|
||||
@@ -51,17 +51,29 @@ A: Most probably you are using version 1.5 of GNU automake which seems to be
|
||||
1.4 of GNU automake shipped with this distribution; it should work, too.)
|
||||
|
||||
|
||||
III. Bugs!?
|
||||
~~~~~~~~~~~
|
||||
III. Runtime
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Q: I cannot connect to remote peers when I use the chroot option, the
|
||||
following is logged: "Can't resolve example.com: unknown error!".
|
||||
A: On Linux/glibc with chroot enabled you need to put some libraries inside
|
||||
the chroot as well, notably libnss_dns; maybe others. Unfortunately, even
|
||||
linking ngircd statically does not help this. The only known workaround
|
||||
is to either disable chroot support or to link against dietlibc instead
|
||||
of glibc. (tnx to Sebastian Siewior)
|
||||
|
||||
|
||||
IV. Bugs!?
|
||||
~~~~~~~~~~
|
||||
Q: Is there a list of known bugs and desired feature enhancements?
|
||||
A: Yes. Have a look at the bug tracking system (Bugzilla) for ngIRCd located
|
||||
at <http://arthur.ath.cx/bugzilla/ngircd/>. There you can file bug reports
|
||||
and feature requests as well as search the bug database.
|
||||
at <http://ngircd.barton.de/bugzilla/index.cgi>. There you can file bug
|
||||
reports and feature requests as well as search the bug database.
|
||||
|
||||
Q: What should I do if I found a bug?
|
||||
A: Please file a bug report at <http://arthur.ath.cx/bugzilla/ngircd/>!
|
||||
A: Please file a bug report at <http://ngircd.barton.de/bugzilla/index.cgi>!
|
||||
The author of the particular component will be notified automagically :-)
|
||||
|
||||
|
||||
--
|
||||
$Id: FAQ.txt,v 1.7 2003/11/07 21:32:15 alex Exp $
|
||||
$Id: FAQ.txt,v 1.7.4.1 2005/07/09 14:41:39 alex Exp $
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
ngIRCd - Next Generation IRC Server
|
||||
|
||||
(c)2001-2004 Alexander Barton
|
||||
(c)2001-2005 Alexander Barton
|
||||
alex@barton.de, http://www.barton.de/
|
||||
|
||||
ngIRCd is free software and published under the
|
||||
@@ -28,18 +28,20 @@ Platform Compiler ngIRCd Date Tester C M T R See
|
||||
--------------------------- ------------ ---------- -------- ------ - - - - ---
|
||||
hppa/unknown/openbsd3.5 gcc 2.95.3 CVSHEAD 04-05-25 alex Y Y Y Y
|
||||
hppa1.1/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
hppa2.0/unknown/linux-gnu gcc 3.3.5 0.9.x-CVS 05-06-27 alex Y Y Y Y
|
||||
i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
|
||||
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
i386/unknown/gnu0.3 gcc 3.3.3 0.8.0 04-05-30 alex Y Y n Y
|
||||
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 CVSHEAD 04-02-24 alex Y Y Y Y
|
||||
i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y n Y
|
||||
i686/pc/cygwin gcc 3.3.1 0.9.x-CVS 05-07-08 alex Y Y n Y
|
||||
i686/pc/linux-gnu gcc 2.95.4 0.8.0 04-05-30 alex Y Y Y Y (1)
|
||||
i686/pc/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y (1)
|
||||
i686/pc/linux-gnu gcc 3.3.5 0.9.x-CVS 05-07-09 alex Y Y Y Y (1)
|
||||
m68k/apple/aux3.1.1 Orig. A/UX 0.7.x-CVS 03-04-22 alex Y Y Y Y (2)
|
||||
m68k/hp/hp-ux9.10 Orig. HPUX 0.7.x-CVS 03-04-30 goetz Y Y Y Y
|
||||
m88k/dg/dgux5.4R3.10 gcc 2.5.8 CVSHEAD 04-03-15 alex Y Y ? ?
|
||||
powerpc/apple/darwin6.5 gcc 3.1 0.7.x-CVS 03-04-23 alex Y Y Y Y
|
||||
powerpc/apple/darwin7.4.0 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
powerpc/apple/darwin8.1.0 gcc 4.0 0.9.x-CVS 05-06-27 alex Y Y Y Y
|
||||
powerpc/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
|
||||
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
@@ -60,4 +62,4 @@ Notes
|
||||
|
||||
|
||||
--
|
||||
$Id: Platforms.txt,v 1.13 2004/11/09 11:00:33 alex Exp $
|
||||
$Id: Platforms.txt,v 1.13.2.2 2005/07/09 11:16:38 alex Exp $
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: client.c,v 1.84 2005/06/12 16:39:42 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: client.c,v 1.84.2.1 2006/03/24 23:30:34 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -296,11 +296,9 @@ Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
|
||||
{
|
||||
if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
|
||||
else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( c->id[0] ) Log( LOG_WARNING, "Unregistered unknown client \"%s\": %s", c->id, txt );
|
||||
else Log( LOG_WARNING, "Unregistered unknown client: %s", c->id, txt );
|
||||
} else {
|
||||
Log(LOG_WARNING, "Unregistered unknown client \"%s\": %s",
|
||||
c->id[0] ? c->id : "(No Nick)", txt );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: conf.c,v 1.77 2005/06/17 19:16:53 fw Exp $";
|
||||
static char UNUSED id[] = "$Id: conf.c,v 1.77.2.1 2005/10/11 19:28:47 alex Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -204,6 +204,7 @@ Conf_UnsetServer( CONN_ID Idx )
|
||||
* Non-Server-Connections will be silently ignored. */
|
||||
|
||||
int i;
|
||||
time_t t;
|
||||
|
||||
/* Check all our configured servers */
|
||||
for( i = 0; i < MAX_SERVERS; i++ )
|
||||
@@ -221,11 +222,14 @@ Conf_UnsetServer( CONN_ID Idx )
|
||||
else
|
||||
{
|
||||
/* Set time for next connect attempt */
|
||||
if( Conf_Server[i].lasttry < time( NULL ) - Conf_ConnectRetry )
|
||||
{
|
||||
/* Okay, the connection was established "long enough": */
|
||||
Conf_Server[i].lasttry = time( NULL ) - Conf_ConnectRetry + RECONNECT_DELAY;
|
||||
}
|
||||
t = time(NULL);
|
||||
if (Conf_Server[i].lasttry < t - Conf_ConnectRetry) {
|
||||
/* The connection has been "long", so we don't
|
||||
* require the next attempt to be delayed. */
|
||||
Conf_Server[i].lasttry =
|
||||
t - Conf_ConnectRetry + RECONNECT_DELAY;
|
||||
} else
|
||||
Conf_Server[i].lasttry = t;
|
||||
}
|
||||
}
|
||||
} /* Conf_UnsetServer */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2004 Alexander Barton <alex@barton.de>
|
||||
* Copyright (c)2001-2005 Alexander Barton <alex@barton.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: conn.c,v 1.155 2005/06/26 13:43:59 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: conn.c,v 1.155.2.4 2006/03/18 22:30:45 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -93,7 +93,7 @@ LOCAL void Init_Conn_Struct PARAMS(( CONN_ID Idx ));
|
||||
LOCAL bool Init_Socket PARAMS(( int Sock ));
|
||||
LOCAL void New_Server PARAMS(( int Server, CONN_ID Idx ));
|
||||
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, const char *Msg ));
|
||||
LOCAL int Count_Connections PARAMS(( struct sockaddr_in addr ));
|
||||
|
||||
LOCAL fd_set My_Listeners;
|
||||
@@ -517,6 +517,15 @@ Conn_Handler( void )
|
||||
} /* Conn_Handler */
|
||||
|
||||
|
||||
/**
|
||||
* Write a text string into the socket of a connection.
|
||||
* This function automatically appends CR+LF to the string and validates that
|
||||
* the result is a valid IRC message (oversized messages are shortened, for
|
||||
* example). Then it calls the Conn_Write() function to do the actual sending.
|
||||
* @param Idx Index fo the connection.
|
||||
* @param Format Format string, see printf().
|
||||
* @return true on success, false otherwise.
|
||||
*/
|
||||
#ifdef PROTOTYPES
|
||||
GLOBAL bool
|
||||
Conn_WriteStr( CONN_ID Idx, char *Format, ... )
|
||||
@@ -528,11 +537,8 @@ char *Format;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
/* String in Socket schreiben. CR+LF wird von dieser Funktion
|
||||
* automatisch angehaengt. Im Fehlerfall wird dir Verbindung
|
||||
* getrennt und false geliefert. */
|
||||
|
||||
char buffer[COMMAND_LEN];
|
||||
size_t len;
|
||||
bool ok;
|
||||
va_list ap;
|
||||
|
||||
@@ -544,19 +550,43 @@ va_dcl
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) >= COMMAND_LEN - 2 )
|
||||
{
|
||||
Log( LOG_CRIT, "Text too long to send (connection %d)!", Idx );
|
||||
Conn_Close( Idx, "Text too long to send!", NULL, false );
|
||||
return false;
|
||||
|
||||
if (vsnprintf(buffer, COMMAND_LEN - 2, Format, ap) >= COMMAND_LEN - 2) {
|
||||
/*
|
||||
* The string that should be written to the socket is longer
|
||||
* than the allowed size of COMMAND_LEN bytes (including both
|
||||
* the CR and LF characters). This can be caused by the
|
||||
* IRC_WriteXXX() functions when the prefix of this server had
|
||||
* to be added to an already "quite long" command line which
|
||||
* has been received from a regular IRC client, for example.
|
||||
*
|
||||
* We are not allowed to send such "oversized" messages to
|
||||
* other servers and clients, see RFC 2812 2.3 and 2813 3.3
|
||||
* ("these messages SHALL NOT exceed 512 characters in length,
|
||||
* counting all characters including the trailing CR-LF").
|
||||
*
|
||||
* So we have a big problem here: we should send more bytes
|
||||
* to the network than we are allowed to and we don't know
|
||||
* the originator (any more). The "old" behaviour of blaming
|
||||
* the receiver ("next hop") is a bad idea (it could be just
|
||||
* an other server only routing the message!), so the only
|
||||
* option left is to shorten the string and to hope that the
|
||||
* result is still somewhat useful ...
|
||||
* -alex-
|
||||
*/
|
||||
|
||||
strcpy (buffer + sizeof(buffer) - strlen(CUT_TXTSUFFIX) - 2 - 1,
|
||||
CUT_TXTSUFFIX);
|
||||
}
|
||||
|
||||
#ifdef SNIFFER
|
||||
if( NGIRCd_Sniffer ) Log( LOG_DEBUG, " -> connection %d: '%s'.", Idx, buffer );
|
||||
if (NGIRCd_Sniffer)
|
||||
Log(LOG_DEBUG, " -> connection %d: '%s'.", Idx, buffer);
|
||||
#endif
|
||||
|
||||
strlcat( buffer, "\r\n", sizeof( buffer ));
|
||||
ok = Conn_Write( Idx, buffer, strlen( buffer ));
|
||||
len = strlcat( buffer, "\r\n", sizeof( buffer ));
|
||||
assert(len < COMMAND_LEN);
|
||||
ok = Conn_Write(Idx, buffer, len);
|
||||
My_Connections[Idx].msg_out++;
|
||||
|
||||
va_end( ap );
|
||||
@@ -666,24 +696,34 @@ Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient )
|
||||
c = Client_GetFromConn( Idx );
|
||||
|
||||
/* Should the client be informed? */
|
||||
if( InformClient )
|
||||
{
|
||||
if (InformClient) {
|
||||
#ifndef STRICT_RFC
|
||||
/* Send statistics to client if registered as user: */
|
||||
if(( c != NULL ) && ( Client_Type( c ) == CLIENT_USER ))
|
||||
{
|
||||
Conn_WriteStr( Idx, "NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.", Client_ThisServer( ), NOTICE_TXTPREFIX, (double)My_Connections[Idx].bytes_in / 1024, (double)My_Connections[Idx].bytes_out / 1024 );
|
||||
if ((c != NULL) && (Client_Type(c) == CLIENT_USER)) {
|
||||
Conn_WriteStr( Idx,
|
||||
"NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.",
|
||||
Client_ID(Client_ThisServer()), NOTICE_TXTPREFIX,
|
||||
(double)My_Connections[Idx].bytes_in / 1024,
|
||||
(double)My_Connections[Idx].bytes_out / 1024);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Send ERROR to client (see RFC!) */
|
||||
if( FwdMsg ) Conn_WriteStr( Idx, "ERROR :%s", FwdMsg );
|
||||
else Conn_WriteStr( Idx, "ERROR :Closing connection." );
|
||||
if (FwdMsg)
|
||||
Conn_WriteStr(Idx, "ERROR :%s", FwdMsg);
|
||||
else
|
||||
Conn_WriteStr(Idx, "ERROR :Closing connection.");
|
||||
}
|
||||
|
||||
/* Try to write out the write buffer */
|
||||
/* Try to write out the write buffer. Note: Handle_Write() eventually
|
||||
* removes the CLIENT structure associated with this connection if an
|
||||
* error occurs! So we have to re-check if there is still an valid
|
||||
* CLIENT structure after calling Handle_Write() ...*/
|
||||
(void)Handle_Write( Idx );
|
||||
|
||||
/* Search client, if any (re-check!) */
|
||||
c = Client_GetFromConn( Idx );
|
||||
|
||||
/* Shut down socket */
|
||||
if( close( My_Connections[Idx].sock ) != 0 )
|
||||
{
|
||||
@@ -827,23 +867,28 @@ Handle_Write( CONN_ID Idx )
|
||||
res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &sock_len );
|
||||
assert( sock_len == sizeof( err ));
|
||||
|
||||
/* Fehler aufgetreten? */
|
||||
if(( res != 0 ) || ( err != 0 ))
|
||||
{
|
||||
/* Fehler! */
|
||||
if( res != 0 ) Log( LOG_CRIT, "getsockopt (connection %d): %s!", Idx, strerror( errno ));
|
||||
else Log( LOG_CRIT, "Can't connect socket to \"%s:%d\" (connection %d): %s!", My_Connections[Idx].host, Conf_Server[Conf_GetServer( Idx )].port, Idx, strerror( err ));
|
||||
/* Error while connecting? */
|
||||
if ((res != 0) || (err != 0)) {
|
||||
if (res != 0)
|
||||
Log(LOG_CRIT, "getsockopt (connection %d): %s!",
|
||||
Idx, strerror(errno));
|
||||
else
|
||||
Log(LOG_CRIT,
|
||||
"Can't connect socket to \"%s:%d\" (connection %d): %s!",
|
||||
My_Connections[Idx].host,
|
||||
Conf_Server[Conf_GetServer(Idx)].port,
|
||||
Idx, strerror(err));
|
||||
|
||||
/* Clean up socket, connection and client structures */
|
||||
FD_CLR( My_Connections[Idx].sock, &My_Sockets );
|
||||
c = Client_GetFromConn( Idx );
|
||||
if( c ) Client_DestroyNow( c );
|
||||
close( My_Connections[Idx].sock );
|
||||
Init_Conn_Struct( Idx );
|
||||
/* Clean up the CLIENT structure (to avoid silly log
|
||||
* messages) and call Conn_Close() to do the rest. */
|
||||
c = Client_GetFromConn(Idx);
|
||||
if (c)
|
||||
Client_DestroyNow(c);
|
||||
|
||||
/* Bei Server-Verbindungen lasttry-Zeitpunkt auf "jetzt" setzen */
|
||||
Conf_Server[Conf_GetServer( Idx )].lasttry = time( NULL );
|
||||
Conf_UnsetServer( Idx );
|
||||
Conn_Close(Idx, "Can't connect!", NULL, false);
|
||||
|
||||
/* Set the timestamp of the last connect attempt */
|
||||
Conf_UnsetServer(Idx);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1143,15 +1188,17 @@ Handle_Buffer( CONN_ID Idx )
|
||||
char *ptr;
|
||||
int len, delta;
|
||||
bool action, result;
|
||||
time_t starttime;
|
||||
#ifdef ZLIB
|
||||
bool old_z;
|
||||
#endif
|
||||
|
||||
starttime = time(NULL);
|
||||
result = false;
|
||||
do
|
||||
{
|
||||
/* Check penalty */
|
||||
if( My_Connections[Idx].delaytime > time( NULL )) return result;
|
||||
if( My_Connections[Idx].delaytime > starttime) return result;
|
||||
|
||||
#ifdef ZLIB
|
||||
/* ggf. noch unkomprimiete Daten weiter entpacken */
|
||||
@@ -1648,9 +1695,10 @@ try_resolve:
|
||||
|
||||
|
||||
LOCAL void
|
||||
Simple_Message( int Sock, char *Msg )
|
||||
Simple_Message( int Sock, const char *Msg )
|
||||
{
|
||||
char buf[COMMAND_LEN];
|
||||
size_t len;
|
||||
/* Write "simple" message to socket, without using compression
|
||||
* or even the connection write buffers. Used e.g. for error
|
||||
* messages by New_Connection(). */
|
||||
@@ -1658,8 +1706,9 @@ Simple_Message( int Sock, char *Msg )
|
||||
assert( Msg != NULL );
|
||||
|
||||
strlcpy( buf, Msg, sizeof buf - 2);
|
||||
strlcat( buf, "\r\n", sizeof buf);
|
||||
(void)write( Sock, buf, strlen( buf ) );
|
||||
len = strlcat( buf, "\r\n", sizeof buf);
|
||||
assert(len < COMMAND_LEN);
|
||||
(void)write(Sock, buf, len);
|
||||
} /* Simple_Error */
|
||||
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* (at your option) any later version.
|
||||
* Please read the file COPYING, README and AUTHORS for more information.
|
||||
*
|
||||
* $Id: conn.h,v 1.35 2005/06/12 16:28:55 alex Exp $
|
||||
* $Id: conn.h,v 1.35.2.1 2005/07/30 23:24:50 alex Exp $
|
||||
*
|
||||
* Connection management (header)
|
||||
*/
|
||||
@@ -21,11 +21,11 @@
|
||||
#include <time.h> /* for time_t, see below */
|
||||
|
||||
|
||||
#define CONN_ISCLOSING 1U /* Conn_Close() already called */
|
||||
#define CONN_ISCONNECTING 2U /* connect() in progress */
|
||||
#define CONN_ISCLOSING 1 /* Conn_Close() already called */
|
||||
#define CONN_ISCONNECTING 2 /* connect() in progress */
|
||||
|
||||
#ifdef ZLIB
|
||||
#define CONN_ZIP 4U /* zlib compressed link */
|
||||
#define CONN_ZIP 4 /* zlib compressed link */
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* (at your option) any later version.
|
||||
* Please read the file COPYING, README and AUTHORS for more information.
|
||||
*
|
||||
* $Id: defines.h,v 1.52 2005/05/16 12:22:32 alex Exp $
|
||||
* $Id: defines.h,v 1.52.2.2 2005/07/05 22:58:25 alex Exp $
|
||||
*
|
||||
* Global defines of ngIRCd.
|
||||
*/
|
||||
@@ -43,7 +43,8 @@
|
||||
#define CLIENT_ID_LEN 64 /* max. length of an IRC ID; see RFC 2812, 1.1 and 1.2.1 */
|
||||
#define CLIENT_NICK_LEN 10 /* max. nick length; see. RFC 2812, 1.2.1 */
|
||||
#define CLIENT_PASS_LEN 21 /* max. password length */
|
||||
#define CLIENT_USER_LEN 9 /* max. length of user name ("login") */
|
||||
#define CLIENT_USER_LEN 10 /* Max. length of user name ("login")
|
||||
see RFC 2812, section 1.2.1 */
|
||||
#define CLIENT_NAME_LEN 32 /* max. length of "real names" */
|
||||
#define CLIENT_HOST_LEN 64 /* max. host name length */
|
||||
#define CLIENT_MODE_LEN 8 /* max. lenth of all client modes */
|
||||
@@ -98,6 +99,8 @@
|
||||
|
||||
#define NOTICE_TXTPREFIX "" /* prefix for NOTICEs from the server to users */
|
||||
|
||||
#define CUT_TXTSUFFIX "[CUT]" /* Suffix for oversized messages that
|
||||
have been shortened and cut off. */
|
||||
#ifdef RENDEZVOUS
|
||||
#define RENDEZVOUS_TYPE "_ircu._tcp." /* service type to register with Rendezvous */
|
||||
#endif
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: irc-channel.c,v 1.30 2005/06/12 18:23:59 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: irc-channel.c,v 1.30.2.2 2006/03/16 20:14:46 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -90,14 +90,9 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
||||
if( Client_Type( Client ) == CLIENT_USER )
|
||||
{
|
||||
/* Test if the user has reached his maximum channel count */
|
||||
if( Client_Type( Client ) == CLIENT_USER )
|
||||
{
|
||||
if(( Conf_MaxJoins > 0 ) && ( Channel_CountForUser( Client ) >= Conf_MaxJoins ))
|
||||
{
|
||||
IRC_WriteStrClient( Client, ERR_TOOMANYCHANNELS_MSG, Client_ID( Client ), channame );
|
||||
return CONNECTED;
|
||||
}
|
||||
}
|
||||
if(( Conf_MaxJoins > 0 ) && ( Channel_CountForUser( Client ) >= Conf_MaxJoins ))
|
||||
return IRC_WriteStrClient( Client, ERR_TOOMANYCHANNELS_MSG,
|
||||
Client_ID( Client ), channame );
|
||||
|
||||
/* Existiert der Channel bereits, oder wird er im Moment neu erzeugt? */
|
||||
if( is_new_chan )
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: irc-login.c,v 1.44 2005/06/04 12:32:09 fw Exp $";
|
||||
static char UNUSED id[] = "$Id: irc-login.c,v 1.44.2.1 2005/12/15 11:01:59 alex Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -456,7 +456,15 @@ IRC_PING( CLIENT *Client, REQUEST *Req )
|
||||
}
|
||||
|
||||
Log( LOG_DEBUG, "Connection %d: got PING, sending PONG ...", Client_Conn( Client ));
|
||||
return IRC_WriteStrClient( Client, "PONG %s :%s", Client_ID( Client_ThisServer( )), Client_ID( Client ));
|
||||
#ifdef STRICT_RFC
|
||||
return IRC_WriteStrClient(Client, "PONG %s :%s",
|
||||
Client_ID(Client_ThisServer()), Client_ID(Client));
|
||||
#else
|
||||
/* Some clients depend on the argument being returned in the PONG
|
||||
* reply (not mentioned in any RFC, though) */
|
||||
return IRC_WriteStrClient(Client, "PONG %s :%s",
|
||||
Client_ID(Client_ThisServer( )), Req->argv[0]);
|
||||
#endif
|
||||
} /* IRC_PING */
|
||||
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: irc.c,v 1.126 2005/04/18 15:44:39 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: irc.c,v 1.126.2.1 2005/08/02 23:08:27 alex Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -151,7 +151,7 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
|
||||
}
|
||||
|
||||
/* Kill client NOW! */
|
||||
conn = Client_Conn( Client_NextHop( c ));
|
||||
conn = Client_Conn( c );
|
||||
Client_Destroy( c, NULL, reason, false );
|
||||
if( conn > NONE )
|
||||
Conn_Close( conn, NULL, reason, true );
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: log.c,v 1.57 2005/06/24 19:55:10 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: log.c,v 1.57.2.2 2006/02/08 21:23:21 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -44,15 +44,15 @@ static char UNUSED id[] = "$Id: log.c,v 1.57 2005/06/24 19:55:10 alex Exp $";
|
||||
#include "log.h"
|
||||
|
||||
|
||||
LOCAL char Init_Txt[127];
|
||||
LOCAL bool Is_Daemon;
|
||||
static char Init_Txt[127];
|
||||
static bool Is_Daemon;
|
||||
|
||||
#ifdef DEBUG
|
||||
LOCAL char Error_File[FNAME_LEN];
|
||||
static char Error_File[FNAME_LEN];
|
||||
#endif
|
||||
|
||||
|
||||
LOCAL void Wall_ServerNotice PARAMS(( char *Msg ));
|
||||
static void Wall_ServerNotice PARAMS(( char *Msg ));
|
||||
|
||||
|
||||
GLOBAL void
|
||||
@@ -162,6 +162,35 @@ Log_Exit( void )
|
||||
} /* Log_Exit */
|
||||
|
||||
|
||||
# ifdef PROTOTYPES
|
||||
GLOBAL void
|
||||
LogDebug( const char *Format, ... )
|
||||
# else
|
||||
GLOBAL void
|
||||
LogDebug( Format, va_alist )
|
||||
const char *Format;
|
||||
va_dcl
|
||||
# endif
|
||||
#ifdef DEBUG
|
||||
{
|
||||
char msg[MAX_LOG_MSG_LEN];
|
||||
va_list ap;
|
||||
|
||||
if (!NGIRCd_Debug) return;
|
||||
#ifdef PROTOTYPES
|
||||
va_start( ap, Format );
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
|
||||
va_end( ap );
|
||||
Log(LOG_DEBUG, "%s", msg);
|
||||
}
|
||||
#else
|
||||
{ /* do nothing */ }
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
GLOBAL void
|
||||
Log( int Level, const char *Format, ... )
|
||||
@@ -174,7 +203,6 @@ va_dcl
|
||||
#endif
|
||||
{
|
||||
/* Eintrag in Logfile(s) schreiben */
|
||||
|
||||
char msg[MAX_LOG_MSG_LEN];
|
||||
bool snotice;
|
||||
va_list ap;
|
||||
@@ -302,19 +330,23 @@ va_dcl
|
||||
} /* Log_Resolver */
|
||||
|
||||
|
||||
LOCAL void
|
||||
/**
|
||||
* Send log messages to users flagged with the "s" mode.
|
||||
* @param Msg The message to send.
|
||||
*/
|
||||
static void
|
||||
Wall_ServerNotice( char *Msg )
|
||||
{
|
||||
/* Server-Notice an entsprechende User verschicken */
|
||||
|
||||
CLIENT *c;
|
||||
|
||||
assert( Msg != NULL );
|
||||
|
||||
c = Client_First( );
|
||||
while( c )
|
||||
{
|
||||
if(( Client_Conn( c ) > NONE ) && ( Client_HasMode( c, 's' ))) IRC_WriteStrClient( c, "NOTICE %s :%s%s", Client_ThisServer( ), NOTICE_TXTPREFIX, Msg );
|
||||
while(c) {
|
||||
if (Client_Conn(c) > NONE && Client_HasMode(c, 's'))
|
||||
IRC_WriteStrClient(c, "NOTICE %s :%s%s", Client_ID(c),
|
||||
NOTICE_TXTPREFIX, Msg);
|
||||
|
||||
c = Client_Next( c );
|
||||
}
|
||||
} /* Wall_ServerNotice */
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* (at your option) any later version.
|
||||
* Please read the file COPYING, README and AUTHORS for more information.
|
||||
*
|
||||
* $Id: log.h,v 1.18 2005/06/24 19:55:10 alex Exp $
|
||||
* $Id: log.h,v 1.18.2.1 2006/02/08 21:23:21 fw Exp $
|
||||
*
|
||||
* Logging functions (header)
|
||||
*/
|
||||
@@ -39,6 +39,7 @@ GLOBAL void Log_Init PARAMS(( bool Daemon_Mode ));
|
||||
GLOBAL void Log_Exit PARAMS(( void ));
|
||||
|
||||
GLOBAL void Log PARAMS(( int Level, const char *Format, ... ));
|
||||
GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
|
||||
|
||||
GLOBAL void Log_Init_Resolver PARAMS(( void ));
|
||||
GLOBAL void Log_Exit_Resolver PARAMS(( void ));
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: ngircd.c,v 1.102 2005/06/24 19:55:10 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: ngircd.c,v 1.102.2.2 2005/07/08 23:20:04 alex Exp $";
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -712,28 +712,34 @@ NGIRCd_Init( bool NGIRCd_NoDaemon )
|
||||
}
|
||||
}
|
||||
|
||||
if ( Conf_UID == 0 ) {
|
||||
Log( LOG_INFO, "Conf_UID must not be 0, switching to user nobody", Conf_UID );
|
||||
if (Conf_UID == 0) {
|
||||
Log(LOG_INFO, "ServerUID must not be 0, using \"nobody\" instead.", Conf_UID);
|
||||
|
||||
if (!NGIRCd_getNobodyID(&Conf_UID, &Conf_GID )) {
|
||||
Log( LOG_WARNING, "Could not get uid/gid of user nobody: %s",
|
||||
if (! NGIRCd_getNobodyID(&Conf_UID, &Conf_GID)) {
|
||||
Log(LOG_WARNING, "Could not get user/group ID of user \"nobody\": %s",
|
||||
errno ? strerror(errno) : "not found" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( setgid( Conf_GID ) != 0 ) {
|
||||
real_errno = errno;
|
||||
Log( LOG_ERR, "Can't change group ID to %u: %s", Conf_GID, strerror( errno ));
|
||||
if (real_errno != EPERM)
|
||||
return false;
|
||||
if (getgid() != Conf_GID) {
|
||||
/* Change group ID */
|
||||
if (setgid(Conf_GID) != 0) {
|
||||
real_errno = errno;
|
||||
Log( LOG_ERR, "Can't change group ID to %u: %s", Conf_GID, strerror( errno ));
|
||||
if (real_errno != EPERM)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( setuid( Conf_UID ) != 0 ) {
|
||||
real_errno = errno;
|
||||
Log( LOG_ERR, "Can't change user ID to %u: %s", Conf_UID, strerror( errno ));
|
||||
if (real_errno != EPERM)
|
||||
return false;
|
||||
if (getuid() != Conf_UID) {
|
||||
/* Change user ID */
|
||||
if (setuid(Conf_UID) != 0) {
|
||||
real_errno = errno;
|
||||
Log(LOG_ERR, "Can't change user ID to %u: %s", Conf_UID, strerror(errno));
|
||||
if (real_errno != EPERM)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
@@ -765,16 +771,14 @@ NGIRCd_Init( bool NGIRCd_NoDaemon )
|
||||
|
||||
Pidfile_Create( pid );
|
||||
|
||||
/* check uid we are running as, can be different from values configured (e.g. if we were already
|
||||
started with a uid > 0 */
|
||||
/* Check UID/GID we are running as, can be different from values
|
||||
* configured (e. g. if we were already started with a UID>0. */
|
||||
Conf_UID = getuid();
|
||||
Conf_GID = getgid();
|
||||
|
||||
assert( Conf_GID > 0);
|
||||
assert( Conf_UID > 0);
|
||||
|
||||
pwd = getpwuid( Conf_UID );
|
||||
grp = getgrgid( Conf_GID );
|
||||
|
||||
Log( LOG_INFO, "Running as user %s(%ld), group %s(%ld), with PID %ld.",
|
||||
pwd ? pwd->pw_name : "unknown", Conf_UID,
|
||||
grp ? grp->gr_name : "unknown", Conf_GID, pid);
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: parse.c,v 1.63 2005/06/24 20:56:46 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: parse.c,v 1.63.2.1 2005/07/24 21:06:51 alex Exp $";
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -317,7 +317,7 @@ Validate_Prefix( CONN_ID Idx, REQUEST *Req, bool *Closed )
|
||||
|
||||
|
||||
LOCAL bool
|
||||
Validate_Command( CONN_ID Idx, REQUEST *Req, bool *Closed )
|
||||
Validate_Command( UNUSED CONN_ID Idx, UNUSED REQUEST *Req, bool *Closed )
|
||||
{
|
||||
assert( Idx >= 0 );
|
||||
assert( Req != NULL );
|
||||
@@ -328,7 +328,7 @@ Validate_Command( CONN_ID Idx, REQUEST *Req, bool *Closed )
|
||||
|
||||
|
||||
LOCAL bool
|
||||
Validate_Args( CONN_ID Idx, REQUEST *Req, bool *Closed )
|
||||
Validate_Args( UNUSED CONN_ID Idx, UNUSED REQUEST *Req, bool *Closed )
|
||||
{
|
||||
assert( Idx >= 0 );
|
||||
assert( Req != NULL );
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: resolve.c,v 1.12 2005/05/28 10:46:50 fw Exp $";
|
||||
static char UNUSED id[] = "$Id: resolve.c,v 1.12.2.1 2005/09/02 22:07:38 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -108,6 +108,8 @@ Resolve_Addr( struct sockaddr_in *Addr )
|
||||
else
|
||||
{
|
||||
/* Error! */
|
||||
close(s->pipe[0]);
|
||||
close(s->pipe[1]);
|
||||
free( s );
|
||||
Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
|
||||
return NULL;
|
||||
@@ -149,6 +151,8 @@ Resolve_Name( char *Host )
|
||||
else
|
||||
{
|
||||
/* Error! */
|
||||
close(s->pipe[0]);
|
||||
close(s->pipe[1]);
|
||||
free( s );
|
||||
Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user