1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 12:56:18 +00:00
Commit Graph

2863 Commits

Author SHA1 Message Date
Sebastian Köhler
b3d4cf9081 KICK: Fix denial of service bug
Test if the user that it is to be kicked is on the channel before user
channel modes are tested. Otherwise assert( cl2chan != NULL ); in
line 742 would fail and stop the service.
(cherry picked from commit 0e63fb3fa7)
2013-02-15 11:56:24 +01:00
Alexander Barton
1265eb15b8 "WHO <hostmask>": use displayed hostname for matching
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!

Thanks to DNS <dns@rbose.org> for reporting this issue.
(cherry picked from commit 1e8b775a7a)
2013-02-13 22:12:09 +01:00
Alexander Barton
84612fe773 autogen.sh: Don't use "egrep -o", use "sed"
"egrep -o" isn't portable and not available on OpenBSD, for example. So
let's use sed instead to get the automake version. The expression used
now is less specific but should work as well ...
(cherry picked from commit 419ff38a07)
2013-02-13 22:11:49 +01:00
Alexander Barton
84f5839c17 configure: "netinet/in_systm.h" is optional
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 :-)
(cherry picked from commit fd260404ca)
2013-02-13 22:11:39 +01:00
Alexander Barton
cb3b411166 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: ERR_NOTREGISTEREDSERVER(451).
(cherry picked from commit 508ca3044d)
2013-02-13 22:11:23 +01:00
Alexander Barton
121bcacb98 MODE: don't report error on "more modes than parameters"
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 ...

If ngIRCd is compiled using "strict mode", these errors are still reported.

