mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-28 20:47:38 +00:00
Compare commits
15 Commits
rel-21-rc1
...
rel-21-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
788b3002d8 | ||
|
|
beb9f65dc8 | ||
|
|
62865f7e19 | ||
|
|
a7dda1b28c | ||
|
|
cba5a2579f | ||
|
|
a2479bb906 | ||
|
|
17589534d0 | ||
|
|
ea26fd2840 | ||
|
|
45d3e6aa91 | ||
|
|
0bd3fb88b2 | ||
|
|
c34b91d8dd | ||
|
|
56da86b4f4 | ||
|
|
ea8a2bf1fc | ||
|
|
1b349b05d5 | ||
|
|
4c5b439992 |
27
ChangeLog
27
ChangeLog
@@ -9,8 +9,19 @@
|
||||
-- ChangeLog --
|
||||
|
||||
|
||||
ngIRCd 21~rc1 (2013-10-05)
|
||||
ngIRCd 21~rc2 (2013-10-20)
|
||||
|
||||
- Report the correct configuration file name on configuration errors,
|
||||
support longer configuration lines, and warn when lines are truncated.
|
||||
- Use arc4random() function to generate "random" numbers, when available.
|
||||
- platformtest.sh: Detect clang compiler, and clean up GIT source tree
|
||||
before building (when possible).
|
||||
- Update (date of) manual pages.
|
||||
- Update "Upgrade Information" in INSTALL file, add more systems to
|
||||
doc/Platforms.txt, and fix spelling in NEWS and ChangeLog files =:)
|
||||
- Fix remaining compiler warnings on OpenBSD.
|
||||
|
||||
ngIRCd 21~rc1 (2013-10-05)
|
||||
- Actually KILL clients on GLINE/KLINE. (Closes bug #156)
|
||||
- Adjust log messages for invalid and spoofed prefixes, which cleans up
|
||||
logging of commands related to already KILL'ed clients. And don't
|
||||
@@ -18,10 +29,10 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
unnecessary duplicates.
|
||||
- Add support to show all user links using the "STATS L" (uppercase)
|
||||
command (restricted to IRC Operators).
|
||||
- Fixed blocking of server reconnects in some error confitions.
|
||||
- Fixed blocking of server reconnects in some error configurations.
|
||||
- Don't ignore SSL-related errors during startup any more: abort startup
|
||||
when SSL is requested by the configuration but can't be initialized and
|
||||
don't continue only listening on plain text communicaiton ports.
|
||||
don't continue only listening on plain text communication ports.
|
||||
(Closes bug #163)
|
||||
- Implement configurable SSL cipher list selection for GnuTLS and OpenSSL
|
||||
using the new configuration option "CipherList". In addition, this
|
||||
@@ -31,8 +42,8 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
is "syntax error") when there are too many parameters.
|
||||
- Clean up lots of permission and parameter checks in functions handling
|
||||
IRC commands; and more consistently add penalty times on errors.
|
||||
- Fix error numeric of WHOIS when no nick namename has been provided:
|
||||
as per RFC it shoud be ERR_NONICKNAMEGIVEN(431).
|
||||
- Fix error numeric of WHOIS when no nick name has been provided:
|
||||
as per RFC it should be ERR_NONICKNAMEGIVEN(431).
|
||||
- Only log "IDENT ... no result" messages when an IDENT looked took place
|
||||
and didn't return any data, not when IDENT has been disabled.
|
||||
- Show connection flag "s" (SSL) in RPL_TRACE{LINK|SERVER} messages: now
|
||||
@@ -59,7 +70,7 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
If set to the empty string, local clients can't create new channels at
|
||||
all, which equals the old "PredefChannelsOnly = yes" setting.
|
||||
This change deprecates the "PredefChannelsOnly" variable, too, but it is
|
||||
still supported and translated to the apropriate "AllowedChannelTypes"
|
||||
still supported and translated to the appropriate "AllowedChannelTypes"
|
||||
setting. When the old "PredefChannelsOnly" variable is processed, a
|
||||
warning message is logged. (Closes bug #152)
|
||||
- Add support for "client certificate fingerprinting". When a client
|
||||
@@ -87,7 +98,7 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
- OS X PackageMaker: use relative path names in project files and package
|
||||
with correct file permissions (requires root privileges on "make").
|
||||
- Add Travis-CI configuration file (".travis.yml") to project.
|
||||
- Look for possible cloaked Masks in Lists. Users with +x usermode can
|
||||
- Look for possible cloaked Masks in Lists. Users with +x user mode can
|
||||
be banned with their cloaked hostname now.
|
||||
- Don't read SSL client data before DNS resolver is finished which could
|
||||
have resulted in discarding the resolved client hostname and IDENT
|
||||
@@ -125,7 +136,7 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
InspIRCd, for example -- but as usual, other numerics are in use, too,
|
||||
like 613 in UltimateIRCd ...
|
||||
Please note that neither the Operator (+o) not the "bot status" (+B)
|
||||
of an IRC service id displayed in the output.
|
||||
of an IRC service is displayed in the output.
|
||||
- Exit message: use singular & plural :-)
|
||||
- autogen.sh: Check for autoconf/automake wrapper scripts
|
||||
- Add missing punctuation marks in log messages, adjust some severity
|
||||
|
||||
6
INSTALL
6
INSTALL
@@ -12,13 +12,17 @@
|
||||
I. Upgrade Information
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Differences to previous version
|
||||
Differences to version 20.x
|
||||
|
||||
- Starting with ngIRCd 21, the ciphers used by SSL are configurable and
|
||||
default to HIGH:!aNULL:@STRENGTH (OpenSSL) or SECURE128 (GnuTLS).
|
||||
Previous version were using the OpenSSL or GnuTLS defaults, DEFAULT
|
||||
and NORMAL respectively.
|
||||
|
||||
- When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
|
||||
the new mask will be KILL'ed. This was not the case with earlier versions
|
||||
that only added the mask but didn't kill already connected users.
|
||||
|
||||
Differences to version 19.x
|
||||
|
||||
- Starting with ngIRCd 20, users can "cloak" their hostname only when the
|
||||
|
||||
10
NEWS
10
NEWS
@@ -9,8 +9,12 @@
|
||||
-- NEWS --
|
||||
|
||||
|
||||
ngIRCd 21~rc1 (2013-10-05)
|
||||
ngIRCd 21~rc2 (2013-10-20)
|
||||
|
||||
- Report the correct configuration file name on configuration errors,
|
||||
support longer configuration lines, and warn when lines are truncated.
|
||||
|
||||
ngIRCd 21~rc1 (2013-10-05)
|
||||
- Actually KILL clients on GLINE/KLINE. (Closes bug #156)
|
||||
- Add support to show all user links using the "STATS L" (uppercase)
|
||||
command (restricted to IRC Operators).
|
||||
@@ -36,7 +40,7 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
If set to the empty string, local clients can't create new channels at
|
||||
all, which equals the old "PredefChannelsOnly = yes" setting.
|
||||
This change deprecates the "PredefChannelsOnly" variable, too, but it is
|
||||
still supported and translated to the apropriate "AllowedChannelTypes"
|
||||
still supported and translated to the appropriate "AllowedChannelTypes"
|
||||
setting. When the old "PredefChannelsOnly" variable is processed, a
|
||||
warning message is logged. (Closes bug #152)
|
||||
- Add support for "client certificate fingerprinting". When a client
|
||||
@@ -72,7 +76,7 @@ ngIRCd 21~rc1 (2013-10-05)
|
||||
InspIRCd, for example -- but as usual, other numerics are in use, too,
|
||||
like 613 in UltimateIRCd ...
|
||||
Please note that neither the Operator (+o) not the "bot status" (+B)
|
||||
of an IRC service id displayed in the output.
|
||||
of an IRC service is displayed in the output.
|
||||
- Update systemd(8) example configuration files in ./contrib/ directory:
|
||||
the "ngircd.service" file now uses the "forking" service type which
|
||||
enhances the log messages shown by "systemctl status ngircd.service",
|
||||
|
||||
@@ -187,8 +187,9 @@ AC_CHECK_FUNCS([ \
|
||||
|
||||
# Optional functions
|
||||
AC_CHECK_FUNCS_ONCE([ \
|
||||
gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \
|
||||
snprintf vsnprintf strdup strndup strlcpy strlcat strtok_r waitpid])
|
||||
arc4random gai_strerror getaddrinfo getnameinfo inet_aton sigaction \
|
||||
sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat strtok_r \
|
||||
waitpid])
|
||||
|
||||
# -- Configuration options --
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
ngircd (21~rc2-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release candidate 2 for ngIRCd Release 21.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Sun, 20 Oct 2013 15:50:03 +0200
|
||||
|
||||
ngircd (21~rc1-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release candidate 1 for ngIRCd Release 21.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version 21~rc1
|
||||
%define version 21~rc2
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ngIRCd -- The Next Generation IRC Daemon
|
||||
# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors
|
||||
# Copyright (c)2001-2013 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
|
||||
@@ -54,6 +54,16 @@ if [ $? -ne 0 ]; then
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo "$NAME: Checking for GIT tree ..."
|
||||
if [ -d .git ]; then
|
||||
echo "$NAME: Checking for \"git\" command ..."
|
||||
git version >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "$NAME: Running \"git clean\" ..."
|
||||
[ -n "$VERBOSE" ] && git clean -dxf || git clean -dxf >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$NAME: Checking for \"./configure\" script ..."
|
||||
if [ ! -e ./configure ]; then
|
||||
echo "$NAME: Running \"./autogen.sh\" ..."
|
||||
@@ -99,6 +109,7 @@ if [ -r "Makefile" ]; then
|
||||
CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
|
||||
$CC --version 2>&1 | grep -i "GCC" >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
# GCC, or compiler that mimics GCC
|
||||
$CC --version 2>&1 | grep -i "Open64" >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
COMPILER="Open64"
|
||||
@@ -108,12 +119,24 @@ if [ -r "Makefile" ]; then
|
||||
COMPILER="gcc $COMPILER"
|
||||
fi
|
||||
else
|
||||
case "$CC" in
|
||||
gcc*)
|
||||
# Non-GCC compiler
|
||||
$CC --version 2>&1 | grep -i "clang" >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
COMPILER=$($CC --version 2>/dev/null | head -1 \
|
||||
| cut -d'(' -f1 | cut -d'-' -f1 \
|
||||
| sed -e 's/version //g' | sed -e 's/Apple /A-/g' \
|
||||
| sed -e 's/Debian //g' | sed -e 's/LLVM /clang /g')
|
||||
fi
|
||||
$CC -version 2>&1 | grep -i "tcc" >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
COMPILER=$($CC -version 2>/dev/null | head -1 \
|
||||
| cut -d'(' -f1 | sed -e 's/version //g')
|
||||
fi
|
||||
if [ "$COMPILER" = "unknown" ]; then
|
||||
v="`$CC --version 2>/dev/null | head -1`"
|
||||
[ -n "$v" ] && COMPILER="gcc $v"
|
||||
;;
|
||||
esac
|
||||
[ -z "$v" ] && v="`$CC -version 2>/dev/null | head -1`"
|
||||
[ -n "$v" ] && COMPILER="$v"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -74,9 +74,13 @@ 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
|
||||
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
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~rc1 13-10-16 alex Y Y Y Y (3)
|
||||
x86_64/unknown/freebsd8.1 gcc 4.2.1 20~rc1 12-11-13 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~rc1 13-10-16 alex Y Y Y Y (1)
|
||||
x86_64/unknown/linux-gnu gcc 4.4.5 20.2 13-04-01 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/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 20~rc1 12-11-13 alex Y Y Y Y (3)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" ngircd(8) manual page template
|
||||
.\"
|
||||
.TH ngircd 8 "Jul 2013" ngIRCd "ngIRCd Manual"
|
||||
.TH ngircd 8 "Oct 2013" ngIRCd "ngIRCd Manual"
|
||||
.SH NAME
|
||||
ngIRCd \- the "next generation" IRC daemon
|
||||
.SH SYNOPSIS
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" ngircd.conf(5) manual page template
|
||||
.\"
|
||||
.TH ngircd.conf 5 "May 2013" ngIRCd "ngIRCd Manual"
|
||||
.TH ngircd.conf 5 "Oct 2013" ngIRCd "ngIRCd Manual"
|
||||
.SH NAME
|
||||
ngircd.conf \- configuration file of ngIRCd
|
||||
.SH SYNOPSIS
|
||||
@@ -133,8 +133,8 @@ if ngIRCd is using PAM!
|
||||
.TP
|
||||
\fBPidFile\fR (string)
|
||||
This tells ngIRCd to write its current process ID to a file. Note that the
|
||||
pidfile is written AFTER chroot and switching the user ID, e.g. the directory
|
||||
the pidfile resides in must be writable by the ngIRCd user and exist in the
|
||||
"PID file" is written AFTER chroot and switching the user ID, e.g. the directory
|
||||
the file resides in must be writable by the ngIRCd user and exist in the
|
||||
chroot directory (if configured, see above).
|
||||
.TP
|
||||
\fBPorts\fR (list of numbers)
|
||||
|
||||
@@ -238,7 +238,7 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen
|
||||
/* remove a client */
|
||||
|
||||
CLIENT *last, *c;
|
||||
char msg[LINE_LEN];
|
||||
char msg[COMMAND_LEN];
|
||||
const char *txt;
|
||||
|
||||
assert( Client != NULL );
|
||||
|
||||
@@ -216,7 +216,7 @@ ports_puts(array *a)
|
||||
* Parse a comma separated string into an array of port numbers (integers).
|
||||
*/
|
||||
static void
|
||||
ports_parse(array *a, int Line, char *Arg)
|
||||
ports_parse(array *a, const char *File, int Line, char *Arg)
|
||||
{
|
||||
char *ptr;
|
||||
int port;
|
||||
@@ -232,10 +232,10 @@ ports_parse(array *a, int Line, char *Arg)
|
||||
port16 = (UINT16) port;
|
||||
if (!array_catb(a, (char*)&port16, sizeof port16))
|
||||
Config_Error(LOG_ERR, "%s, line %d Could not add port number %ld: %s",
|
||||
NGIRCd_ConfFile, Line, port, strerror(errno));
|
||||
File, Line, port, strerror(errno));
|
||||
} else {
|
||||
Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!",
|
||||
NGIRCd_ConfFile, Line, port );
|
||||
File, Line, port );
|
||||
}
|
||||
|
||||
ptr = strtok( NULL, "," );
|
||||
@@ -533,7 +533,11 @@ Conf_UnsetServer( CONN_ID Idx )
|
||||
/* "Short" connection, enforce "ConnectRetry"
|
||||
* but randomize it a little bit: 15 seconds. */
|
||||
Conf_Server[i].lasttry =
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
t + (arc4random() % 15);
|
||||
#else
|
||||
t + rand() / (RAND_MAX / 15);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1059,7 +1063,7 @@ static void Read_Config_File(const char *File, FILE *fd)
|
||||
/* Read configuration file */
|
||||
section[0] = '\0';
|
||||
while (true) {
|
||||
if (!fgets(str, LINE_LEN, fd))
|
||||
if (!fgets(str, sizeof(str), fd))
|
||||
break;
|
||||
ngt_TrimStr(str);
|
||||
line++;
|
||||
@@ -1068,6 +1072,12 @@ static void Read_Config_File(const char *File, FILE *fd)
|
||||
if (str[0] == ';' || str[0] == '#' || str[0] == '\0')
|
||||
continue;
|
||||
|
||||
if (strlen(str) >= sizeof(str) - 1) {
|
||||
Config_Error(LOG_WARNING, "%s, line %d too long!",
|
||||
File, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Is this the beginning of a new section? */
|
||||
if ((str[0] == '[') && (str[strlen(str) - 1] == ']')) {
|
||||
strlcpy(section, str, sizeof(section));
|
||||
@@ -1137,7 +1147,7 @@ static void Read_Config_File(const char *File, FILE *fd)
|
||||
|
||||
Config_Error(LOG_ERR,
|
||||
"%s, line %d: Unknown section \"%s\"!",
|
||||
NGIRCd_ConfFile, line, section);
|
||||
File, line, section);
|
||||
section[0] = 0x1;
|
||||
}
|
||||
if (section[0] == 0x1)
|
||||
@@ -1147,7 +1157,7 @@ static void Read_Config_File(const char *File, FILE *fd)
|
||||
ptr = strchr(str, '=');
|
||||
if (!ptr) {
|
||||
Config_Error(LOG_ERR, "%s, line %d: Syntax error!",
|
||||
NGIRCd_ConfFile, line);
|
||||
File, line);
|
||||
continue;
|
||||
}
|
||||
*ptr = '\0';
|
||||
@@ -1175,7 +1185,7 @@ static void Read_Config_File(const char *File, FILE *fd)
|
||||
else
|
||||
Config_Error(LOG_ERR,
|
||||
"%s, line %d: Variable \"%s\" outside section!",
|
||||
NGIRCd_ConfFile, line, var);
|
||||
File, line, var);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1207,7 +1217,7 @@ Check_ArgIsTrue(const char *Arg)
|
||||
* @returns New configured maximum nickname length.
|
||||
*/
|
||||
static unsigned int
|
||||
Handle_MaxNickLength(int Line, const char *Arg)
|
||||
Handle_MaxNickLength(const char *File, int Line, const char *Arg)
|
||||
{
|
||||
unsigned new;
|
||||
|
||||
@@ -1215,13 +1225,13 @@ Handle_MaxNickLength(int Line, const char *Arg)
|
||||
if (new > CLIENT_NICK_LEN) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"MaxNickLength\" exceeds %u!",
|
||||
NGIRCd_ConfFile, Line, CLIENT_NICK_LEN - 1);
|
||||
File, Line, CLIENT_NICK_LEN - 1);
|
||||
return CLIENT_NICK_LEN;
|
||||
}
|
||||
if (new < 2) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"MaxNickLength\" must be at least 1!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
return 2;
|
||||
}
|
||||
return new;
|
||||
@@ -1231,14 +1241,14 @@ Handle_MaxNickLength(int Line, const char *Arg)
|
||||
* Output a warning messages if IDENT is configured but not compiled in.
|
||||
*/
|
||||
static void
|
||||
WarnIdent(int UNUSED Line)
|
||||
WarnIdent(const char UNUSED *File, int UNUSED Line)
|
||||
{
|
||||
#ifndef IDENTAUTH
|
||||
if (Conf_Ident) {
|
||||
/* user has enabled ident lookups explicitly, but ... */
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s: line %d: \"Ident = yes\", but ngircd was built without IDENT support!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1247,14 +1257,14 @@ WarnIdent(int UNUSED Line)
|
||||
* Output a warning messages if IPv6 is configured but not compiled in.
|
||||
*/
|
||||
static void
|
||||
WarnIPv6(int UNUSED Line)
|
||||
WarnIPv6(const char UNUSED *File, int UNUSED Line)
|
||||
{
|
||||
#ifndef WANT_IPV6
|
||||
if (Conf_ConnectIPv6) {
|
||||
/* user has enabled IPv6 explicitly, but ... */
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s: line %d: \"ConnectIPv6 = yes\", but ngircd was built without IPv6 support!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1263,13 +1273,13 @@ WarnIPv6(int UNUSED Line)
|
||||
* Output a warning messages if PAM is configured but not compiled in.
|
||||
*/
|
||||
static void
|
||||
WarnPAM(int UNUSED Line)
|
||||
WarnPAM(const char UNUSED *File, int UNUSED Line)
|
||||
{
|
||||
#ifndef PAM
|
||||
if (Conf_PAM) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s: line %d: \"PAM = yes\", but ngircd was built without PAM support!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1470,14 +1480,14 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
len = strlen(Arg);
|
||||
if (len == 0)
|
||||
return;
|
||||
if (len >= LINE_LEN) {
|
||||
if (len >= 127) {
|
||||
Config_Error_TooLong(File, Line, Var);
|
||||
return;
|
||||
}
|
||||
if (!array_copyb(&Conf_Motd, Arg, len + 1))
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Could not append MotdPhrase: %s",
|
||||
NGIRCd_ConfFile, Line, strerror(errno));
|
||||
File, Line, strerror(errno));
|
||||
Using_MotdFile = false;
|
||||
return;
|
||||
}
|
||||
@@ -1494,7 +1504,7 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "Ports") == 0) {
|
||||
ports_parse(&Conf_ListenPorts, Line, Arg);
|
||||
ports_parse(&Conf_ListenPorts, File, Line, Arg);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "ServerGID") == 0) {
|
||||
@@ -1506,7 +1516,7 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
if (!Conf_GID && strcmp(Arg, "0"))
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"%s\" is not a valid group name or ID!",
|
||||
NGIRCd_ConfFile, Line, Var);
|
||||
File, Line, Var);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1519,7 +1529,7 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
if (!Conf_UID && strcmp(Arg, "0"))
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"%s\" is not a valid user name or ID!",
|
||||
NGIRCd_ConfFile, Line, Var);
|
||||
File, Line, Var);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1530,11 +1540,11 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
* after marking it "deprecated"). */
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d (section \"Global\"): \"No\"-Prefix is deprecated, use \"%s = %s\" in [Options] section!",
|
||||
NGIRCd_ConfFile, Line, NoNo(Var), InvertArg(Arg));
|
||||
File, Line, NoNo(Var), InvertArg(Arg));
|
||||
if (strcasecmp(Var, "NoIdent") == 0)
|
||||
WarnIdent(Line);
|
||||
WarnIdent(File, Line);
|
||||
else if (strcasecmp(Var, "NoPam") == 0)
|
||||
WarnPAM(Line);
|
||||
WarnPAM(File, Line);
|
||||
return;
|
||||
}
|
||||
if ((section = CheckLegacyGlobalOption(File, Line, Var, Arg))) {
|
||||
@@ -1544,12 +1554,12 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg )
|
||||
if (strncasecmp(Var, "SSL", 3) == 0) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d (section \"Global\"): \"%s\" is deprecated here, move it to %s and rename to \"%s\"!",
|
||||
NGIRCd_ConfFile, Line, Var, section,
|
||||
File, Line, Var, section,
|
||||
Var + 3);
|
||||
} else {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d (section \"Global\"): \"%s\" is deprecated here, move it to %s!",
|
||||
NGIRCd_ConfFile, Line, Var, section);
|
||||
File, Line, Var, section);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1577,7 +1587,7 @@ Handle_LIMITS(const char *File, int Line, char *Var, char *Arg)
|
||||
if (Conf_ConnectRetry < 5) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"ConnectRetry\" too low!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
Conf_ConnectRetry = 5;
|
||||
}
|
||||
return;
|
||||
@@ -1607,7 +1617,7 @@ Handle_LIMITS(const char *File, int Line, char *Var, char *Arg)
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "MaxNickLength") == 0) {
|
||||
Conf_MaxNickLength = Handle_MaxNickLength(Line, Arg);
|
||||
Conf_MaxNickLength = Handle_MaxNickLength(File, Line, Arg);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "MaxListSize") == 0) {
|
||||
@@ -1621,7 +1631,7 @@ Handle_LIMITS(const char *File, int Line, char *Var, char *Arg)
|
||||
if (Conf_PingTimeout < 5) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"PingTimeout\" too low!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
Conf_PingTimeout = 5;
|
||||
}
|
||||
return;
|
||||
@@ -1631,7 +1641,7 @@ Handle_LIMITS(const char *File, int Line, char *Var, char *Arg)
|
||||
if (Conf_PongTimeout < 5) {
|
||||
Config_Error(LOG_WARNING,
|
||||
"%s, line %d: Value of \"PongTimeout\" too low!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
File, Line);
|
||||
Conf_PongTimeout = 5;
|
||||
}
|
||||
return;
|
||||
@@ -1716,7 +1726,7 @@ Handle_OPTIONS(const char *File, int Line, char *Var, char *Arg)
|
||||
}
|
||||
if (strcasecmp(Var, "ConnectIPv6") == 0) {
|
||||
Conf_ConnectIPv6 = Check_ArgIsTrue(Arg);
|
||||
WarnIPv6(Line);
|
||||
WarnIPv6(File, Line);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "ConnectIPv4") == 0) {
|
||||
@@ -1753,7 +1763,7 @@ Handle_OPTIONS(const char *File, int Line, char *Var, char *Arg)
|
||||
}
|
||||
if (strcasecmp(Var, "Ident") == 0) {
|
||||
Conf_Ident = Check_ArgIsTrue(Arg);
|
||||
WarnIdent(Line);
|
||||
WarnIdent(File, Line);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "IncludeDir") == 0) {
|
||||
@@ -1790,7 +1800,7 @@ Handle_OPTIONS(const char *File, int Line, char *Var, char *Arg)
|
||||
}
|
||||
if (strcasecmp(Var, "PAM") == 0) {
|
||||
Conf_PAM = Check_ArgIsTrue(Arg);
|
||||
WarnPAM(Line);
|
||||
WarnPAM(File, Line);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "PAMIsOptional") == 0 ) {
|
||||
@@ -1881,7 +1891,7 @@ Handle_SSL(const char *File, int Line, char *Var, char *Arg)
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "Ports") == 0) {
|
||||
ports_parse(&Conf_SSLOptions.ListenPorts, Line, Arg);
|
||||
ports_parse(&Conf_SSLOptions.ListenPorts, File, Line, Arg);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(Var, "CipherList") == 0) {
|
||||
@@ -1982,15 +1992,15 @@ Handle_SERVER(const char *File, int Line, char *Var, char *Arg )
|
||||
return;
|
||||
|
||||
Config_Error(LOG_ERR, "%s, line %d (section \"Server\"): Can't parse IP address \"%s\"",
|
||||
NGIRCd_ConfFile, Line, Arg);
|
||||
File, Line, Arg);
|
||||
return;
|
||||
}
|
||||
if( strcasecmp( Var, "MyPassword" ) == 0 ) {
|
||||
/* Password of this server which is sent to the peer */
|
||||
if (*Arg == ':') {
|
||||
Config_Error(LOG_ERR,
|
||||
"%s, line %d (section \"Server\"): MyPassword must not start with ':'!",
|
||||
NGIRCd_ConfFile, Line);
|
||||
"%s, line %d (section \"Server\"): MyPassword must not start with ':'!",
|
||||
File, Line);
|
||||
}
|
||||
len = strlcpy( New_Server.pwd_in, Arg, sizeof( New_Server.pwd_in ));
|
||||
if (len >= sizeof( New_Server.pwd_in ))
|
||||
@@ -2011,8 +2021,8 @@ Handle_SERVER(const char *File, int Line, char *Var, char *Arg )
|
||||
New_Server.port = (UINT16)port;
|
||||
else
|
||||
Config_Error(LOG_ERR,
|
||||
"%s, line %d (section \"Server\"): Illegal port number %ld!",
|
||||
NGIRCd_ConfFile, Line, port );
|
||||
"%s, line %d (section \"Server\"): Illegal port number %ld!",
|
||||
File, Line, port );
|
||||
return;
|
||||
}
|
||||
#ifdef SSL_SUPPORT
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/* Generic buffer sizes */
|
||||
|
||||
/** Max. length of a line in the configuration file. */
|
||||
#define LINE_LEN 256
|
||||
#define LINE_LEN 1024
|
||||
|
||||
/** Max. length of a log message. */
|
||||
#define MAX_LOG_MSG_LEN 256
|
||||
|
||||
@@ -37,7 +37,7 @@ static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval));
|
||||
GLOBAL UINT32
|
||||
Hash( const char *String )
|
||||
{
|
||||
char buffer[LINE_LEN];
|
||||
char buffer[COMMAND_LEN];
|
||||
|
||||
strlcpy(buffer, String, sizeof(buffer));
|
||||
return jenkins_hash((UINT8 *)ngt_LowerStr(buffer),
|
||||
|
||||
@@ -242,7 +242,11 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
|
||||
|
||||
#ifndef STRICT_RFC
|
||||
if (Conf_AuthPing) {
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
Conn_SetAuthPing(Client_Conn(Client), arc4random());
|
||||
#else
|
||||
Conn_SetAuthPing(Client_Conn(Client), rand());
|
||||
#endif
|
||||
IRC_WriteStrClient(Client, "PING :%ld",
|
||||
Conn_GetAuthPing(Client_Conn(Client)));
|
||||
LogDebug("Connection %d: sent AUTH PING %ld ...",
|
||||
@@ -626,7 +630,7 @@ GLOBAL bool
|
||||
IRC_QUIT( CLIENT *Client, REQUEST *Req )
|
||||
{
|
||||
CLIENT *target;
|
||||
char quitmsg[LINE_LEN];
|
||||
char quitmsg[COMMAND_LEN];
|
||||
|
||||
assert(Client != NULL);
|
||||
assert(Req != NULL);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
GLOBAL bool
|
||||
IRC_SERVER( CLIENT *Client, REQUEST *Req )
|
||||
{
|
||||
char str[LINE_LEN];
|
||||
char str[100];
|
||||
CLIENT *from, *c;
|
||||
int i;
|
||||
|
||||
|
||||
@@ -297,10 +297,10 @@ main(int argc, const char *argv[])
|
||||
PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
IRCPLUSFLAGS);
|
||||
#ifdef ZLIB
|
||||
strcat(NGIRCd_ProtoID, "Z");
|
||||
strlcat(NGIRCd_ProtoID, "Z", sizeof NGIRCd_ProtoID);
|
||||
#endif
|
||||
if (Conf_OperCanMode)
|
||||
strcat(NGIRCd_ProtoID, "o");
|
||||
strlcat(NGIRCd_ProtoID, "o", sizeof NGIRCd_ProtoID);
|
||||
#else /* IRCPLUS */
|
||||
snprintf(NGIRCd_ProtoID, sizeof NGIRCd_ProtoID, "%s%s %s|%s",
|
||||
PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION);
|
||||
@@ -613,6 +613,13 @@ NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
static void
|
||||
Random_Init(void)
|
||||
{
|
||||
|
||||
}
|
||||
#else
|
||||
static bool
|
||||
Random_Init_Kern(const char *file)
|
||||
{
|
||||
@@ -642,6 +649,7 @@ Random_Init(void)
|
||||
return;
|
||||
srand(rand() ^ (unsigned)getpid() ^ (unsigned)time(NULL));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ Announce_Channel(CLIENT *Client, CHANNEL *Chan)
|
||||
{
|
||||
CL2CHAN *cl2chan;
|
||||
CLIENT *cl;
|
||||
char str[LINE_LEN], *ptr;
|
||||
char str[COMMAND_LEN], *ptr;
|
||||
bool njoin, xop;
|
||||
|
||||
/* Check features of remote server */
|
||||
@@ -82,7 +82,7 @@ Announce_Channel(CLIENT *Client, CHANNEL *Chan)
|
||||
strlcat(str, Client_ID(cl), sizeof(str));
|
||||
|
||||
/* Send the data if the buffer is "full" */
|
||||
if (strlen(str) > (LINE_LEN - CLIENT_NICK_LEN - 8)) {
|
||||
if (strlen(str) > (sizeof(str) - CLIENT_NICK_LEN - 8)) {
|
||||
if (!IRC_WriteStrClient(Client, "%s", str))
|
||||
return DISCONNECTED;
|
||||
snprintf(str, sizeof(str), "NJOIN %s :",
|
||||
|
||||
@@ -423,7 +423,7 @@ Handle_Numeric(CLIENT *client, REQUEST *Req)
|
||||
{ 376, IRC_Num_ENDOFMOTD }
|
||||
};
|
||||
int i, num;
|
||||
char str[LINE_LEN];
|
||||
char str[COMMAND_LEN];
|
||||
CLIENT *prefix, *target = NULL;
|
||||
|
||||
/* Determine target */
|
||||
|
||||
@@ -50,7 +50,9 @@ GLOBAL pid_t
|
||||
Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc)(int, short), int timeout)
|
||||
{
|
||||
pid_t pid;
|
||||
#ifndef HAVE_ARC4RANDOM
|
||||
unsigned int seed;
|
||||
#endif
|
||||
|
||||
assert(proc != NULL);
|
||||
assert(pipefds != NULL);
|
||||
@@ -62,7 +64,9 @@ Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc)(int, short), int timeout
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef HAVE_ARC4RANDOM
|
||||
seed = (unsigned int)rand();
|
||||
#endif
|
||||
pid = fork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
@@ -73,7 +77,9 @@ Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc)(int, short), int timeout
|
||||
return -1;
|
||||
case 0:
|
||||
/* New child process: */
|
||||
#ifndef HAVE_ARC4RANDOM
|
||||
srand(seed ^ (unsigned int)time(NULL) ^ getpid());
|
||||
#endif
|
||||
Signals_Exit();
|
||||
signal(SIGTERM, Proc_GenericSignalHandler);
|
||||
signal(SIGALRM, Proc_GenericSignalHandler);
|
||||
|
||||
@@ -144,11 +144,16 @@ ngt_RandomStr(char *String, const size_t len)
|
||||
assert(String != NULL);
|
||||
|
||||
gettimeofday(&t, NULL);
|
||||
#ifndef HAVE_ARC4RANDOM
|
||||
srand((unsigned)(t.tv_usec * t.tv_sec));
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
String[i] = chars[rand() % (sizeof(chars) - 1)];
|
||||
}
|
||||
#else
|
||||
for (i = 0; i < len; ++i)
|
||||
String[i] = chars[arc4random() % (sizeof(chars) - 1)];
|
||||
#endif
|
||||
String[len] = '\0';
|
||||
|
||||
return String;
|
||||
|
||||
Reference in New Issue
Block a user