1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-21 03:34:03 +00:00

Compare commits

...

26 Commits

Author SHA1 Message Date
Alexander Barton
48fcb97fa4 New "Debian release" 21.1-0ab2 2014-07-14 12:01:46 +02:00
Alexander Barton
713fd3f883 Debian: Don't adjust path names that are correct by default
(cherry picked from commit f5944a17e4)
2014-07-14 11:41:28 +02:00
Alexander Barton
19da9a0801 Debian: Correctly set and use "docdir"
(cherry picked from commit 06920df4bb)
2014-07-14 11:14:08 +02:00
Alexander Barton
ee28e76df2 ngIRCd Release 21.1 2014-03-25 14:46:28 +01:00
Roy Sindre Norangshol
9a05c1145d Use server password when PAM is compiled in but disabled
(cherry picked from commit 485d0aec81)

Conflicts:
	src/ngircd/conf.c
2014-03-23 14:08:19 +01:00
Alexander Barton
a3ad2927cc doc/Platforms.txt: Update from master branch 2014-03-19 02:36:50 +01:00
Alexander Barton
6725f67cf1 Spoofed prefixes: Really kill connection on non-server links
This fixes commit 6cbe1308 which only killed the connection when the
spoofed prefix itself belonged to a non-server client.

(cherry picked from commit 5009ab3e8c)
2014-03-19 02:31:06 +01:00
Alexander Barton
c0c9b1b8ac Fix two K&R C portability issues
Fix the following two errors emitted by the Apple K&R C compiler
on Apple A/UX:

"./class.c", line 47: no automatic aggregate initialization
"./class.c", line 47: illegal lhs of assignment operator

"./conf.c", line 1052: syntax error

Tested on A/UX 3.1.1.

(cherry picked from commit a4ed90ba9a)
2014-03-19 02:30:22 +01:00
Alexander Barton
1d3137ff69 CHARCONV: Fix handling conversion errors
Don't overwrite already converted text!

(cherry picked from commit abf280d5bd)
2014-03-19 02:28:08 +01:00
Alexander Barton
d20de38161 Services.txt: Update information for Anope 2.x
(cherry picked from commit 755562d147)
2014-03-19 02:27:50 +01:00
Alexander Barton
9ecd8f616f 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.

Without this patch, ngIRCd records the real IRC 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!

(cherry picked from commit 20b52fe33d)
2014-03-19 02:27:16 +01:00
Alexander Barton
4525425879 configure: Only link "contrib/Debian" if it exists
This isn't the case on "VPATH builds", for example.

(cherry picked from commit 14a84dfca5)
2014-03-19 02:26:39 +01:00
Alexander Barton
4286af08ce Use $(MKDIR_P) instead of $(mkinstalldirs) in Makefile's
And test for "mkdir -p" using AC_PROG_MKDIR_P in "configure".

(cherry picked from commit 90062111f7)
2014-03-19 02:25:54 +01:00
Alexander Barton
bb3096b0d3 Fix configure script and "make check" for TCP Wrappers
Add missing #include's and static variables.

Problem spotted on OpenBSD.

(cherry picked from commit e747fe9277)

Conflicts:
	configure.ng
	src/portab/portabtest.c
2014-03-19 02:25:21 +01:00
Alexander Barton
9f090d7554 Add libwrap at the end of the configure run
If libwrap becomes added earlier, other tests may fail because of not all
external variables required by libwrap are available when linking: for
example allow_severity and deny_severity.

This patch adds generic support for the LDFLAGS_END and LIBS_END variables
(CFLAGS_END has been implemented already).

Problem spotted on OpenBSD.

(cherry picked from commit 0f85c4c6a7)

Conflicts:
	configure.ng
2014-03-19 02:21:25 +01:00
Alexander Barton
ecb55704b7 platformtest.sh: don't use "test -e", it isn't portable
(cherry picked from commit e2b85ccde3)
2014-03-19 02:14:05 +01:00
Alexander Barton
9a11ab0d1b Makefile.am: don't use "test -e", it isn't portable
(cherry picked from commit 7b358a57ac)
2014-03-19 02:10:02 +01:00
Alexander Barton
f55d03c153 Update Copyright notices for 2014
(cherry picked from commit 788da901ee)
2014-03-19 02:08:19 +01:00
Federico G. Schwindt
b86da5ed9a Fix permanent k/gline
Reported by Toni Spets (hifi - at - jnz - dot - fi).

(cherry picked from commit 9230f2fff1)
2014-03-19 02:07:36 +01:00
Alexander Barton
d009df909b WEBIRC: Don't respect hostname when DNS is disabled
When DNS lookups are disabled, don't set the hostname received by the
WEBIRC command, but use the IP address instead.

Reported by Toni Spets <toni.spets@iki.fi>, thanks!

Closes bug #167.

(cherry picked from commit 1a628fff51)
2014-03-19 02:07:05 +01:00
Alexander Barton
74db76b792 OS X has a working getaddrinfo() implementation
(cherry picked from commit bd33bd770d)
2013-12-27 22:03:37 +01:00
Alexander Barton
21ef762109 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 <http://www.stacken.kth.se/lists/heimdal-discuss/2004-05/msg00059.html>

(cherry picked from commit b8433e9261)

Conflicts:
	configure.ng
2013-12-27 22:02:29 +01:00
Alexander Barton
e379a0881e Only use unsetenv() when it is available
AIX 4.3 dosn't support it, for example.

