Commit Graph

1873 Commits

Author SHA1 Message Date
Alexander Barton 258e39e89f Fix GCC warnings for possibly uninitialized variables in IRC_JOIN
This patch fixes the following two warnings of GCC 4.2.4:

irc-channel.c: In function "IRC_JOIN":
irc-channel.c:185:
 warning: "lastkey" may be used uninitialized in this function
irc-channel.c:185:
 warning: "lastchan" may be used uninitialized in this function
2008-06-16 13:18:03 +02:00
Alexander Barton e142c50ae6 GIT: added src/src/config.h.in~ to ignore list. 2008-06-11 16:02:06 +02:00
Alexander Barton a84f7dcee5 Allow mixed line terminations (CR+LF/CR/LF) in non-RFC-compliant mode
Up to now ngIRCd accepted CR+LF as well as a single CR or LF in "non RFC
compliant" mode (the default). But ngIRCd became confused when it received
data containing mixed line endings (e. g. "111\r222\n333\r\n").

This patch enables ngIRCd (in "non RFC compliant" mode) to detect CR+LF,
CR, and LF as equally good line termination sequences and to always end the
command after the first one detected.

Some clients (for exmaple Trilian) are that ... broken to send such mixed
line terminations ...

First patch proposed by Scott Perry <scperry@ucsd.edu>,
Thanks to Ali Shemiran <ashemira@ucsd.edu> for testing!
2008-06-11 16:00:38 +02:00
Alexander Barton 8644cbf197 Don't allow stray \r or \n in command parameters
If ngircd receives an input line like "COMMAND arg\nIRRELEVANT\r\n",
"arg\nIRRELEVANT" is passed as an argument to COMMAND. This can lead
to output like:

:ngircd.test.server 322 nick #chan 1 :
topicwithprecedingnewline
:ngircd.test.server 322 nick #nxtchan 1 :
[..]

Worse, this allows clients to piggyback irc commands, e.g.
"TOPIC #a :test\n:fake!~a@nonexistant JOIN :#a\r\n", which
causes the client to receive a JOIN command during /LIST output.

Bug reported by Scott Perry, first patch by Florian Westphal.
2008-05-30 14:58:25 +02:00
Alexander Barton 4c121f277d GIT: ignore de.barton.ngircd.plist, it is a generated file. 2008-05-28 03:00:22 +02:00
Alexander Barton 12f5b0579b ngircd.init: use LSB logging functions, if available. 2008-05-28 01:50:18 +02:00
Alexander Barton 6f7b669bec --configtest: return non-zero exit code if there are errors 2008-05-28 00:31:20 +02:00
Alexander Barton 951314cb79 Handle_Buffer(): code cleanup.
Both callers ignore the return code of this function, so get rid of it,
but make sure that the client is disconnected on errors.
2008-05-26 23:38:32 +02:00
Alexander Barton d360871394 Conn_Handler(): cleanup code, add/translate comments.
In addition, the "timeout" variable has been removed because it is
unnecessary today: Handle_Buffer() handles all the data it can handle,
and io_dispatch() returns immediately when new data is available. So
we don't have to double-check but better sleep. Pointed out by Florian.
2008-05-26 21:38:27 +02:00
Scott Perry b90f71ca2a Use strtok_r instead of strchr in IRC_JOIN.
This patch does significant cleanup on the join code by using strtok_r
instead of mangling strchr to parse channel names and keys in parallel when
a JOIN command contains a list of channels and keys.

Also adds an strtok_r implementation to libportab.
2008-05-26 21:20:03 +02:00
Alexander Barton d060e90de0 Mac OS X LaunchDaemon script: log messages to /Library/Logs/ngIRCd.log 2008-05-26 17:48:02 +02:00
Florian Westphal 73f7201ab3 configure.in: don't check for "obvious" standard functions.
Drop checks for the following C standard functions:
malloc, memmove, memset, realloc, strchr, strcspn, strerror, strstr.