Reported-by: Tim <tim@stackwatch.net>
(cherry picked from commit d8f2964710)
2013-02-13 22:11:14 +01:00
Alexander Barton
4105635566 Correctly detect when SSL subsystem must be initialized
This patch introduces the new function Conf_SSLInUse() to check when the
current server configuration requires the SSL subsystem to be initialized
and accounts incoming as well as outgoing connections -- so this fixes
commit bb20aeb9 ("Initialize SSL when needed only, and disable SSL on
errors") which only handled the inbound case  ...

Tested-by: Brett Smith <brett@w3.org>
(cherry picked from commit ab00997698)
2013-02-13 22:11:05 +01:00
Alexander Barton
90fce2ed16 autogen.sh: Enforce serial test harness on automake >=1.13
(cherry picked from commit 0703fcd719)
2013-02-13 22:10:49 +01:00
Alexander Barton
21493731df ngIRCd Release 20.1 2013-01-02 22:37:55 +01:00
Alexander Barton
1f59821270 Update Copyright notices for 2013 2013-01-01 19:23:56 +01:00
Alexander Barton
3e47bc9af5 Allow ERROR command on server and service links only
Ignore it and add a penalty time on all other link types.
2012-12-31 21:46:48 +01:00
Alexander Barton
5d92198487 Get rid of Conn_ResetPenalty(), it is unused 2012-12-31 18:23:21 +01:00
Alexander Barton
20ddffca0d Mode setting: only check channel user modes when on channel
Only check the channel user modes of the initiator if he is joined to
this 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 this assertion:

 Assertion failed: (cl2chan != NULL), function Channel_UserModes,
  file channel.c, line 742.

This closes bug #147, thanks to James Kirwill <james.kirwill@bk.ru>
for tracking this down!
2012-12-31 18:13:18 +01:00
Alexander Barton
25e56a5e83 Add some more casts in assert() statemens
This fixes the following warning messages of gcc 4.5.3 on Cygwin when
building with debug code enabled:

 ng_ipaddr.c: In function ‘ng_ipaddr_init’:
 ng_ipaddr.c:52:2: warning: comparison between signed and
                   unsigned integer expressions
 ng_ipaddr.c:53:20: warning: comparison between signed and
                    unsigned integer expressions

 resolve.c: In function ‘ForwardLookup’:
 resolve.c:271:3: warning: comparison between signed and
                  unsigned integer expressions
2012-12-25 19:21:40 +01:00
Alexander Barton
1e5a7aac87 Makefiles: Correctly quote sed expressions
Now the Makefiles support spaces in "$sysconfdir", which isn't uncommon
for Cygwin for example, when $HOME contains whitespaces ("/home/User Name")
and ngIRCd is installed into the user home ("./configure --prefix=$HOME").
2012-12-25 19:14:31 +01:00
Alexander Barton
b5b3dd9cfd Add Cygwin binaries (*.exe) to .gitignore files 2012-12-25 18:52:49 +01:00
Alexander Barton
92fba63ad8 Add a cast in ForwardLookup() to fix a gcc warning on Cygwin
This fixes the following warning message of 4.5.3 on Cygwin:

 resolve.c: In function ‘ForwardLookup’:
 resolve.c:273:21: warning: comparison between signed and
                   unsigned integer expressions
2012-12-25 18:49:28 +01:00
Alexander Barton
25d35dd6f4 ngIRCd Release 20 2012-12-17 13:14:32 +01:00
Alexander Barton
a445abc10e Update NEWS and ChangeLog files 2012-12-12 11:06:35 +01:00
Alexander Barton
1342f78b09 Allow user names up to 20 characters
This patch allows user names up to 20 characters when ngIRCd has not been
configured for "strict RFC mode".

Patch suggested by Brett Smith <brett@w3.org>, see
<http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>.
2012-12-10 10:41:36 +01:00
Alexander Barton
a0d57a6afd ngIRCd 20~rc2 2012-12-02 18:51:51 +01:00
Alexander Barton
c6ae353756 Update NEWS and ChangeLog files 2012-12-02 18:49:11 +01:00
Alexander Barton
12768e7a54 Update doc/Platforms.txt 2012-11-26 11:54:23 +01:00
Alexander Barton
35e2dcff88 Rework cloaked hostname handling, implement "METADATA cloakhost"
Now ngIRCd uses two fields internally, one to store the "real" hostname
and one to save the "cloaked" hostname. And both fields can be set
independently using the "METADATA host" and "METADATA cloakhost" commands.

This allows "foreign servers" (aka "IRC services") to alter the real and
cloaked hostnames of clients without problems, even when the user itself
issues additional "MODE +x" and "MODE -x" commands.
2012-11-24 16:15:35 +01:00
Alexander Barton
dc89e42ef5 RPL_UMODEIS: send correct target name, even on server links 2012-11-24 15:57:45 +01:00
Alexander Barton
4a2d74c9ab Client_HostnameCloaked() -> Client_HostnameDisplayed() 2012-11-24 13:37:56 +01:00
Alexander Barton
cd48b8128e platformtest.sh: Only generate configure script when missing 2012-11-13 23:21:09 +01:00
Alexander Barton
301d4915bc Update platformtest.sh to follow autoconf changes 2012-11-13 22:46:06 +01:00
Alexander Barton
8061056cec Test suite: correctly execute tests when stdout is redirected 2012-11-13 22:46:06 +01:00
Alexander Barton
44926b7f9f Add a few casts, fix compiler warnings on NetBSD 5
This fixes a few warnings of this type:
  XXX.c: In function 'AAA':
  XXX.c:YY: warning: array subscription has type 'char'

Tested on NetBSD 5.0.2 with gcc 4.1.3.
2012-11-12 22:39:57 +01:00
Alexander Barton
d11a700589 irc-info.c: Use strlcpy() instead of strcpy()
This fixes the following warning of gcc (tested on OpenBSD 5.0:)
  irc-info.c:990: warning: strcpy() is almost always misused,
                  please use strlcpy
2012-11-11 16:46:57 +01:00
Alexander Barton
0a26079af2 ngIRCd 20~rc1 2012-11-11 16:03:40 +01:00
Alexander Barton
b6e49f3920 Update Xcode project files 2012-11-11 12:40:47 +01:00
Alexander Barton
4123118d5a conf.c: Use strlcpy() instead of strcpy()
This fixes the following warning of gcc on OpenBSD 5.0:
  conf.c:728: warning: strcpy() is almost always misused, please use strlcpy()
2012-11-11 11:18:53 +01:00
Alexander Barton
e29d198700 tool.h: Don't check for and #define PF_INET
This is correctly handled by ipaddr/ng_ipaddr.h today, and the check
in tool.h isn't required any more -- and caused errors on OpenBSD 5.0:

  In file included from ./../tool/tool.h:23:
  /usr/include/arpa/inet.h:74:
    warning: "struct in_addr" declared inside parameter list
2012-11-11 11:05:21 +01:00
Alexander Barton
6f531a3c99 conf-ssl.h: Use "gnutls_session_t" instead of "gnutls_session"
This fixes the following warning with current versions of GnuTLS:
  conf-ssl.h:36: warning: "gnutls_session" is deprecated
2012-11-11 10:50:32 +01:00
Alexander Barton
53917fa4b8 Add new IRC+ server flag "X": "XOP modes supported"
This flag indicates, that the server supports the enhanced "xop channel
user modes", like channel owner, admin, and halfop. This information is
used to make sure that no unsupported CHANINFO commands are sent to
servers not supporting such mode prefixes, for example.
2012-11-10 23:33:19 +01:00
Alexander Barton
646218e6f4 Update autoconf/automake version numbers in doc/HowToRelease.txt 2012-11-10 21:50:36 +01:00
Alexander Barton
4185c4a44a Update NEWS and ChangeLog files 2012-11-10 21:49:02 +01:00
Alexander Barton
45b0bb5aff Remove Anope "ngircd" protocol module patches
Starting with Anope 1.9.8, the ngIRCd protocol module is included in the
Anope distribution, so there's no longer any need to support our own (but
now heavily outdated!) patches. Therefore remove them.
2012-11-10 21:26:25 +01:00
Alexander Barton
c7db2f8429 doc/Services.txt: Update documentation for Anope 1.9.8
Starting with Anope 1.9.8, the ngIRCd protocol module is rewritten from
scratch by "DukePyrolator" and included in the Anope distribution. So no
patching is required any more, yeah!

