Commit Briefs
ngIRCd 0.12.1 (tags/rel-0-12-1)
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! (manually cherry picked from commit a84f7dcee5a1b32c74188aa5374d30eddd24852b)
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. (cherry picked from commit 8644cbf197807909e4caea184278872cdeca1963)
--configtest: return non-zero exit code if there are errors
(cherry picked from commit 6f7b669becb0ebf2058fa2bbe834de48c01de933)
Update ngIRCd manual pages
- Update timestamp, - enhance some phrasing, - and fix "Passive" ([Server]) formatting. (cherry picked from commit aad49bd260494878aed6795c7a897ad1d28c3082)
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>. (cherry picked from commit 818a206a4261f3d4153b0ab5c2025d77002290f5)
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.
ngIRCd 0.12.0 (tags/rel-0-12-0)
Fix complie on FreeBSD 5.4 and AIX.
This is picked from commits d9c26f3aeb35e979b72f7b0ac4220dbd07d7bc15 "ng_ipaddr.h must include netinet/in.h." and 4e507881f30c8b4296d87de519658e45f8cb417f "On AIX (for example) socklen_t is defined in sys/socket.h"
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. [picked from 12cd554af1709c44f35024d7d2fc368fb22f133d; without testcase]
ngIRCd 0.12.0-pre2 (tags/rel-0-12-0-pre2)
Testsuite: remove erroneous ConfUID setting in config file.
The config file for ngircds test suite contained obsolete ConfUID/ConfGID settings, causing ngircd to needlesly complain when started as non-root (which is hopefully the _normal_ case...)
Merge branch 'master' into branch-0-12-x
Fixed bug 81: When trying to part a channel ("PART #channel") the client is not member of the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted of ERR_NOSUCHCHANNEL (403).
Get rid of cvs-version.* and CVSDATE definition.
(cherry picked from commit b187fac244f4e14705f882ba7c43eef0238e2830)
Documentation: get rid of some more references to CVS, switch to GIT.
(cherry picked from commit 6e9389b86c906c53a7797b8ced87a19195e16333)
Report ERR_NOTONCHANNEL when trying to part a channel one is not member of.
When trying to part a channel ("PART #channel") the client is not member of the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted of ERR_NOSUCHCHANNEL (403).
IPv6: Add config options to disabe ipv4/ipv6 support.
This also enables ipv6-only setups.
Don't include doc/CVS.txt in distribution archive, use doc/GIT.txt now! (tags/rel-0-12-0-pre1)
Don't include doc/CVS.txt in distribution archive, use doc/GIT.txt now!
(cherry picked from commit a8e0eb62e9dce81ca4a5c5911428561b90bf2c6e)
Synchronized branch-0-12-x (ngIRCd 0.12.0-pre1) with master.
(cherry picked from commit 4ea29329674ff8ec6d772991a57c146b5d78d2ad)
Added make target "testsuite"
This make target runs the testsuite located in src/testsuite without running alle the other tests that "make check" would run.
Channel_Mode: Remove duplicate code.
Incidentially, this doesn't even change the generated code...
Channel_Mode: Re-indent switch.
No functional changes were made.
GIT should ignore user preferences files inside Xcode projects.
Added filter for GIT to ignore Xcode user preferences files (*.mode1v3 and *.pbxuser) which are automatically generated inside the project bundle when opened in Xcode.
Convert CVS commands to their git equivalents.
Also mention that patches should be sent to the mailing list.
Include Mac OS X Xcode project in distribution archives. (Part 2)
I forgot to include the new Makefile.am in contrib/MacOSX/ngIRCd.xcodeproj/ ...
Include Mac OS X Xcode project in distribution archives.
Oops, it has not been included since ... ages??
Moved .cvsignore files to .gitignore
Since we are using GIT starting from now, I converted all the .cvsignore files to .gitignore files.
Fix client.c sparse warnings.
client.c:72:6: warning: symbol 'Max_Users' was not declared. Should it be static? client.c:72:21: warning: symbol 'My_Max_Users' was not declared. Should it be static?
io.c: kill select FD_SETSIZE sanity check in io_library_init.
We already have way too many.
io.c: try to cut down the number of ifdefs.
consolidate backend-specific helpers and add empty statinc inle stubs in the ifndef case to let the compiler remove the functions at compile time.
Do not exit unconditionally if config file cannot be opened
ngircd will exit if the config file cannot be opened. While thats okay if ngircd starts up for the first time, it isn't when we are re-reading the config file after a /REHASH or SIGHUP.
IPv6 support.
all references to struct sockaddr/in_addr have been removed from src/ngircd. libngipaddr (in src/ipaddr/) hides all the gory details. See src/ipaddr/ng_ipaddr.h for API description.
Fix sending of JOINs between servers.
This does hit only operators that join a channel with at least 2 servers active in the net the server the oper connects to sends "channel^Go" to the other servers the other server first searches for the channel and then strips the modes from the channel name he has to do the other way round: first strip and then check the channel name.
Channel_Mode cleanups
- better indentation - move answering request into seperate function.
Include flags in RPL_WHOREPLY messages.
RPL_WHOREPLY messages generated by IRC_WHO don't include flags (*,@,+) that should appear according to this description: http://www.mishscript.de/reference/rawhelp3.htm#raw352 Other IRC servers do include the flags. Modify who-test.e to expose missing flags, modify ngircd-test.conf to accommodate who-test.e, and fix irc-info.c to correct these problems.
Don't send trailing space in MODE messages
Under some circumstances ngIRCd currently issues a channel MODE message with a trailing space after the last parameter, which isn't permitted by the grammar in RFC 2812 section 2.3.1: http://tools.ietf.org/html/rfc2812#section-2.3.1 The following patch modifies mode-test.e to expose this, and modifies irc-mode.c to correct it.
IRC_JOIN cleanups.
- put sending of mode and forwarding of JOIN to other clients into seperate function. - put sending of topic/channel names into seperate function. - put access check into seperate function. - translate/remove remaining german comments. - stop if JOIN to a channel in a list (JOIN #a,#,b,#c...) fails (This doesn't change the behaviour: skip-to-next-channel-on-error did never work as intended)
Make IRC_WHO also search username/servername/hostname.
Dana Dahlstrom reported that IRC_WHO did not follow RFC 2812, Section 3.6.1. Specifically: - IRC_WHO did not send "G" flag instead if "H" if client was away - did not search username/servername/hostname etc. if argument was not a channel. Fix all of the above and tidy things up a bit. Also add IRC_WHO test script contributed by Dana.
Remove duplicate Channel_FirstChannelOf().
noticed there's a way to make the loop slightly more elegant. [fw@strlen.de: Extra () to silence gcc.]
Implement RFC 2812 handling of "0" argument to JOIN
The students in my software-engineering class are writing IRC clients in Java, and I'm running ngIRCd as a sandbox for them to play in. We noticed ngIRCd doesn't obey the "JOIN 0" command specified in RFC 2812: JOIN 0 ; Leave all currently joined channels. http://tools.ietf.org/html/rfc2812#section-3.2.1 I believe the following patch addresses this. Cheers! [fw@strlen.de: put it into a seperate function]
Don't use Client_Type after command has been processed.
This caused a read from already free'd memory, if the processed command (IRC_QUIT) calls Client_Destroy.
Fix wrong strncpy usage if CVSDATE defined
Hello_User() used strncpy with overlapping src/dest. Use memmove instead.
This adds support for sending NOTICEs to a channel.
[also see Bug #70 in ngircd bugzilla]. Based on a patch by Fabian Schlager <fabian.schlager@gmail.com>.
[Parser]: Fix minor sparse warnings
parse.c:56:9: warning: symbol 'My_Commands' was not declared. Should it be static? parse.c:107:9: warning: symbol 'My_Numerics' was not declared. Should it be static? Also move handling of numerics into a seperate helper function.
Remove entry about ngircd failing on Linux 2.4:
ngircd can now fall back to select. [from 0.11.x]
kqueue: check for EV_ERROR in .flags
if kevent() returns events, check for EV_ERROR in event flags, too.
include <arpa/inet.h> inside tool.h
In file included from hash.c:24: ../tool/tool.h:27: warning: `struct in_addr' declared inside parameter list
remove ip-string from Conf_Server struct
struct Conf_Server stored the ip address to connect to in dotted-decimal notation; but we only need this for connect() so long-time storage isn't necessary.
bind ListenAddress for outgoing connections
ngircd would always use INADDR_ANY for outgoing connections; which might not be desirable. Added new [Server] option "Bind" to set source ip.
Introduce option to configure the maximum nick name lenth in ngircd.conf
- New configuration option "MaxNickLength" to specify the allowed maximum length of user nick names. Note: must be unique in an IRC network! - Enhanced the IRC+ protocol to support an enhanced "server handshake" and enable server to recognice numeric 005 (ISUPPORT) and 376 (ENDOFMOTD). See doc/Protocol.txt for details.
Fixes the wrong logging output when nested servers are introduced
to the network as well as the wrong output of the LINKS command.
Update Mac OS X Xcode project file for Xcode 3.
Allow building of ngIRCd using Xcode 3 without running ./configure.
if ngircd doesn't run chrooted, it tries to chdir
to the users working directory (as returned by getpwuid()). Failing to chdir to that directory isn't an error; so log with LOG_INFO and prefix the message with "Notice".
configtest would still print "-1" for MaxConnections, MaxConnectionsIP and MaxJoins
if any of those values was set to 0.
accoring to comments in the code, MaxConnections, MaxConnectionsIP and MaxJoins
options allow setting values < 0 -- this isn't the case. Comments adjusted.
Updated preferred automake version to 1.9. Only set preferences if not
already defined by some environment variables.
SECURITY: Fixed a severe bug in handling JOIN commands, which could
cause the server to crash. Thanks to Sebastian Vesper, <net@veoson.net>.
- change return type of Conn_InitListeners to unsigned
- remove minor whitespace damage
New configure option "--without-select"; when usin epoll() IO API include
support for select() as well by default and fall back on runtime when needed.
predefined channels MUST start with '#', but this is not very intuitive,
since # is also used as a comment character in ngircd.conf. Thus we prefix the name with '#' if it is missing.
New configuration option "PredefChannelsOnly": if set, make
all JOINs to-non existants channel return ERR_BANNEDFROMCHAN_MSG, restricting users to those channels defined in the config file.
Allow PASS syntax defined in RFC 1459 for server links, too.
Removed client status CLIENT_GOTPASSSERVER.
only test for stack smashing protector if we are using gcc;
use -fstack-protector-all for the test to make sure the guard variable is added.
Flag the format parameter of LogDebug() as "unused" when not compiling with
debug code to avoid gcc warnings. Added some documentation comments.
Removed kqueue bug fix (never released), rephrased some internal changes,
and added "time shift" bug fix.
Moved now local prototype of Client_New() to C file, renamed it to
Init_New_Client() and cleaned up some code and comments.
Remove direct call of Conf_UnsetServer(): it's already indirectly called
by Conn_Close() a few lines above.
Enhanced the handler for PING and PONG commands: fix forwarding and enable
back-passing of a client supplied additional argument of PING.
Changed handling of timeouts for unregistered connections: don't reset
the counter if data is received and disconnect clients earlier.
The KILL command killed much more than desired (including server links!)
when the target user is connected to a remote server. [from 0.9.x]
Removed "U" unsignet suffix: caused problems with older compilers and is
not necessary for this constants.
New subdirectory "src" for the source code documentation, and new make
target "srcdoc" to generate the documentation using Doxygen.
Only setuid()/setgid() if it differs from current UID/GID.
Solves problems with Cygwin.
Don't exit server if closing of a socket fails; instead ignore it and
pray that this will be "the right thing" ...
Reformatted and documented code of the first part of the IRC_NICK()
function; and register WHOWAS entries on nickname changes, too.
Away status texts set due to "a"-Modes received from other servers have
been fixed: the status text of the server has been set instead of the away status text of the client (most probably introduced by patch 1.36).
Added #include of "defines.h", necessary due to removal of the #include of
"defines.h" in the client.h header file.
Reorder #includes, necessary due to removal of #include "defines.h" in
the client.h header file.
Removed "invalid" #include of "defines.h" (don't include further header
files from a header file!).
removed Conn_UnsetOption() function. It was not used anymore.
removed Conn_SetOption(). replaced its only call (in conn-zip.c) with Conn_OPTION_ADD() macro.
conn.h: option filed in CONNECTION struct is now UINT16.
conn-func.h: add accessor Macros Conn_OPTION_ADD( conn, CONN_OPTION ) Conn_OPTION_DEL( conn, CONN_OPTION ) Conn_OPTION_ISSET( conn, CONN_OPTION ) To add, remove or test for a certain option field attribute (e.g. CONN_ISCLOSING) These Macros should be used instead of accessing conn->options directly.
Target "lint": check whether splint command is available and suppress
warnings related to the used command line in the output.
Two new targets: "srcdoc" to generate Doxygen source documentation, and
"xcode" to build ngIRCd using the Xcode command line tools on Mac OS X.
New build style "deployment", cleaned up options for build style
"development" (enabled "ZeroLink") and fixed path of "ngircd.spec".
When validationg the configuration file wait for a keypress only if both
stdin and(!) stdout are valid tty's.
Enhanced configure script: now you can pass an (optional) search path
to all --with-XXX parameters, e. g. "--with-ident=/opt/ident".
Remove INT, LONG, BOOLEAN, STATIC, CONST, CHAR datatypes.
use stdbool.h / inttypes.h if available.
Updated to latest strl{cat|cpy} code of rsync:
- Make sure that strlcpy() returns the right value when the bufsize is 0. - Fixed a bug in strlcat() where it would not properly detect a no-change condition if called with an initial string longer than the specified size limit (due to an unsigned var's inability to go negative). Patch by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
Write "error file" (/tmp/ngircd-XXX.err) only if compiled with debug
code ("--enable-debug") and running as daemon process.
Don't create version information string each time a client connects but
insetead on server startup. By Florian Westphal.
Added an empty /etc/ngircd/ngircd.motd to the packages. And ngircd.conf
becomes modified to enable the PID file (/var/run/ircd/ngircd.cond) and to change the user and group to "irc".
New configuration variable "PidFile", section "[Global]": if defined,
the server writes its process ID (PID) to this file. Default: off. Idea by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
Fixed a bug that could case a root exploit when the daemon is compiled
to do IDENT lookups and is logging to syslog. Bug discovered by CoKi, <coki@nosystem.com.ar>, thanks a lot! (http://www.nosystem.com.ar/advisories/advisory-11.txt)
Fixed a buffer overflow that could cause the daemon to crash. Bug found
by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
Fixed a possible buffer underrun when reading the MOTD file. Thanks to
Florian Westphal, <westphal@foo.fh-furtwangen.de>.
Code cleanups from Florian Westphal, <westphal@foo.fh-furtwangen.de>:
wrote functions for common error messages.
Fixed detection of IRC lines which are too long to send. Detected by
Florian Westphal, <westphal@foo.fh-furtwangen.de>.
Fixed return values of our own implementation of strlcpy(). The code has
been taken from rsync and they fixed it, but we didn't until today :-/
Fixed a memory leak when resizing the connection pool and realloc() failed.
Now we don't fall back to malloc(), which should be sane anyway. Patch from Florian Westphal, <westphal@foo.fh-furtwangen.de>.
Make more clear that there can be more than one [Operator], [Server] and
[Channel] section in the configuration file.
Added support for the Howl (http://www.porchdogsoft.com/products/howl/)
Rendezvous API, in addition to the API of Apple (Mac OS X).
Made ngIRCd compile on HP/UX 10.20 with native HP pre-ANSI C compiler and
most probably other older C compilers on other systems.
Fixed echo without newline for systems not understanding "echo -n"; added
new file "functions.inc" for functions usable by all test scripts.
Fxied name of "default file" for ngircd-full package. And do the test if
the binary is executable after reading this file.
Changed text "test scripts" to "processes": some versions of expect(1)
fork child processes ...
Added missing commas to debian control file, fixes bug #56.
Thanks to Kevin Otte (nivex@nivex.net) for the patch.
Added PID to all log messages on the console; enhanced logging of
resolver sub-processes in debug mode.
New "chroot" feature (from Benjamin Pineau), introducing new configuration
variables "ChrootDir" and "MotdPhrase".
Document new server flag "L": synchronize INVITE- and
BAN-lists when establishing new server links.
Synchronize INVITE- and BAN-lists if the peer requests it:
server flag "L". And better debug logging.
Don't send MODE changes when origin is a server and
mask is already known.
Fixed a wrong assert() which could cause the daemon to exit spuriously
when closing down connections.
Fixed handling of already existent entries in invite and ban lists:
the attempt to add an already existent entry is no error, it must be propagated across servers (but not added to the list!).
Servers other than the destination server didn't clean up the invite
list of an "invite-only" channel properly when an INVITE'd user joined.
Reworked configure system: it should be more compatible to most systems
now, and it should even be more flexible and faster :-)
Fixed some warnings of non-gcc-compilers (e. g. original Apple compiler on
A/UX): "warning: illegal pointer combination, op =".
Changed the reply of the MODE command to match the syntax of the original
ircd exactly: the unnecessary but missing ":" before the last parameter has been added.
Better logging while establishing and shutting down connections.
Results of the resolver are now discarded after the client is registered.
The info text ("real name") of users is set to "-" if none has been
specified using the USER command (e. g. "USER user * * :"). Reason: the original ircd doesn't like empty ones and would KILL such users.
Fixed (optional) TCP Wrapper test which was broken and could result in
false results. Thanks to Fuminori Tanizaki <tany@mcnet.ad.jp>!
Restructured debian packaging system: now there are two packages, a "standard"
version that includes all the default options and a "full" version that additionally includes support for TCP wrappers and IDENT lookups.
Removed outdated Mac OS X ProjectBuilder project files (will be re-added
and updated for XCode soon); moved the debian/ directory to contrib/Debian/.
Added some files to the maintainer-clean-local target which havn't beed
removed by "make maintainer-clean".
Fixed error messages related to server name configuration; updated
sample configuration file. (from 0.7.x)
Fixed ban behavior: users which are banned from a channel can't no longer
send PRIVMSG's to this channel (fixes Bug #47).
Fixed and enhanced penalty handling; changed internal time resoluiton of
the server to one second. Code cleanup.
Updated documentation. (tags/rel-0-7-0-pre1)
Added implicit initialisation of "i" in Conf_GetServer to workaround a egcs
2.91.66 bug which claims that this valiable could be used uninitialized.
Added some defines for Linux/glibc, reverted unused test for poll(), and
enhanced summary output.
Changed documentation directory to ".../share/doc/ngIRCd" (and removed the
variable PACKAGE for better Debian automake-1.4 compatibility).
Added support for TCP Wrappers; redesigned configuration result output;
Changed some "--enable"/"--disable" switches to "--with"/"--without".
The server didn't validate wheather the "target" client of a channel
user mode change is a valid channel member or not.
- Check functions only on systems that support prototypes, elder cpmpilers
become confused instead!
- Fixed up command forwarding: only to servers!
- Forwarding of WHOIS was broken in some situations.
- Changed "once"-server-config-flag into a generic flag.
- Changed semantics of "NGIRCd_Passive".
- New functions Conf_EnableServer(), Conf_DisableServer() and Conf_AddServer().
- Changed "once"-server-config-flag into a generic flag.
- New commands CONNECT and DISCONNECT.
- Validate operator status before syntax checks.
- If the server can't close a socket, it panics now.
- Quite enhanced logging :-)
- fixed KILL: you can kill yourself now without crashing the server;
QUIT isn't send to other servers after the KILL any more.
- renamed variables to fit new signal handler.
- moved call to NGIRCd_Rehash() to Conn_Handler().
- validate Conf_MaxConnections against FD_SETSIZE if available;
- fixed up some log messages and enhanced configuration validation.
- new constant RPL_YOURESERVICE_MSG, ERR_CHANNELISFULL_MSG, ERR_BADCHANNELKEY_MSG.
- fixed ERR_PASSWDMISMATCH_MSG.
- new constant MAX_SERVICES,
- added k and l modes to CHANMODES.
- fixed some parsing bugs.
- better logging.
- new file header format (in english);
- new file ident semantics.
- translated file header and comments to english;
- new file ident semantics.
- neue Befehle: Conn_StartTime(), Conn_SendQ(), Conn_RecvQ(), Conn_SendMsg(),
Conn_RecvMsg(), Conn_SendBytes[Zip](), Conn_RecvBytes[Zip]().
- beim Umschalten auf Kompression wurden evtl. bereits gelesene Daten nicht
entpackt, der Datenstrom war somit dann korrumpiert.
- neue Funktionen: Conn_SetOption(), Conn_UnsetOption(), Conn_Options().
- wenn mit zlib-Support: Conn_InitZip().
- volle Lesebuffer und Timeouts behandelt Conn_Handle() nun besser.
- Handle_Buffer() liefert nun ein Ergebnis.
- select() in Try_Write() hat falschen (keinen!) Timeout verwendet;
- der Timeout fuer das select() in Conn_Handler() ist nun TIME_RES (=2).
- RELOAD in REHASH umbenannt.
- neue Funktion WHOWAS.
- neue Meldungen: RPL_STATSLINKINFO, RPL_STATSCOMMANDS, RPL_ENDOFSTATS,
RPL_WHOWASUSER, RPL_ENDOFWHOWAS und ERR_WASNOSUCHNICK.
- Listen-Sockets werden ueber neue Funktion Conn_InitListeners() erzeugt.
- neue Funktion NGIRCd_Reload(). - Logging bei empfangenen Signalen verbessert. - SIGHUP ruft nun NGIRCd_Reload() auf.
- Befehle sortiert,
- neuer Befehl RELOAD.
- angenommene Socketes werden nun korrekt auf "non-blocking" gestellt;
- beim Senden und Empfangen wird EAGAIN ("Blockierung") nun abgefangen.