Rationale: These are standard K&R/C89 functions, no point in
''making sure they exist''.
2008-05-25 20:16:25 +02:00
Alexander Barton 956bbe2c28 Reset client idle time on NICK, JOIN, and PART 2008-05-24 21:50:54 +02:00
Florian Westphal e19f7a8c19 Remove ListenIPv4/ListenIPv6 options.
Use "Listen = list,of,addresses" instead.
2008-05-19 14:34:48 +02:00
Florian Westphal 4ed2cb1a02 make Listen parameter a comma-seperated list of addresses.
this also obsoletes ListenIPv4 and ListenIPv6 options.
If Listen is unset, it is treated as Listen="::,0.0.0.0".

Note: ListenIPv4 and ListenIPv6 options are still recognized,
but ngircd will print a warning if they are used in the config file.

Also, some plattforms require that ai_socktype
is set in the getaddrinfo() hints structure.
2008-05-19 14:27:35 +02:00
Jari Aalto 818a206a42 Add option aliases -V (for --version) and -h (for --help).
This patch adds -h and -V short options (to complement the usage).

It is based on a patch attached to Debian bug #466063, see
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466063>.

Idea by Jari Aalto <jari.aalto@cante.net>,
patch adapted by Alexander Barton <alex@barton.de>.
2008-05-18 16:19:41 +02:00
Florian Westphal 1d9067b019 Add FAQ entry for 'Where is the log file'? 2008-05-15 15:41:23 +02:00
Brandon Beresini 5d87f6ba80 Add tests for MOTD, VERSION, TIME, USERHOST
The misc-test.e file is also somewhat reorganized and commented here.

Patch from Brandon Beresini, Bryan Caldwell and Dana Dahlstrom.
2008-05-15 11:13:45 +02:00
Alexander Barton 7cf187c09f Updated list of authors (AUTHORS file) 2008-05-13 16:21:14 +02:00
Alexander Barton 9486bc7465 Update master development branch
- use "dev" instead of "HEAD" as "version number",
- update ChangeLog and NEWS to reflect the 0.12.0 release.
2008-05-13 16:12:15 +02:00
Alexander Barton d02b083543 Merge commit 'aad49bd260494878aed6795c7a897ad1d28c3082' 2008-05-13 12:14:14 +02:00
Scott Perry 70254a5553 This patch implements a (maybe) compliant WHOWAS command.
It is hard to test this in the test suite because we 1) shouldn't rely on
previous tests populating WHOWAS and 2) don't connect a user for more than 30
seconds.

