AUTHORS | 2 +- ChangeLog | 50 ++++++++++++++++++++++++-- INSTALL | 2 +- Makefile.am | 2 +- NEWS | 13 ++++++- README | 2 +- configure.ng | 54 ++++++++++++++++++++++++---- contrib/Debian/changelog | 6 ++++ contrib/MacOSX/config.h | 2 ++ contrib/MacOSX/ngIRCd.pmdoc/index.xml | 2 +- contrib/ngircd.spec | 2 +- contrib/platformtest.sh | 4 +-- doc/Makefile.am | 4 +-- doc/Platforms.txt | 40 ++++++++++++--------- doc/Services.txt | 16 ++++++--- src/ipaddr/ng_ipaddr.c | 2 +- src/ngircd/class.c | 6 ++-- src/ngircd/conf-ssl.h | 2 +- src/ngircd/conf.c | 17 +++++---- src/ngircd/conn-encoding.c | 2 +- src/ngircd/conn.c | 2 ++ src/ngircd/irc-login.c | 5 ++- src/ngircd/irc-op.c | 3 +- src/ngircd/irc-oper.c | 6 +++- src/ngircd/irc.c | 2 -- src/ngircd/login.c | 51 +++++++++++++------------- src/ngircd/ngircd.c | 4 +-- src/ngircd/parse.c | 2 +- src/ngircd/resolve.c | 2 +- src/portab/portabtest.c | 2 ++ src/portab/vsnprintf.c | 67 +++++++++++++++++++++++------------ 31 files changed, 268 insertions(+), 108 deletions(-) diff --git a/AUTHORS b/AUTHORS index 605df2d..a91c59e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,7 +2,7 @@ ngIRCd - Next Generation IRC Server http://ngircd.barton.de/ - (c)2001-2013 Alexander Barton and Contributors. + (c)2001-2014 Alexander Barton and Contributors. ngIRCd is free software and published under the terms of the GNU General Public License. diff --git a/ChangeLog b/ChangeLog index 90821a2..a732af9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,19 +2,65 @@ ngIRCd - Next Generation IRC Server http://ngircd.barton.de/ - (c)2001-2013 Alexander Barton and Contributors. + (c)2001-2014 Alexander Barton and Contributors. ngIRCd is free software and published under the terms of the GNU General Public License. -- ChangeLog -- +ngIRCd 21.1 (2014-03-25) + + - Don't ignore but use the server password when PAM is compiled in but + disabled. Thanks to Roy Sindre Norangshol ! + - doc/Platforms.txt: Update from master branch. + - Really kill connections that send "spoofed prefixes" on non-server links. + This fixes commit 6cbe1308 which only killed the connection when the + spoofed prefix itself belonged to a non-server client. + - CHARCONV command: Fix handling conversion errors, don't overwrite already + converted text! + - doc/Services.txt: Update information for Anope 2.x. + - Correctly use cloaked IRC masks on "INVITE nickname": The cloaked IRC mask + of a user is his visible mask, so the daemon has to use it for generating + the "one time" entries for the invite list of the given channel, and not + the "real" mask which will never match while the target client is "+x", and + even worse, will disclose the real mask on "MODE #channel +I" commands :-/ + Bug reported by Cahata on #ngircd, thanks! + - configure: Only link "contrib/Debian" if it exists. This isn't the case on + "VPATH builds", for example. + - Use $(MKDIR_P) instead of $(mkinstalldirs) in Makefile's and test for + "mkdir -p" using AC_PROG_MKDIR_P in "configure". + - Fix configure script and "make check" for TCP Wrappers (problems spotted on + OpenBSD): add missing #include's and static variables, and add libwrap at + the end of the configure run because if libwrap becomes added earlier, + other tests may fail. + - configure: add support for the LDFLAGS_END and LIBS_END variables to add + linker flags and libraries at the end of the configure run (CFLAGS_END has + been implemented already). + - platformtest.sh and Makefile.am: Don't use "test -e", it isn't portable. + - Update Copyright notices for 2014 :-) + - Fix permanent {G|K}LINES (with a timeout of 0 seconds). + - WEBIRC: Don't set the hostname received by the WEBIRC command when DNS + lookups are disabled, but use the IP address instead. + Reported by Toni Spets , thanks! + - Check for working getaddrinfo() function: At least AIX 4.3.3 and 5.1 have a + broken implementation of getaddrinfo() which doesn't handle "0" as numeric + service correctly. This patch adds a configure check for this case and + changes all calling functions to only use getaddrinfo() if it "works". + See + - Only use the unsetenv() function when it is available (AIX 4.3 doesn't + support it, for example). + - Make sure that the source code is still compatible with the "ansi2knr" tool + and builds using non-ANSI K&R C compilers. Tested with Apple C on A/UX. + - Fix building ngIRCd without support for ZLIB compression. Reported by + "der_baer" on #ngircd, thanks! + ngIRCd 21 (2013-10-30) - ./contrib/Debian/ngircd.init: Make sure no stale PID file is left over when (re-)starting ngIRCd. - Change ./contrib/platformtest.sh and update ./doc/Platforms.txt to - allow usernames up to 8 characters. + allow user names up to 8 characters. - Call arc4random_stir() in forked subprocesses, when available. This is required by FreeBSD <10 and current NetBSD at least to correctly initialize the "arc4" random number generator on these platforms. diff --git a/INSTALL b/INSTALL index bbff1f2..998274a 100644 --- a/INSTALL +++ b/INSTALL @@ -2,7 +2,7 @@ ngIRCd - Next Generation IRC Server http://ngircd.barton.de/ - (c)2001-2013 Alexander Barton and Contributors. + (c)2001-2014 Alexander Barton and Contributors. ngIRCd is free software and published under the terms of the GNU General Public License. diff --git a/Makefile.am b/Makefile.am index 0b797c1..11c382e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,7 @@ osxpkg: have-packagemaker osxpkg-dest make osxpkg-clean osxpkg-clean: - [ ! -e ngircd.dest ] || sudo -n rm -rf ngircd.dest + [ ! -r ngircd.dest ] || sudo -n rm -rf ngircd.dest rm -rf ngircd.dest $(distdir).mpkg osxpkg-dest: have-xcodebuild osxpkg-clean clean diff --git a/NEWS b/NEWS index ebbc022..2f2ac67 100644 --- a/NEWS +++ b/NEWS @@ -2,13 +2,24 @@ ngIRCd - Next Generation IRC Server http://ngircd.barton.de/ - (c)2001-2013 Alexander Barton and Contributors. + (c)2001-2014 Alexander Barton and Contributors. ngIRCd is free software and published under the terms of the GNU General Public License. -- NEWS -- +ngIRCd 21.1 (2014-03-25) + + - Don't ignore but use the server password when PAM is compiled in but + disabled. Thanks to Roy Sindre Norangshol ! + - doc/Platforms.txt: Update from master branch. + - doc/Services.txt: Update information for Anope 2.x. + - configure: add support for the LDFLAGS_END and LIBS_END variables to add + linker flags and libraries at the end of the configure run (CFLAGS_END has + been implemented already). + - Update Copyright notices for 2014 :-) + ngIRCd 21 (2013-10-30) - Call arc4random_stir() in forked subprocesses, when available. This diff --git a/README b/README index c903aa1..4bcafb2 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ ngIRCd - Next Generation IRC Server http://ngircd.barton.de/ - (c)2001-2013 Alexander Barton and Contributors. + (c)2001-2014 Alexander Barton and Contributors. ngIRCd is free software and published under the terms of the GNU General Public License. diff --git a/configure.ng b/configure.ng index e3f51cf..6338995 100644 --- a/configure.ng +++ b/configure.ng @@ -67,6 +67,7 @@ AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +AC_PROG_MKDIR_P AC_PROG_RANLIB # -- Compiler Features -- @@ -92,6 +93,35 @@ AC_DEFUN([GCC_STACK_PROTECT_CC],[ fi ]) +AC_DEFUN([WORKING_GETADDRINFO],[ + AC_CHECK_FUNCS([getaddrinfo],[ + AC_MSG_CHECKING([whether getaddrinfo() works]) + AC_TRY_RUN([ +#include +#include +#include +#include +int +main(int argc, char **argv) +{ + struct addrinfo hints, *ai; + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + hints.ai_family = PF_UNSPEC; + if(getaddrinfo(NULL, "0", &hints, &ai) != 0) + return 1; + return 0; +} + ],[ + AC_DEFINE([HAVE_WORKING_GETADDRINFO], 1, [getaddrinfo(0)]) + AC_MSG_RESULT(yes) + ],[ + AC_MSG_RESULT(no) + ]) + ]) +]) + if test "$GCC" = "yes"; then # We are using the GNU C compiler. Good! CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes" @@ -186,10 +216,12 @@ AC_CHECK_FUNCS([ \ AC_MSG_ERROR([required function missing!])) # Optional functions -AC_CHECK_FUNCS_ONCE([ \ - arc4random arc4random_stir gai_strerror getaddrinfo getnameinfo inet_aton +AC_CHECK_FUNCS_ONCE([ + arc4random arc4random_stir gai_strerror getnameinfo inet_aton \ sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \ - strtok_r waitpid]) + strtok_r unsetenv waitpid]) + +WORKING_GETADDRINFO # -- Configuration options -- @@ -432,8 +464,12 @@ AC_ARG_WITH(tcp-wrappers, LDFLAGS="-L$withval/lib $LDFLAGS" fi AC_MSG_CHECKING(for hosts_access) + saved_LIBS="$LIBS" LIBS="-lwrap $LIBS" + LIBS_END="-lwrap $LIBS_END" AC_TRY_LINK([ +#include +#include #include int allow_severity = 0; int deny_severity = 0; @@ -447,6 +483,7 @@ int deny_severity = 0; AC_MSG_RESULT(no) AC_MSG_ERROR([Can't enable TCP wrappers!]) ]) + LIBS="$saved_LIBS" fi ] ) @@ -602,9 +639,12 @@ AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" ) AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" ) AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" ) -# Add additional CFLAGS, eventually specified on the command line, but after -# running this configure script. Useful for "-Werror" for example. +# Add additional CFLAGS, LDFLAGS and LIBS which were specified on the command +# line or by some tests from above, but after running this script. Useful for +# adding "-Werror", for example: test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END" +test -n "$LDFLAGS_END" && LDFLAGS="$LDFLAGS $LDFLAGS_END" +test -n "$LIBS_END" && LIBS="$LIBS $LIBS_END" # -- Generate files -- @@ -633,7 +673,9 @@ if test $? -eq 0; then # Generate debian/ link if the dpkg command exists # (read: if we are running on a debian compatible system) echo "creating Debian-specific links ..." - test -f debian/rules || ln -s contrib/Debian debian + if test ! -f debian/rules -a -f contrib/Debian/rules; then + ln -s contrib/Debian debian + fi fi # -- Result -- diff --git a/contrib/Debian/changelog b/contrib/Debian/changelog index 76edf13..f833236 100644 --- a/contrib/Debian/changelog +++ b/contrib/Debian/changelog @@ -1,3 +1,9 @@ +ngircd (21.1-0ab1) unstable; urgency=low + + * New "upstream" release: ngIRCd 21.1. + + -- Alexander Barton Tue, 25 Mar 2014 14:44:59 +0100 + ngircd (21-0ab1) unstable; urgency=low * New "upstream" release: ngIRCd 21. diff --git a/contrib/MacOSX/config.h b/contrib/MacOSX/config.h index 9374ab5..761a68e 100644 --- a/contrib/MacOSX/config.h +++ b/contrib/MacOSX/config.h @@ -105,6 +105,8 @@ #define HAVE_INET_ATON 1 /* Define to 1 if you have the `getaddrinfo' function. */ #define HAVE_GETADDRINFO 1 +/* getaddrinfo(0) */ +#define HAVE_WORKING_GETADDRINFO 1 /* Define to 1 if you have the `getnameinfo' function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the `sigaction' function. */ diff --git a/contrib/MacOSX/ngIRCd.pmdoc/index.xml b/contrib/MacOSX/ngIRCd.pmdoc/index.xml index 90e3aed..0c8cc55 100644 --- a/contrib/MacOSX/ngIRCd.pmdoc/index.xml +++ b/contrib/MacOSX/ngIRCd.pmdoc/index.xml @@ -5,7 +5,7 @@ \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural \f0\i\fs24 \cf0 ngIRCd -- The Next Generation IRC Daemon\ -Copyright (c)2001-2013 Alexander Barton and Contributors.\ +Copyright (c)2001-2014 Alexander Barton and Contributors.\ \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural \i0 \cf0 \ diff --git a/contrib/ngircd.spec b/contrib/ngircd.spec index ab4e0c9..c49eff6 100644 --- a/contrib/ngircd.spec +++ b/contrib/ngircd.spec @@ -1,5 +1,5 @@ %define name ngircd -%define version 21 +%define version 21.1 %define release 1 %define prefix %{_prefix} diff --git a/contrib/platformtest.sh b/contrib/platformtest.sh index 6a1dc71..76f4169 100755 --- a/contrib/platformtest.sh +++ b/contrib/platformtest.sh @@ -1,7 +1,7 @@ #!/bin/sh # # ngIRCd -- The Next Generation IRC Daemon -# Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors +# Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors # # 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 @@ -65,7 +65,7 @@ if [ -d .git ]; then fi echo "$NAME: Checking for \"./configure\" script ..." -if [ ! -e ./configure ]; then +if [ ! -r ./configure ]; then echo "$NAME: Running \"./autogen.sh\" ..." [ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null fi diff --git a/doc/Makefile.am b/doc/Makefile.am index 04f74b6..27942dd 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -54,11 +54,11 @@ maintainer-clean-local: all: $(generated_docs) install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs) - $(mkinstalldirs) $(DESTDIR)$(sysconfdir) + $(MKDIR_P) -m 755 $(DESTDIR)$(sysconfdir) @if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \ make install-config; \ fi - $(mkinstalldirs) $(DESTDIR)$(docdir) + $(MKDIR_P) -m 755 $(DESTDIR)$(docdir) for f in $(static_docs) $(toplevel_docs); do \ $(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \ done diff --git a/doc/Platforms.txt b/doc/Platforms.txt index 5d53451..13dbff2 100644 --- a/doc/Platforms.txt +++ b/doc/Platforms.txt @@ -31,6 +31,7 @@ armv6l/unk./linux-gnueabi gcc 4.7.2 20.2 13-03-08 goetz Y Y Y Y 5 armv6l/unk./linux-gnueabihf gcc 4.6.3 21~rc2 13-10-26 pi Y Y Y Y 5 armv7l/unk./linux-gnueabi gcc 4.4.3 19.1 12-04-29 goetz Y Y Y Y 5 hppa/unknown/openbsd3.5 gcc 2.95.3 CVSHEAD 04-05-25 alex Y Y Y Y +hppa/unknown/openbsd5.4 gcc 4.2.1 21 13-11-10 alex Y Y Y Y 3 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 13~rc1 08-12-02 alex Y Y Y Y hppa2.0w-hp-hpux11.11 gcc 4.2.3 14.1 09-07-22 goetz Y Y Y Y @@ -44,19 +45,22 @@ i386/unknown/freebsd6.2 gcc 3.4.6 20~rc1 12-11-13 alex Y Y Y Y 3 i386/unknown/freebsd7.3 gcc 4.2.1 20~rc1 12-11-13 alex Y Y Y Y 3 i686/pc/minix gcc 4.4.6 21~rc2 13-10-27 alex Y Y N N i686/unknown/gnu0.3 gcc 4.4.5 19 12-02-29 alex Y Y Y Y -i686/unknown/gnu0.5 gcc 4.8.1 21~rc2 13-10-27 alex Y Y Y Y +i686/unknown/gnu0.5 gcc 4.8.2 21 14-02-09 alex Y Y Y Y i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y 3 +i386/unknown/netbsdelf1.5.2 egcs-1.1.2 21 13-11-25 goetz Y Y N Y i386/unknown/netbsdelf1.6.2 gcc 2.95.3 18 11-07-10 goetz Y Y Y Y i386/unknown/netbsdelf3.0.1 gcc 3.3.3 0.10.0-p1 06-08-30 alex Y Y Y Y 3 i386/unknown/netbsdelf4.0 gcc 4.1.2 19 12-02-29 alex Y Y Y Y 3 i386/unknown/netbsdelf5.0.2 gcc 4.1.3 19 12-02-26 alex Y Y Y Y 3 +i386/unknown/openbsd3.5 gcc 2.95.3 21 13-11-17 goetz Y Y Y Y 3 i386/unknown/openbsd3.9 gcc 3.3.5 0.10.0-p1 06-08-30 alex Y Y Y Y 3 i386/unknown/openbsd4.1 gcc 3.3.5 16 10-04-11 alex Y Y Y Y 3 -i386/unknown/openbsd5.3 gcc 4.2.1 21~rc2 13-10-21 dspruell Y Y Y Y 3 +i386/unknown/openbsd5.3 gcc 4.2.1 21 13-11-28 goetz Y Y Y Y 3 +i386/unknown/openbsd5.4 gcc 4.2.1 21 13-11-28 goetz Y Y Y Y 3 i586/pc/haiku gcc 2.95.3 19.2~138 12-10-11 user Y Y N N i586/pc/interix3.5 gcc 3.3 19 12-02-29 alex Y Y N Y -i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y N Y -i686/pc/linux-gnu gcc 2.7.2 19.1 12-05-30 goetz Y Y Y Y 1 +i686/pc/cygwin gcc 4.8.2 21 14-01-02 alex Y Y N Y +i686/pc/linux-gnu gcc 2.7.2 21~38 14-01-06 goetz Y Y Y Y 1 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.5 14.1 09-08-04 alex Y Y Y Y 1 i386/pc/linux-gnu gcc 4.1.2 13~rc1 08-12-05 alex Y Y Y Y 1 @@ -68,10 +72,11 @@ m68k/apple/aux3.1.1 Orig. A/UX 19 12-02-26 alex Y Y N 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 ? ? mipsel/unknown/linux-gnu gcc 4.1.2 18 11-07-05 goetz Y Y N Y 1 -mipsel/unknown/linux-gnu gcc 4.4.5 18 11-07-30 goetz Y Y Y Y 1 -powerpc/apple/darwin6.5 gcc 3.1 0.7.x-CVS 03-04-23 alex Y Y Y Y -powerpc/apple/darwin7.9.0 gcc 3.3 19.1 12-05-22 goetz Y Y Y Y 3 +mipsel/unknown/linux-gnu gcc 4.4.5 21 13-11-24 goetz Y Y Y Y 1 +powerpc/apple/darwin6.8 gcc 3.1 21 14-01-03 goetz Y Y Y Y +powerpc/apple/darwin7.9.0 gcc 3.3 21 14-01-11 goetz Y Y Y Y 3 powerpc/apple/darwin8.11.0 gcc 4.0.1 18 11-07-02 goetz Y Y Y Y 3 +powerpc/apple/darwin9.8.0 gcc 4.0.1 21 14-01-04 goetz Y Y Y Y 3 powerpc/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y powerpc/unknown/openbsd3.6 gcc 2.95.3 0.10.0 06-10-08 alex Y Y N Y sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y @@ -79,17 +84,20 @@ sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y x86_64/apple/darwin10.8.0 gcc 4.2.1 21~rc2 13-10-30 alex Y Y Y Y 3 x86_64/apple/darwin12.3.0 gcc 4.2.1 20.2 13-04-01 alex Y Y Y Y 3 -x86_64/apple/darwin13.0.0 A-clang 5.0 21~rc2 13-10-20 alex Y Y Y Y 3 -x86_64/unknown/freebsd8.4 gcc 4.2.1 21~rc2 13-10-27 alex Y Y Y Y 3 -x86_64/unknown/freebsd9.1 gcc 4.2.1 21~rc2 13-10-27 alex Y Y Y Y 3 +x86_64/apple/darwin13.0.0 A-clang 5.0 21 14-01-02 alex Y Y Y Y 3 +x86_64/unknown/dragonfly3.4 gcc 4.7.2 21 13-11-12 goetz Y Y N Y 3 +x86_64/unknown/freebsd8.4 gcc 4.2.1 21 14-01-02 alex Y Y Y Y 3 +x86_64/unknown/freebsd9.1 gcc 4.2.1 21 14-01-02 alex Y Y Y Y 3 x86_64/unkn./freebsd8.1-gnu gcc 4.4.5 19 12-02-26 alex Y Y Y Y 3 -x86_64/unknown/linux-gnu clang 3.2 21~rc2 13-10-20 alex Y Y Y Y 1 -x86_64/unknown/linux-gnu gcc 4.8.1 21~rc2 13-10-20 alex Y Y Y Y 1 -x86_64/unknown/linux-gnu Open64 20.3 13-10-16 goetz Y Y Y Y 1 -x86_64/unknown/linux-gnu tcc 0.9.25 20.3 13-10-16 goetz Y Y Y Y 1 +x86_64/unknown/linux-gnu clang 3.3 21 14-01-07 alex Y Y Y Y 1 +x86_64/unknown/linux-gnu gcc 4.8.2 21 13-12-29 alex Y Y Y Y 1 +x86_64/unknown/linux-gnu nwcc 0.8.2 21 13-12-01 goetz Y Y Y Y 1 +x86_64/unknown/linux-gnu Open64 21 13-11-30 goetz Y Y Y Y 1 +x86_64/unknown/linux-gnu Sun C 5.12 21 13-11-22 goetz Y Y Y Y 1 +x86_64/unknown/linux-gnu tcc 0.9.25 21 13-11-30 goetz Y Y Y Y 1 x86_64/unknown/openbsd4.7 gcc 3.3.5 20~rc1 12-02-26 alex Y Y Y Y 3 -x86_64/unknown/openbsd4.8 gcc 4.2.1 21~rc2 13-10-27 alex Y Y Y Y 3 -x86_64/unknown/openbsd5.1 gcc 4.2.1 21~rc2 13-10-27 alex Y Y Y Y 3 +x86_64/unknown/openbsd4.8 gcc 4.2.1 21 13-12-28 alex Y Y Y Y 3 +x86_64/unknown/openbsd5.1 gcc 4.2.1 21 13-12-28 alex Y Y Y Y 3 * Notes diff --git a/doc/Services.txt b/doc/Services.txt index 2704f02..2cef778 100644 --- a/doc/Services.txt +++ b/doc/Services.txt @@ -41,8 +41,8 @@ Example: ServiceMask = *Serv -Setting up Anope 1.9.x -~~~~~~~~~~~~~~~~~~~~~~ +Setting up Anope 1.9.x & 2.x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Anope 1.9.8 or later () can be used with ngIRCd using the "ngircd" protocol module. @@ -66,20 +66,28 @@ In conf/services.conf: } # Load ngIRCd protocol module - module { name = "ngircd" } + module + { + name = "ngircd" + } networkinfo { # Must be set to the "MaxNickLength" setting of ngIRCd! nicklen = 9 + # When not using "strict mode", which is the default: + userlen = 20 + chanlen = 50 } In conf/nickserv.conf: - nickserv + module { + name = "nickserv" + # not required if you are running ngIRCd with a higher nickname limit # ("MaxNickLength") than 11 characters, but REQUIRED by default! guestnickprefix = "G-" diff --git a/src/ipaddr/ng_ipaddr.c b/src/ipaddr/ng_ipaddr.c index 9cf35ec..37f75b6 100644 --- a/src/ipaddr/ng_ipaddr.c +++ b/src/ipaddr/ng_ipaddr.c @@ -23,7 +23,7 @@ GLOBAL bool ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) { -#ifdef HAVE_GETADDRINFO +#ifdef HAVE_WORKING_GETADDRINFO int ret; char portstr[64]; struct addrinfo *res0; diff --git a/src/ngircd/class.c b/src/ngircd/class.c index b2b1aa3..d08f4c5 100644 --- a/src/ngircd/class.c +++ b/src/ngircd/class.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. * * 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 @@ -50,11 +50,13 @@ Class_Exit(void) GLOBAL bool Class_GetMemberReason(const int Class, CLIENT *Client, char *reason, size_t len) { - char str[COMMAND_LEN] = "listed"; + char str[COMMAND_LEN]; assert(Class < CLASS_COUNT); assert(Client != NULL); + strlcpy(str, "listed", sizeof(str)); + if (!Lists_CheckReason(&My_Classes[Class], Client, str, sizeof(str))) return false; diff --git a/src/ngircd/conf-ssl.h b/src/ngircd/conf-ssl.h index 439298c..c237379 100644 --- a/src/ngircd/conf-ssl.h +++ b/src/ngircd/conf-ssl.h @@ -42,7 +42,7 @@ struct ConnSSL_State { #endif -bool ConnSSL_InitLibrary(void); +GLOBAL bool ConnSSL_InitLibrary PARAMS((void)); #endif /* conf_ssl_h */ diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 1627587..7a4cb28 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. * * 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 @@ -369,9 +369,8 @@ Conf_Test( void ) printf(" MotdPhrase = %s\n", array_bytes(&Conf_Motd) ? (const char*) array_start(&Conf_Motd) : ""); } -#ifndef PAM - printf(" Password = %s\n", Conf_ServerPwd); -#endif + if (!Conf_PAM) + printf(" Password = %s\n", Conf_ServerPwd); printf(" PidFile = %s\n", Conf_PidFile); printf(" Ports = "); ports_puts(&Conf_ListenPorts); @@ -1052,9 +1051,13 @@ Read_Config(bool TestOnly, bool IsStarting) } /** - * ... + * Read in and handle a configuration file. + * + * @param File Name of the configuration file. + * @param fd File descriptor already opened for reading. */ -static void Read_Config_File(const char *File, FILE *fd) +static void +Read_Config_File(const char *File, FILE *fd) { char section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr; int i, line = 0; @@ -2243,7 +2246,7 @@ Validate_Config(bool Configtest, bool Rehash) } #ifdef PAM - if (Conf_ServerPwd[0]) + if (Conf_PAM && Conf_ServerPwd[0]) Config_Error(LOG_ERR, "This server uses PAM, \"Password\" in [Global] section will be ignored!"); #endif diff --git a/src/ngircd/conn-encoding.c b/src/ngircd/conn-encoding.c index 98cd29a..d0c5630 100644 --- a/src/ngircd/conn-encoding.c +++ b/src/ngircd/conn-encoding.c @@ -125,7 +125,7 @@ Convert_Message(iconv_t Handle, char *Message) if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) { /* An error occurred! */ LogDebug("Error converting message encoding!"); - strlcpy(Encoding_Buffer, Message, sizeof(Encoding_Buffer)); + strlcpy(out, Message, sizeof(Encoding_Buffer)); iconv(Handle, NULL, NULL, NULL, NULL); } else *out = '\0'; diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 324fa42..e8bfcf1 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -152,7 +152,9 @@ my_sd_listen_fds(void) if (!e || !*e) return -1; count = atoi(e); +#ifdef HAVE_UNSETENV unsetenv("LISTEN_FDS"); +#endif return count; } diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 4695272..dc2f6e3 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -613,7 +613,10 @@ IRC_WEBIRC(CLIENT *Client, REQUEST *Req) Client_SetUser(Client, Req->argv[1], true); Client_SetOrigUser(Client, Req->argv[1]); - Client_SetHostname(Client, Req->argv[2]); + if (Conf_DNS) + Client_SetHostname(Client, Req->argv[2]); + else + Client_SetHostname(Client, Req->argv[3]); Client_SetIPAText(Client, Req->argv[3]); return CONNECTED; diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c index 5212687..b32a8e6 100644 --- a/src/ngircd/irc-op.c +++ b/src/ngircd/irc-op.c @@ -195,7 +195,8 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) if (remember) { /* We must remember this invite */ - if (!Channel_AddInvite(chan, Client_Mask(target), true)) + if (!Channel_AddInvite(chan, Client_MaskCloaked(target), + true)) return CONNECTED; } } diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 4ccc76a..2c2ea3c 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -389,6 +389,7 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req) CLIENT *from, *c, *c_next; char reason[COMMAND_LEN], class_c; struct list_head *list; + time_t timeout; int class; assert(Client != NULL); @@ -435,8 +436,11 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req) } } else { /* Add new mask to list */ + timeout = atol(Req->argv[1]); + if (timeout > 0) + timeout += time(NULL); if (Class_AddMask(class, Req->argv[0], - time(NULL) + atol(Req->argv[1]), + timeout, Req->argv[2])) { Log(LOG_NOTICE|LOG_snotice, "\"%s\" added \"%s\" to %c-Line list: \"%s\" (%ld seconds).", diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index ee7972c..b2d865f 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -478,9 +478,7 @@ Option_String(UNUSED CONN_ID Idx) #endif { static char option_txt[8]; -#ifdef ZLIB UINT16 options; -#endif assert(Idx != NONE); diff --git a/src/ngircd/login.c b/src/ngircd/login.c index 4011b8b..23c3b68 100644 --- a/src/ngircd/login.c +++ b/src/ngircd/login.c @@ -91,13 +91,12 @@ Login_User(CLIENT * Client) #ifdef PAM if (!Conf_PAM) { - /* Don't do any PAM authentication at all, instead emulate - * the behavior of the daemon compiled without PAM support: - * because there can't be any "server password", all - * passwords supplied are classified as "wrong". */ - if(Conn_Password(conn)[0] == '\0') + /* Don't do any PAM authentication at all if PAM is not + * enabled, instead emulate the behavior of the daemon + * compiled without PAM support. */ + if (strcmp(Conn_Password(conn), Conf_ServerPwd) == 0) return Login_User_PostAuth(Client); - Client_Reject(Client, "Non-empty password", false); + Client_Reject(Client, "Bad server password", false); return DISCONNECTED; } @@ -111,25 +110,27 @@ Login_User(CLIENT * Client) return Login_User_PostAuth(Client); } - /* Fork child process for PAM authentication; and make sure that the - * process timeout is set higher than the login timeout! */ - pid = Proc_Fork(Conn_GetProcStat(conn), pipefd, - cb_Read_Auth_Result, Conf_PongTimeout + 1); - if (pid > 0) { - LogDebug("Authenticator for connection %d created (PID %d).", - conn, pid); - return CONNECTED; - } else { - /* Sub process */ - Log_Init_Subprocess("Auth"); - Conn_CloseAllSockets(NONE); - result = PAM_Authenticate(Client); - if (write(pipefd[1], &result, sizeof(result)) != sizeof(result)) - Log_Subprocess(LOG_ERR, - "Failed to pipe result to parent!"); - Log_Exit_Subprocess("Auth"); - exit(0); - } + if (Conf_PAM) { + /* Fork child process for PAM authentication; and make sure that the + * process timeout is set higher than the login timeout! */ + pid = Proc_Fork(Conn_GetProcStat(conn), pipefd, + cb_Read_Auth_Result, Conf_PongTimeout + 1); + if (pid > 0) { + LogDebug("Authenticator for connection %d created (PID %d).", + conn, pid); + return CONNECTED; + } else { + /* Sub process */ + Log_Init_Subprocess("Auth"); + Conn_CloseAllSockets(NONE); + result = PAM_Authenticate(Client); + if (write(pipefd[1], &result, sizeof(result)) != sizeof(result)) + Log_Subprocess(LOG_ERR, + "Failed to pipe result to parent!"); + Log_Exit_Subprocess("Auth"); + exit(0); + } + } else return CONNECTED; #else /* Check global server password ... */ if (strcmp(Conn_Password(conn), Conf_ServerPwd) != 0) { diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index da53705..05f7a71 100644 --- a/src/ngircd/ngircd.c +++ b/src/ngircd/ngircd.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. * * 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 @@ -460,7 +460,7 @@ static void Show_Version( void ) { puts( NGIRCd_Version ); - puts( "Copyright (c)2001-2013 Alexander Barton () and Contributors." ); + puts( "Copyright (c)2001-2014 Alexander Barton () and Contributors." ); puts( "Homepage: \n" ); puts( "This is free software; see the source for copying conditions. There is NO" ); puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." ); diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index 2c7ba94..ba4d8f5 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -345,7 +345,7 @@ Validate_Prefix( CONN_ID Idx, REQUEST *Req, bool *Closed ) /* check if the client named in the prefix is expected * to come from that direction */ if (Client_NextHop(c) != client) { - if (Client_Type(c) != CLIENT_SERVER) { + if (Client_Type(client) != CLIENT_SERVER) { Log(LOG_ERR, "Spoofed prefix \"%s\" from \"%s\" (connection %d, command \"%s\"), closing connection!", Req->prefix, Client_ID(client), Idx, Req->command); diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index 6078da8..01f730c 100644 --- a/src/ngircd/resolve.c +++ b/src/ngircd/resolve.c @@ -242,7 +242,7 @@ ForwardLookup(const char *hostname, array *IpAddr, int af) { ng_ipaddr_t addr; -#ifdef HAVE_GETADDRINFO +#ifdef HAVE_WORKING_GETADDRINFO int res; struct addrinfo *a, *ai_results; static struct addrinfo hints; diff --git a/src/portab/portabtest.c b/src/portab/portabtest.c index 09afbfd..b55ff97 100644 --- a/src/portab/portabtest.c +++ b/src/portab/portabtest.c @@ -24,6 +24,8 @@ #include "exp.h" +int allow_severity = 0, deny_severity = 0; + static void Panic PARAMS (( char *Reason, int Code )); diff --git a/src/portab/vsnprintf.c b/src/portab/vsnprintf.c index c97a53e..0c9e579 100644 --- a/src/portab/vsnprintf.c +++ b/src/portab/vsnprintf.c @@ -109,15 +109,16 @@ void dummy_snprintf PARAMS(( void )) { } #define LLONG long #endif -static size_t dopr(char *buffer, size_t maxlen, const char *format, - va_list args); -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max); -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags); -static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags); -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); +static size_t dopr PARAMS((char *buffer, size_t maxlen, const char *format, + va_list args)); +static void fmtstr PARAMS((char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max)); +static void fmtint PARAMS((char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags)); +static void fmtfp PARAMS((char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags)); +static void dopr_outch PARAMS((char *buffer, size_t *currlen, size_t maxlen, + char c)); /* * dopr(): poor man's version of doprintf @@ -153,7 +154,8 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); #define MAX(p,q) (((p) >= (q)) ? (p) : (q)) #endif -static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args) +static size_t +dopr(char *buffer, size_t maxlen, const char *format, va_list args) { char ch; LLONG value; @@ -410,8 +412,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args return currlen; } -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max) +static void +fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, + int min, int max) { int padlen, strln; /* amount to pad */ int cnt = 0; @@ -448,8 +451,9 @@ static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags) +static void +fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, + int min, int max, int flags) { int signvalue = 0; unsigned long uvalue; @@ -532,7 +536,8 @@ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, } } -static LDOUBLE abs_val(LDOUBLE value) +static LDOUBLE +abs_val(LDOUBLE value) { LDOUBLE result = value; @@ -542,7 +547,8 @@ static LDOUBLE abs_val(LDOUBLE value) return result; } -static LDOUBLE POW10(int exp) +static LDOUBLE +POW10(int exp) { LDOUBLE result = 1; @@ -554,7 +560,8 @@ static LDOUBLE POW10(int exp) return result; } -static LLONG ROUND(LDOUBLE value) +static LLONG +ROUND(LDOUBLE value) { LLONG intpart; @@ -567,7 +574,8 @@ static LLONG ROUND(LDOUBLE value) /* a replacement for modf that doesn't need the math library. Should be portable, but slow */ -static double my_modf(double x0, double *iptr) +static double +my_modf(double x0, double *iptr) { int i; long l; @@ -601,8 +609,9 @@ static double my_modf(double x0, double *iptr) } -static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags) +static void +fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, + int min, int max, int flags) { int signvalue = 0; double ufvalue; @@ -755,7 +764,8 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, } } -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) +static void +dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) { if (*currlen < maxlen) { buffer[(*currlen)] = c; @@ -764,14 +774,25 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) } #if !defined(HAVE_VSNPRINTF) -int vsnprintf (char *str, size_t count, const char *fmt, va_list args) +int +vsnprintf (char *str, size_t count, const char *fmt, va_list args) { return dopr(str, count, fmt, args); } #endif #if !defined(HAVE_SNPRINTF) -int snprintf(char *str,size_t count,const char *fmt,...) +#ifdef PROTOTYPES +int +snprintf(char *str, size_t count, const char *fmt, ...) +#else +int +snprintf(str, count, fmt, va_alist) +char *str; +size_t count; +const char *fmt; +va_dcl +#endif { size_t ret; va_list ap;