Drawback: Anope 1.9.8 is in development and not yet released ...
2012-11-10 21:24:55 +01:00
Alexander Barton
f0b86e6c26 Correctly add irc-metadata.{c|h} to Makefile.ng ... 2012-11-05 23:57:14 +01:00
Alexander Barton
7871a904d7 doc/Protocol.txt: Document METADATA command 2012-11-05 23:51:52 +01:00
Alexander Barton
40e3daf560 Generate "METADATA host" commands on "MODE +/-x"
Use "METADATA host" commands to let servers supporting this command
know which (possibly cloaked) hostname is in effect for a specific
client. This prevents "double cloaking" of hostnames and even cloaked
hostnames are in sync on all servers supporting "METADATA" now.
2012-11-05 23:49:12 +01:00
Alexander Barton
44b7ff02fd Don't cloak already cloaked hostname when using METADATA
A client for which a METADATA command has been received from one of
its peers got the client flag "M" set. So it's safe to assume that
such a client gets "METADATA host" commands for its cloaked hostname
and the server must not cloak the hostname on its own, even when the
client mode "+x" is set.
2012-11-05 23:46:26 +01:00
Alexander Barton
35ed57e6c1 Implement METADATA command to update client metadata
The METADATA command can be used by other servers to update "metadata"
of registered clients, like the client info text ("real name"), user
name, and hostname:

  :<prefix> METADATA <target> <key> :<value>

It is distributed in the network, unknown <key> names are silently ignored
and passed on, too. This allows for further extensions.
2012-11-05 23:34:21 +01:00
Alexander Barton
79731a57f3 doc/Protocol.txt: add/fix CHARCONV description 2012-11-05 23:11:41 +01:00
DNS777
a7f37cebdc PredefChannelsOnly: Fix message for non pre-defined channels
If PredefChannelsOnly is enabled, and if someone tries to create
a channel which does not exist, then the error message is a 474.
The 474 Error message changed recently and does not match anymore:
'Cannot join channel (+b) -- You are banned'.

Changed the error message to numeric 403 'No such channel'.

Bug introduced by commit 9a82304a.

(cherry picked from commit 2c2e08f34187a33c1da745995c5f213e33a91410)
2012-11-04 20:38:36 +01:00
Alexander Barton
47b99c69cc Test suite: add some "remote checks" to whois-test.e 2012-11-04 19:50:02 +01:00
Alexander Barton
757f3497bc Send NICK commands with prefix of (target) user
Now NICK commands are always generated using the prefix of the target
user, even when the nickname change has been initiated by some other
(pseudo) server or using the SVSNICK command. In this case, the prefix
of the initiator has been used, but this isn't compatible with clients
(at least weechat and irssi don't handle such NICK commands correctly).
2012-11-04 18:01:49 +01:00