Also makes WHOWAS return ERR_NONICKNAMEGIVEN_MSG as implied by RFC.
2008-05-12 18:56:31 +02:00
Florian Westphal b1d38de4d2 If bind() fails, also print ip address and not just the port number. 2008-05-12 18:46:55 +02:00
Alexander Barton aad49bd260 Update ngIRCd manual pages
- Update timestamp,
- enhance some phrasing,
- and fix "Passive" ([Server]) formatting.
2008-05-11 17:08:46 +02:00
Alexander Barton d90cc7add0 GIT: ignore symbolic links to tests in testsuite directory
Added symbolic links to new tests (invite-test, join-test, and kick-test)
to .gitignore file.
2008-05-11 15:20:46 +02:00
Alexander Barton 149859c5fe Fixes to who-test: accept "localhost.<domain>" as well as "localhost"
Some operating systems, for example OpenBSD, use "localhost.<domain>"
instead of "localhost", so the "who-test" expecting "localhost" failed
on such systems.
2008-05-11 15:17:22 +02:00
Florian Westphal d9c26f3aeb ng_ipaddr.h must include netinet/in.h.
compile on FreeBSD 5.4 failed with:
./../ipaddr/ng_ipaddr.h:34: error: field `sin4' has incomplete type

Reported and tested by Jefferson S Almeida.
2008-05-10 21:49:51 +02:00
Brandon Beresini 0510bbe958 Removed space after # so that Cygwin's version of expect recognizes comments. 2008-05-09 21:54:47 +02:00
Ali Shemiran 12cd554af1 Fix secret channel information leak
/who on a secret channel that the user is not a member of
now returns proper RPL_ENDOFWHO_MSG instead of nothing.
2008-05-09 21:47:31 +02:00
ashemira@ucsd.edu 5cf5ba31eb Added Cygwin uid kludge. (verified working) 2008-05-08 13:04:25 +02:00
Eric Grunow 75b719a0c8 Anglified and improved comments in channel.c and channel.h
[Dana Dahlstrom: repair tab/space conversion in patch]
2008-05-08 03:15:04 +02:00
Alexander Barton 4e56e5341f Implement IRC commands SERVICE, SERVLIST, and SQUERY as dummy functions
SERVICE, SERVLIST, and SQUERY are required by RFC 2812 (it states in
section 3 that "all commands described in this section MUST be implemented
by any server for this protocol." -- So we implement them without (much)
actual functionality ...
2008-05-05 18:06:43 +02:00
Florian Westphal 3895b42d1b Add invite-test.e to test suite. 2008-05-05 16:12:41 +02:00
Dana Dahlstrom 6c81ffaece Tests for the INVITE command. 2008-05-05 16:12:41 +02:00
Dana Dahlstrom 97cc58fb13 Invite: prefix last argument with colon when necessary. 2008-05-05 16:12:41 +02:00
Dana Dahlstrom c63d8fd051 tests for JOIN and various replies
Brandon Beresini sent me a patch yesterday adding tests for JOIN under
various circumstances, which I believe he worked on with Bryan Caldwell
and Ali Shemiran. I made a few modifications; the result is below.
2008-05-05 16:12:41 +02:00
Bryan Caldwell 3d8eda9c86 Allow KICK to handle comma-delimited lists (of channels, nicks).
includes test cases.

[fw@strlen.de:
	- move code around to avoid duplication
	- use const where possible
	- integrate test case]
2008-05-05 16:12:41 +02:00
Florian Westphal 3283d275ba Invite: Send RPL_AWAY to client sending the invite if target is away. 2008-05-05 15:52:41 +02:00
Dana Dahlstrom faf9b6ea16 Fixes to who-test: accept any ident, escape some '*' flags.
This prevents who-test.e from failing when ngircd
is performing ident lookups and an ident server is running.
2008-05-05 15:40:00 +02:00
Florian Westphal 452fb28394 IRC_INVITE: coding style cleanup. 2008-05-05 15:39:54 +02:00
Florian Westphal 0428a1c4ea Constify some of Channel_Kick()s arguments. 2008-05-05 15:38:47 +02:00
Florian Westphal 98a8ea105c constify Client_Search() argument. 2008-05-05 15:38:43 +02:00
Rolf Eike Beer 83bfdddf99 Allow IRC ops to ignore channel limits when joining
Allow IRC ops to ignore any channel limit (bans, invite only etc.) when they
want to join a channel.
2008-05-05 14:45:28 +02:00
Alexander Barton 2a790861a1 Handle 1-character messages terminated with CR or LF correctly
Code cleanup and fix for Bug #83, "ngIRCd chokes on 1-character messages" in
function Handle_Buffer(): the buffer is now correctly cleared when ngIRCd
receives 1-character messages terminated with either CR or LF (in violation
to RFC 2812, section 2.3 "Messages", 5th paragraph).
2008-05-02 02:14:15 +02:00
Alexander Barton 4e507881f3 On AIX (for example) socklen_t is defined in sys/socket.h
On AIX and probably other systems socklen_t is defined in sys/socket.h,
so we have to include it here explicitly (tested by Florian).
2008-05-01 20:25:39 +02:00
Florian Westphal f7c2e8223f Always enable modeless channels.
Modeless channels (+channels) are described in RFC 2811;
so my modifications to
530112b114
('Add support for modeless channels')
to disable +channels for --strict-rfc configurations
were wrong. This reverts those changes.
2008-05-01 18:08:07 +02:00
Alexander Barton 60acc62af7 Prevent GIT to complain about opless-channel-test link 2008-05-01 16:31:13 +02:00
Ali Shemiran 530112b114 Add support for modeless channels
Add support for modeless channels (+channels).

[fw@strlen.de:
 - integrate test cases
 - don't support +channels when compiled with --strict-rfc
 - do not set +o mode for channel creator
 - force +nt mode when channel is created ]
2008-05-01 15:55:12 +02:00
Alexander Barton 6cfc56064e Updated NEWS and ChangeLog for ngIRCd 0.12.0-pre2. 2008-04-29 15:34:15 +02:00
Alexander Barton 4a81367dac --configtest: fix missing whitespace at "ConnectIPv4" option. 2008-04-29 15:27:44 +02:00