(cherry picked from commit ae00c100ac)
2013-12-27 21:56:07 +01:00
Alexander Barton
54a13350b1 conf-ssl.h: make code compatible with pre-ANSI C compilers
(cherry picked from commit 61d1c864c5)
2013-12-27 21:55:50 +01:00
Alexander Barton
3b46356ce2 vsnprintf.c: make code compatible with ansi2knr tool
(cherry picked from commit 8d25044ce5)
2013-12-27 21:55:27 +01:00
Alexander Barton
ac127ff20a Remove wrong #ifdef in Option_String()
This fixes the following error when compiling without zlib support:

  irc.c: In function ‘Option_String’:
  irc.c:487: error: ‘options’ undeclared (first use in this function)

Reported by "der_baer" on #ngircd.

(cherry picked from commit 4ab688c5e8)
2013-12-27 21:52:59 +01:00
32 changed files with 284 additions and 122 deletions

View File

@@ -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.

View File

@@ -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 <roy.sindre@norangshol.no>!
- 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 <toni.spets@iki.fi>, 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 <http://www.stacken.kth.se/lists/heimdal-discuss/2004-05/msg00059.html>
- 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.

View File

@@ -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.

View File

@@ -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

13
NEWS
View File

@@ -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 <roy.sindre@norangshol.no>!
- 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

2
README
View File

@@ -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.

View File

@@ -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 <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
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 <sys/types.h>
#include <sys/socket.h>
#include <tcpd.h>
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 --

View File

@@ -1,3 +1,17 @@
ngircd (21.1-0ab2) unstable; urgency=low
* Use correct package name in pathname to "HelpFile" (Command.txt)
in "ngircd-full" and "ngircd-full-dbg" packages.
* Don't adjust path names that are correct by default.
-- Alexander Barton <alex@barton.de> Mon, 14 Jul 2014 11:20:17 +0200
ngircd (21.1-0ab1) unstable; urgency=low
* New "upstream" release: ngIRCd 21.1.
-- Alexander Barton <alex@barton.de> Tue, 25 Mar 2014 14:44:59 +0100
ngircd (21-0ab1) unstable; urgency=low
* New "upstream" release: ngIRCd 21.

View File

@@ -1,7 +1,7 @@
#!/usr/bin/make -f
#
# 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
@@ -42,6 +42,7 @@ configure-ngircd: configure
--prefix=/usr \
--sysconfdir=/etc/ngircd \
--mandir=\$${prefix}/share/man \
--docdir=\$${prefix}/share/doc/ngircd \
--with-syslog --with-zlib
configure-ngircd-full: configure
@@ -52,6 +53,7 @@ configure-ngircd-full: configure
--prefix=/usr \
--sysconfdir=/etc/ngircd \
--mandir=\$${prefix}/share/man \
--docdir=\$${prefix}/share/doc/ngircd-full \
--with-syslog --with-zlib \
--with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
--with-pam \
@@ -65,6 +67,7 @@ configure-ngircd-full-dbg: configure
--prefix=/usr \
--sysconfdir=/etc/ngircd \
--mandir=\$${prefix}/share/man \
--docdir=\$${prefix}/share/doc/ngircd-full-dbg \
--enable-debug --enable-sniffer \
--with-syslog --with-zlib \
--with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
@@ -141,7 +144,6 @@ install-ngircd: build-ngircd
cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = |/etc/ngircd/ngircd.motd|g" | \
sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
>$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
@@ -153,16 +155,12 @@ install-ngircd-full: build-ngircd-full
# Add here commands to install the "full" package into debian/ngircd-full:
$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
$(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/INSTALL*
rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/COPYING*
mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = /etc/ngircd/ngircd.motd|g" | \
sed -e "s|;HelpFile = /usr/share/doc/ngircd/Commands.txt|HelpFile = /usr/share/doc/ngircd-full/Commands.txt|g" | \
sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
>$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
@@ -176,16 +174,12 @@ install-ngircd-full-dbg: build-ngircd-full-dbg
# Add here commands to install the "full" package into debian/ngircd-full:
$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/INSTALL*
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/COPYING*
mv $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd \
$(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/INSTALL*
rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/COPYING*
mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = /etc/ngircd/ngircd.motd|g" | \
sed -e "s|;HelpFile = /usr/share/doc/ngircd/Commands.txt|HelpFile = /usr/share/doc/ngircd-full-dbg/Commands.txt|g" | \
sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
>$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd

View File

@@ -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. */

View File

@@ -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 \

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 (<http://www.anope.org/>) 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-"

View File

@@ -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;

View File

@@ -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;

View File

@@ -42,7 +42,7 @@ struct ConnSSL_State {
#endif
bool ConnSSL_InitLibrary(void);
GLOBAL bool ConnSSL_InitLibrary PARAMS((void));
#endif /* conf_ssl_h */

View File

@@ -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

View File

@@ -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';

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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).",

View File

@@ -478,9 +478,7 @@ Option_String(UNUSED CONN_ID Idx)
#endif
{
static char option_txt[8];
#ifdef ZLIB
UINT16 options;
#endif
assert(Idx != NONE);

View File

@@ -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) {

View File

@@ -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 (<alex@barton.de>) and Contributors." );
puts( "Copyright (c)2001-2014 Alexander Barton (<alex@barton.de>) and Contributors." );
puts( "Homepage: <http://ngircd.barton.de/>\n" );
puts( "This is free software; see the source for copying conditions. There is NO" );
puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );

View File

@@ -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);

View File

@@ -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;

View File

@@ -24,6 +24,8 @@
#include "exp.h"
int allow_severity = 0, deny_severity = 0;
static void Panic PARAMS (( char *Reason, int Code ));

View File

@@ -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;