mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-27 20:17:56 +00:00
Compare commits
21 Commits
rel-20-rc2
...
rel-20.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c45d9dd1f0 | ||
|
|
b3d4cf9081 | ||
|
|
1265eb15b8 | ||
|
|
84612fe773 | ||
|
|
84f5839c17 | ||
|
|
cb3b411166 | ||
|
|
121bcacb98 | ||
|
|
4105635566 | ||
|
|
90fce2ed16 | ||
|
|
21493731df | ||
|
|
1f59821270 | ||
|
|
3e47bc9af5 | ||
|
|
5d92198487 | ||
|
|
20ddffca0d | ||
|
|
25e56a5e83 | ||
|
|
1e5a7aac87 | ||
|
|
b5b3dd9cfd | ||
|
|
92fba63ad8 | ||
|
|
25d35dd6f4 | ||
|
|
a445abc10e | ||
|
|
1342f78b09 |
2
AUTHORS
2
AUTHORS
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2012 Alexander Barton and Contributors.
|
||||
(c)2001-2013 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
|
||||
53
ChangeLog
53
ChangeLog
@@ -2,14 +2,63 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2012 Alexander Barton and Contributors.
|
||||
(c)2001-2013 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
-- ChangeLog --
|
||||
|
||||
|
||||
ngIRCd
|
||||
ngIRCd 20.2 (2013-02-15)
|
||||
|
||||
- Security: Fix a denial of service bug in the function handling KICK
|
||||
commands that could be used by arbitrary users to to crash the daemon.
|
||||
- WHO command: Use the currently "displayed hostname" (which can be cloaked!)
|
||||
for hostname matching, not the real one. In other words: don't display all
|
||||
the cloaked users on a specific real hostname!
|
||||
- configure: The header file "netinet/in_systm.h" already is optional in
|
||||
ngIRCd, so don't require it in the configure script. Now ngIRCd can be
|
||||
built on Minix 3 again :-)
|
||||
- Return better "Connection not registered as server link" errors: Now ngIRCd
|
||||
returns a more specific error message for numeric ERR_NOTREGISTERED(451)
|
||||
when a regular user tries to use a command that isn't allowed for users but
|
||||
for servers.
|
||||
- Don't report ERR_NEEDMOREPARAMS(461) when a MDOE command with more modes
|
||||
than nicknames is handled, as well as for channel limit and key changes
|
||||
without specifying the limit or key parameters.
|
||||
This is how a lot (all?) other IRC servers behave, including ircd2.11,
|
||||
InspIRCd, and ircd-seven. And because of clients (tested with Textual and
|
||||
mIRC) sending bogus MODE commands like "MODE -ooo nick", end-users got the
|
||||
expected result as well as correct but misleading error messages ...
|
||||
- Correctly detect when SSL subsystem must be initialized and take
|
||||
outgoing connections (server links!) into account, too.
|
||||
- autogen.sh: Enforce serial test harness on GNU automake >=1.13. The
|
||||
new parallel test harness which is enabled by default starting with
|
||||
automake 1.13 isn't compatible with our test suite.
|
||||
And don't use "egrep -o", insetead use "sed", because it isn't portable
|
||||
and not available on OpenBSD, for example.
|
||||
|
||||
ngIRCd 20.1 (2013-01-02)
|
||||
|
||||
- Allow ERROR command on server and service links only, ignore them and
|
||||
add a penalty time on all other link types.
|
||||
- Enforced mode setting by IRC Operators: Only check the channel user
|
||||
modes of the initiator if he is joined to the channel and not an IRC
|
||||
operator enforcing modes (which requires the configuration option
|
||||
"OperCanUseMode" to be enabled), because trying to check channel user
|
||||
modes of a non-member results in an assertion when running with debug
|
||||
code or could crash the daemon otherwise. This closes bug #147, thanks
|
||||
to James Kirwill <james.kirwill@bk.ru> for tracking this down!
|
||||
- Fix build system to cope with spaces in path names.
|
||||
- Code cleanups, mostly to fix build warnings on Cygwin.
|
||||
|
||||
ngIRCd 20 (2012-12-17)
|
||||
|
||||
- Allow user names ("INDENT") up to 20 characters when ngIRCd has not
|
||||
been configured for "strict RFC mode". This is useful if you are using
|
||||
external (PAM) authenticaion mechanisms that require longer user names.
|
||||
Patch suggested by Brett Smith <brett@w3.org>, see
|
||||
<http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>.
|
||||
|
||||
ngIRCd 20~rc2 (2012-12-02)
|
||||
- Rework cloaked hostname handling and implement the "METADATA cloakhost"
|
||||
|
||||
2
INSTALL
2
INSTALL
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2012 Alexander Barton and Contributors.
|
||||
(c)2001-2013 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
|
||||
20
NEWS
20
NEWS
@@ -2,14 +2,30 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2012 Alexander Barton and Contributors.
|
||||
(c)2001-2013 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
-- NEWS --
|
||||
|
||||
|
||||
ngIRCd
|
||||
ngIRCd 20.2 (2013-02-15)
|
||||
|
||||
- This release is a bugfix release only, without new features.
|
||||
- Security: Fix a denial of service bug in the function handling KICK
|
||||
commands that could be used by arbitrary users to to crash the daemon.
|
||||
|
||||
ngIRCd 20.1 (2013-01-02)
|
||||
|
||||
- This release is a bugfix release only, without new features.
|
||||
|
||||
ngIRCd 20 (2012-12-17)
|
||||
|
||||
- Allow user names ("INDENT") up to 20 characters when ngIRCd has not
|
||||
been configured for "strict RFC mode". This is useful if you are using
|
||||
external (PAM) authenticaion mechanisms that require longer user names.
|
||||
Patch suggested by Brett Smith <brett@w3.org>, see
|
||||
<http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>.
|
||||
|
||||
ngIRCd 20~rc2 (2012-12-02)
|
||||
- Rework cloaked hostname handling and implement the "METADATA cloakhost"
|
||||
|
||||
2
README
2
README
@@ -2,7 +2,7 @@
|
||||
ngIRCd - Next Generation IRC Server
|
||||
http://ngircd.barton.de/
|
||||
|
||||
(c)2001-2012 Alexander Barton and Contributors.
|
||||
(c)2001-2013 Alexander Barton and Contributors.
|
||||
ngIRCd is free software and published under the
|
||||
terms of the GNU General Public License.
|
||||
|
||||
|
||||
16
autogen.sh
16
autogen.sh
@@ -153,7 +153,7 @@ echo "Searching for required tools ..."
|
||||
[ -z "$AUTOMAKE" ] && Notfound automake
|
||||
[ -z "$AUTOCONF" ] && Notfound autoconf
|
||||
|
||||
AM_VERSION=`$AUTOMAKE --version|head -n 1|egrep -o "([1-9]\.[0-9]+(\.[0-9]+)*)"`
|
||||
AM_VERSION=`$AUTOMAKE --version | head -n 1 | sed -e 's/.* //g'`
|
||||
ifs=$IFS; IFS="."; set $AM_VERSION; IFS=$ifs
|
||||
AM_MAJOR="$1"; AM_MINOR="$2"; AM_PATCHLEVEL="$3"
|
||||
|
||||
@@ -172,11 +172,21 @@ else
|
||||
DEANSI_START="#"
|
||||
DEANSI_END=" # disabled by ./autogen.sh script"
|
||||
fi
|
||||
sed -e "s|^__ng_Makefile_am_template__|${DEANSI_START}AUTOMAKE_OPTIONS = ansi2knr${DEANSI_END}|g" \
|
||||
# Serial test harness?
|
||||
if [ "$AM_MAJOR" -eq "1" -a "$AM_MINOR" -ge "13" ]; then
|
||||
# automake >= 1.13 => enforce "serial test harness"
|
||||
echo " - Enforcing serial test harness."
|
||||
SERIAL_TESTS="serial-tests"
|
||||
else
|
||||
# automake < 1.13 => no new test harness, nothing to do
|
||||
SERIAL_TEST=""
|
||||
fi
|
||||
|
||||
sed -e "s|^__ng_Makefile_am_template__|AUTOMAKE_OPTIONS = ${SERIAL_TESTS} ${DEANSI_START}ansi2knr${DEANSI_END}|g" \
|
||||
src/portab/Makefile.ng >src/portab/Makefile.am
|
||||
for makefile_ng in $AM_MAKEFILES; do
|
||||
makefile_am=`echo "$makefile_ng" | sed -e "s|\.ng\$|\.am|g"`
|
||||
sed -e "s|^__ng_Makefile_am_template__|${DEANSI_START}AUTOMAKE_OPTIONS = ../portab/ansi2knr${DEANSI_END}|g" \
|
||||
sed -e "s|^__ng_Makefile_am_template__|AUTOMAKE_OPTIONS = ${SERIAL_TESTS} ${DEANSI_START}../portab/ansi2knr${DEANSI_END}|g" \
|
||||
$makefile_ng >$makefile_am
|
||||
done
|
||||
|
||||
|
||||
@@ -120,14 +120,14 @@ AC_HEADER_TIME
|
||||
|
||||
# Required header files
|
||||
AC_CHECK_HEADERS([ \
|
||||
fcntl.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h \
|
||||
fcntl.h netdb.h netinet/in.h stdlib.h string.h \
|
||||
strings.h sys/socket.h sys/time.h unistd.h \
|
||||
],,AC_MSG_ERROR([required C header missing!]))
|
||||
|
||||
# Optional header files
|
||||
AC_CHECK_HEADERS_ONCE([ \
|
||||
arpa/inet.h inttypes.h malloc.h netinet/ip.h stdbool.h stddef.h \
|
||||
stdint.h varargs.h \
|
||||
arpa/inet.h inttypes.h malloc.h netinet/in_systm.h netinet/ip.h \
|
||||
stdbool.h stddef.h stdint.h varargs.h \
|
||||
])
|
||||
|
||||
# -- Datatypes --
|
||||
@@ -711,7 +711,8 @@ echo $ECHO_N " libiconv support: $ECHO_C"
|
||||
|
||||
echo
|
||||
|
||||
if ! grep "^AUTOMAKE_OPTIONS = ../portab/ansi2knr" src/ngircd/Makefile.am >/dev/null 2>&1; then
|
||||
define(_automake_regex_,[[^AUTOMAKE_OPTIONS = [a-z .\-]*/portab/ansi2knr]])
|
||||
if ! grep "_automake_regex_" src/ngircd/Makefile.am >/dev/null 2>&1; then
|
||||
echo "WARNING:"
|
||||
echo "This GNU automake generated build system does not support \"de-ANSI-fication\","
|
||||
echo "therefore don't use it to generate \"official\" distribution archives!"
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
ngircd (20.2-0ab1) unstable; urgency=high
|
||||
|
||||
* New "upstream" release, fixing a security related bug: ngIRCd 20.2.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Fri, 15 Feb 2013 12:17:00 +0100
|
||||
|
||||
ngircd (20.1-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release: ngIRCd 20.1.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Wed, 02 Jan 2013 22:37:26 +0100
|
||||
|
||||
ngircd (20-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release: ngIRCd 20.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Mon, 17 Dec 2012 13:04:15 +0100
|
||||
|
||||
ngircd (20~rc2-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release candidate 2 for ngIRCd Release 20.
|
||||
|
||||
@@ -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-2011 Alexander Barton and Contributors.\
|
||||
Copyright (c)2001-2013 Alexander Barton and Contributors.\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
|
||||
|
||||
\i0 \cf0 \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version 20~rc2
|
||||
%define version 20.2
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
.tmpl:
|
||||
$(AM_V_GEN)sed \
|
||||
-e s@:ETCDIR:@${sysconfdir}@ \
|
||||
-e "s@:ETCDIR:@${sysconfdir}@" \
|
||||
<$< >$@
|
||||
|
||||
SUFFIXES = .tmpl
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
#
|
||||
# ngIRCd -- The Next Generation IRC Daemon
|
||||
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
|
||||
# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors
|
||||
#
|
||||
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
|
||||
# der GNU General Public License (GPL), wie von der Free Software Foundation
|
||||
# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
|
||||
# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
|
||||
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
#
|
||||
# $Id: Makefile.am,v 1.6 2006/12/25 16:13:26 alex Exp $
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
# Please read the file COPYING, README and AUTHORS for more information.
|
||||
#
|
||||
|
||||
TEMPLATE_MANS = ngircd.conf.5.tmpl ngircd.8.tmpl
|
||||
@@ -18,9 +15,9 @@ SUFFIXES = .tmpl .
|
||||
|
||||
.tmpl:
|
||||
$(AM_V_GEN)sed \
|
||||
-e s@:SBINDIR:@${sbindir}@ \
|
||||
-e s@:BINDIR:@${bindir}@ \
|
||||
-e s@:ETCDIR:@${sysconfdir}@ \
|
||||
-e "s@:SBINDIR:@${sbindir}@" \
|
||||
-e "s@:BINDIR:@${bindir}@" \
|
||||
-e "s@:ETCDIR:@${sysconfdir}@" \
|
||||
<$< >$@
|
||||
|
||||
man_MANS = ngircd.conf.5 ngircd.8
|
||||
|
||||
@@ -49,8 +49,8 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port)
|
||||
if (ret != 0)
|
||||
return false;
|
||||
|
||||
assert(sizeof(*addr) >= res0->ai_addrlen);
|
||||
if (sizeof(*addr) >= res0->ai_addrlen)
|
||||
assert(sizeof(*addr) >= (size_t)res0->ai_addrlen);
|
||||
if (sizeof(*addr) >= (size_t)res0->ai_addrlen)
|
||||
memcpy(addr, res0->ai_addr, res0->ai_addrlen);
|
||||
else
|
||||
ret = -1;
|
||||
|
||||
1
src/ngircd/.gitignore
vendored
1
src/ngircd/.gitignore
vendored
@@ -2,3 +2,4 @@ Makefile.am
|
||||
check-help
|
||||
check-version
|
||||
ngircd
|
||||
ngircd.exe
|
||||
|
||||
@@ -326,6 +326,13 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name,
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that the client to be kicked is on the specified channel */
|
||||
if (!Channel_IsMemberOf(chan, Target)) {
|
||||
IRC_WriteStrClient(Origin, ERR_USERNOTINCHANNEL_MSG,
|
||||
Client_ID(Origin), Client_ID(Target), Name );
|
||||
return;
|
||||
}
|
||||
|
||||
if(Client_Type(Peer) == CLIENT_USER) {
|
||||
/* Channel mode 'Q' and user mode 'q' on target: nobody but
|
||||
* IRC Operators and servers can kick the target user */
|
||||
@@ -382,13 +389,6 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name,
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that the client to be kicked is on the specified channel */
|
||||
if (!Channel_IsMemberOf(chan, Target)) {
|
||||
IRC_WriteStrClient(Origin, ERR_USERNOTINCHANNEL_MSG,
|
||||
Client_ID(Origin), Client_ID(Target), Name );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Kick Client from channel */
|
||||
Remove_Client( REMOVE_KICK, chan, Target, Origin, Reason, true);
|
||||
} /* Channel_Kick */
|
||||
|
||||
@@ -108,6 +108,28 @@ ConfSSL_Init(void)
|
||||
array_free(&Conf_SSLOptions.ListenPorts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current configuration uses/requires SSL.
|
||||
*
|
||||
* @returns true if SSL is used and should be initialized.
|
||||
*/
|
||||
GLOBAL bool
|
||||
Conf_SSLInUse(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* SSL listen ports configured? */
|
||||
if (array_bytes(&Conf_SSLOptions.ListenPorts))
|
||||
return true;
|
||||
|
||||
for (i = 0; i < MAX_SERVERS; i++) {
|
||||
if (Conf_Server[i].port > 0
|
||||
&& Conf_Server[i].SSLConnect)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure that a configured file is readable.
|
||||
*
|
||||
|
||||
@@ -253,6 +253,10 @@ GLOBAL bool Conf_AddServer PARAMS(( const char *Name, UINT16 Port, const char *H
|
||||
GLOBAL bool Conf_NickIsService PARAMS((int ConfServer, const char *Nick));
|
||||
GLOBAL bool Conf_NickIsBlocked PARAMS((const char *Nick));
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
GLOBAL bool Conf_SSLInUse PARAMS((void));
|
||||
#endif
|
||||
|
||||
/* Password required by WEBIRC command */
|
||||
GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN];
|
||||
|
||||
|
||||
@@ -117,24 +117,6 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds)
|
||||
} /* Conn_SetPenalty */
|
||||
|
||||
|
||||
/**
|
||||
* Reset the "penalty time" for one connection.
|
||||
*
|
||||
* @param Idx Connection index.
|
||||
* @see Conn_SetPenalty
|
||||
*/
|
||||
GLOBAL void
|
||||
Conn_ResetPenalty(CONN_ID Idx)
|
||||
{
|
||||
assert(Idx > NONE);
|
||||
|
||||
My_Connections[Idx].delaytime = 0;
|
||||
#ifdef DEBUG
|
||||
Log(LOG_DEBUG, "Penalty time on connection %d has been reset.");
|
||||
#endif
|
||||
} /* Conn_ResetPenalty */
|
||||
|
||||
|
||||
GLOBAL void
|
||||
Conn_ClearFlags( void )
|
||||
{
|
||||
|
||||
@@ -45,7 +45,6 @@ GLOBAL long Conn_RecvBytes PARAMS(( CONN_ID Idx ));
|
||||
GLOBAL const char *Conn_IPA PARAMS(( CONN_ID Idx ));
|
||||
|
||||
GLOBAL void Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds ));
|
||||
GLOBAL void Conn_ResetPenalty PARAMS(( CONN_ID Idx ));
|
||||
|
||||
GLOBAL void Conn_ClearFlags PARAMS(( void ));
|
||||
GLOBAL int Conn_Flag PARAMS(( CONN_ID Idx ));
|
||||
|
||||
@@ -241,8 +241,10 @@ void ConnSSL_Free(CONNECTION *c)
|
||||
bool
|
||||
ConnSSL_InitLibrary( void )
|
||||
{
|
||||
if (!array_bytes(&Conf_SSLOptions.ListenPorts))
|
||||
if (!Conf_SSLInUse()) {
|
||||
LogDebug("SSL not in use, skipping initialization.");
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBSSL
|
||||
SSL_CTX *newctx;
|
||||
|
||||
@@ -99,7 +99,11 @@
|
||||
#define CLIENT_PASS_LEN 21
|
||||
|
||||
/** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */
|
||||
#define CLIENT_USER_LEN 10
|
||||
#ifndef STRICT_RFC
|
||||
# define CLIENT_USER_LEN 20
|
||||
#else
|
||||
# define CLIENT_USER_LEN 10
|
||||
#endif
|
||||
|
||||
/** Max. length of "real names" (including NULL). */
|
||||
#define CLIENT_NAME_LEN 32
|
||||
|
||||
@@ -950,7 +950,7 @@ IRC_WHO_Mask(CLIENT *Client, char *Mask, bool OnlyOps)
|
||||
if (Mask) {
|
||||
/* Match pattern against user host/server/name/nick */
|
||||
client_match = MatchCaseInsensitive(Mask,
|
||||
Client_Hostname(c));
|
||||
Client_HostnameDisplayed(c));
|
||||
if (!client_match)
|
||||
client_match = MatchCaseInsensitive(Mask,
|
||||
Client_ID(Client_Introducer(c)));
|
||||
|
||||
@@ -550,7 +550,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
if (arg_arg >= Req->argc)
|
||||
arg_arg = -1;
|
||||
|
||||
if(!is_machine) {
|
||||
if(!is_machine && !is_oper) {
|
||||
o_mode_ptr = Channel_UserModes(Channel, Client);
|
||||
while( *o_mode_ptr ) {
|
||||
if ( *o_mode_ptr == 'q')
|
||||
@@ -628,9 +628,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
Req->argv[arg_arg][0] = '\0';
|
||||
arg_arg++;
|
||||
} else {
|
||||
#ifdef STRICT_RFC
|
||||
/* Only send error message in "strict" mode,
|
||||
* this is how ircd2.11 and others behave ... */
|
||||
connected = IRC_WriteStrClient(Origin,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Origin), Req->command);
|
||||
#endif
|
||||
goto chan_exit;
|
||||
}
|
||||
break;
|
||||
@@ -668,9 +672,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
Req->argv[arg_arg][0] = '\0';
|
||||
arg_arg++;
|
||||
} else {
|
||||
#ifdef STRICT_RFC
|
||||
/* Only send error message in "strict" mode,
|
||||
* this is how ircd2.11 and others behave ... */
|
||||
connected = IRC_WriteStrClient(Origin,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Origin), Req->command);
|
||||
#endif
|
||||
goto chan_exit;
|
||||
}
|
||||
break;
|
||||
@@ -761,9 +769,17 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
|
||||
Req->argv[arg_arg][0] = '\0';
|
||||
arg_arg++;
|
||||
} else {
|
||||
#ifdef STRICT_RFC
|
||||
/* Report an error to the client, when a user
|
||||
* mode should be changed but no nickname is
|
||||
* given. But don't do it when not in "strict"
|
||||
* mode, because most other servers don't do
|
||||
* it as well and some clients send "wired"
|
||||
* MODE commands like "MODE #chan -ooo nick". */
|
||||
connected = IRC_WriteStrClient(Origin,
|
||||
ERR_NEEDMOREPARAMS_MSG,
|
||||
Client_ID(Origin), Req->command);
|
||||
#endif
|
||||
goto chan_exit;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -81,6 +81,17 @@ IRC_ERROR( CLIENT *Client, REQUEST *Req )
|
||||
assert( Client != NULL );
|
||||
assert( Req != NULL );
|
||||
|
||||
if (Client_Type(Client) != CLIENT_GOTPASS
|
||||
&& Client_Type(Client) != CLIENT_GOTPASS_2813
|
||||
&& Client_Type(Client) != CLIENT_UNKNOWNSERVER
|
||||
&& Client_Type(Client) != CLIENT_SERVER
|
||||
&& Client_Type(Client) != CLIENT_SERVICE) {
|
||||
LogDebug("Ignored ERROR command from \"%s\" ...",
|
||||
Client_Mask(Client));
|
||||
IRC_SetPenalty(Client, 2);
|
||||
return CONNECTED;
|
||||
}
|
||||
|
||||
if (Req->argc < 1)
|
||||
Log(LOG_NOTICE, "Got ERROR from \"%s\"!",
|
||||
Client_Mask(Client));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001-2012 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
|
||||
@@ -460,7 +460,7 @@ static void
|
||||
Show_Version( void )
|
||||
{
|
||||
puts( NGIRCd_Version );
|
||||
puts( "Copyright (c)2001-2012 Alexander Barton (<alex@barton.de>) and Contributors." );
|
||||
puts( "Copyright (c)2001-2013 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." );
|
||||
|
||||
@@ -514,10 +514,20 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(client_type & cmd->type))
|
||||
return IRC_WriteStrClient(client, ERR_NOTREGISTERED_MSG, Client_ID(client));
|
||||
if (!(client_type & cmd->type)) {
|
||||
if (client_type == CLIENT_USER
|
||||
&& cmd->type & CLIENT_SERVER)
|
||||
return IRC_WriteStrClient(client,
|
||||
ERR_NOTREGISTEREDSERVER_MSG,
|
||||
Client_ID(client));
|
||||
else
|
||||
return IRC_WriteStrClient(client,
|
||||
ERR_NOTREGISTERED_MSG,
|
||||
Client_ID(client));
|
||||
}
|
||||
|
||||
/* Command is allowed for this client: call it and count produced bytes */
|
||||
/* Command is allowed for this client: call it and count
|
||||
* generated bytes in output */
|
||||
Conn_ResetWCounter();
|
||||
result = (cmd->function)(client, Req);
|
||||
cmd->bytes += Conn_WCounter();
|
||||
|
||||
@@ -268,9 +268,9 @@ ForwardLookup(const char *hostname, array *IpAddr, int af)
|
||||
}
|
||||
|
||||
for (a = ai_results; a != NULL; a = a->ai_next) {
|
||||
assert(a->ai_addrlen <= sizeof(addr));
|
||||
assert((size_t)a->ai_addrlen <= sizeof(addr));
|
||||
|
||||
if (a->ai_addrlen > sizeof(addr))
|
||||
if ((size_t)a->ai_addrlen > sizeof(addr))
|
||||
continue;
|
||||
|
||||
memcpy(&addr, a->ai_addr, a->ai_addrlen);
|
||||
|
||||
1
src/portab/.gitignore
vendored
1
src/portab/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
Makefile.am
|
||||
portabtest
|
||||
portabtest.exe
|
||||
|
||||
2
src/testsuite/.gitignore
vendored
2
src/testsuite/.gitignore
vendored
@@ -1,6 +1,8 @@
|
||||
Makefile.am
|
||||
T-ngircd1
|
||||
T-ngircd1.exe
|
||||
T-ngircd2
|
||||
T-ngircd2.exe
|
||||
channel-test
|
||||
connect-test
|
||||
invite-test
|
||||
|
||||
Reference in New Issue
Block a user