about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)Author
2013-02-24irc-op.c: use irc-macros.hAlexander Barton
2013-02-24irc-cap.c: use irc-macros.hAlexander Barton
2013-02-24irc-op.c: Update source code documentationAlexander Barton
2013-02-24irc-cap.c: Update source code documentationAlexander Barton
2013-02-24Add new _IRC_ARGC_EQ_OR_RETURN_ macro to irc-macros.hAlexander Barton
2013-02-24Add new _IRC_ARGC_BETWEEN_OR_RETURN_ macro to irc-macros.hAlexander Barton
2013-02-24irc-cap.c: move static functions to the top of the fileAlexander Barton
And remove now unnecessary (local) prototypes.
2013-02-22src/testsuite/README: add whois-test.eAlexander Barton
2013-02-22irc-login.c: conenction -> connectionAlexander Barton
Introduced by commit d3ef2239 as of Sun Jan 16 2011 ... Thanks to Patrik Schindler <poc@pocnet.net> for reporting this!
2013-02-15Merge branch 'bug153-ServerMask' into masterAlexander Barton
* bug153-ServerMask: Update irc-info.c to use irc-macros.h Add new irc-macros.h to project irc-info.c: add/streamline function documentation comments irc-info: move static functions at the top of the file Implement new function Client_SearchServer() Conflicts: src/ngircd/irc-info.c
2013-02-15KICK: Fix denial of service bugSebastian Köhler
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.
2013-02-13sighandlers.c: Update some log messagesAlexander Barton
2013-02-11my_sd_listen_fds(): really return an "int"Alexander Barton
This fixes the following warning using Apple LLVM version 4.2 (clang-425.0.24) on OS X: src/ngircd/conn.c:157:9: Implicit conversion loses integer precision: 'long' to 'int'
2013-02-11Merge branch 'bug155-allowAtInUser'Alexander Barton
* bug155-allowAtInUser: Allow "@" character in user names for authentication
2013-02-11Allow "@" character in user names for authenticationAlexander Barton
The "@" character isn't allowed in IRC usernames, because it is the separator between user name and hostname in IRC masks: <nickname>!<username>@<hostname> This patch accepts user names including "@" characters, saves the unmodified name for authentication but stores only the part in front of the "@" character as "IRC user name". And the latter is how ircd2.11, Bahamut, and irc-seven behave as well. Closes bug #155.
2013-02-10Merge branch 'systemd'Alexander Barton
* systemd: ngircd.sock: explicitely bind to IPv4 and IPv6 addresses Show address and port of sockets passed-in by systemd(8) Check type of sockets passed-in by systemd(8) Adjust severity levels of some log messages New configuration option "IdleTimeout": exit daemon when idle Implement support for systemd(8) "socket activation" contrib/README: add more files
2013-02-10Show address and port of sockets passed-in by systemd(8)Alexander Barton
2013-02-10Check type of sockets passed-in by systemd(8)Alexander Barton
This patch makes sure that ngIRCd doesn't try to handle sockets of unsupported types, for example of AF_INET6 sockets when ngIRCd isn't compiled with support for IPv6 ...
2013-02-10Adjust severity levels of some log messagesAlexander Barton
2013-02-09Update irc-info.c to use irc-macros.hAlexander Barton
This includes: - move IRC_SetPenalty() at the beginning of the handler functions, - use macros provided by irc-macros.h, - code cleanup. The main benefits of this patch are core size reduction, streamlined structure of the handler functions, and enhanced functionality: because of the _IRC_GET_TARGET_SERVER_OR_RETURN_() macro using the Client_SearchServer() function, the target of the specific IRC command can now be given server names, server mask, or the nickname of a user connected to the server. Closes bug #153.
2013-02-09Add new irc-macros.h to projectAlexander Barton
This file prvides some macros for common tasks required by functions implementing handlers for IRC commands: * _IRC_ARGC_LE_OR_RETURN_ * _IRC_ARGC_GE_OR_RETURN_ * _IRC_GET_SENDER_OR_RETURN_ * _IRC_GET_TARGET_SERVER_OR_RETURN_
2013-02-09irc-info.c: add/streamline function documentation commentsAlexander Barton
Add missing comments, streamline wording, and remove references to the RFCs: this will be added to ./doc/Commands.txt with an other patch and we want to avoid redundancy ...
2013-02-09irc-info: move static functions at the top of the fileAlexander Barton
2013-02-08"WHO <hostmask>": use displayed hostname for matchingAlexander Barton
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.
2013-02-05Implement new function Client_SearchServer()Alexander Barton
This function returns the server structure of a client or a given "mask"; it is useful for implemention handlers for commands like "COMMAND *.net", which should work on a server matching "*.net". Please note that the local server is always returned when it matches the mask, but besides that, the order is completely arbitrary.
2013-02-04New configuration option "IdleTimeout": exit daemon when idleAlexander Barton
This patch implements a new configuration option "IdleTimeout" in the [Limits] section of the configuration file which can be used to set a timeout (in seconds) after which the whole daemon will shutdown when no more connections are left active after handling at least one client. The default is 0, "never". This can be useful for testing or when ngIRCd is started using "socket activation" with systemd(8), for example.
2013-02-04Implement support for systemd(8) "socket activation"Alexander Barton
This patch enables ngIRCd to work with listening sockets already initialized and passed-in by systemd(8) and hereby to support on-demand "socket activation". systemd(8) uses two environment variables to pass information about the sockets to ngIRCd, LISTEN_PID and LISTEN_FDS, and this mechanism only kicks in when both variables are set. In all other cases, and therefore in most installations out there, nothing changes at all. Please note: If socket activation is in effect, ngIRCd will not initialize any (other) soeckets on its own! All sockets must be configured in the systemd(8) socket unit configuration file in this case, see ./contrib/ngircd.socket for example. Probably it would be interesting to match passed-in sockets to configured listening sockets and to initialize all the remaining ones not already set up by systemd(8), but this is kept back for an other patch ... See - <http://0pointer.de/blog/projects/socket-activation.html> - <http://0pointer.de/blog/projects/socket-activation2.html> - <http://www.freedesktop.org/software/systemd/man/systemd.socket.html>
2013-02-03Rename ports_initlisteners() to Init_Listeners()Alexander Barton
2013-02-03NewListener(): Code cleanupAlexander Barton
2013-02-03Enable WHOIS to display information about IRC ServicesAlexander Barton
This patch introduces the new numeric 310(RPL_WHOISSERVICE) and enables WHOIS to display information about IRC services. This numeric is used for this purpose by 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. Change suggested by Federico G. Schwindt <fgsch@lodoss.net>, Thanks.
2013-01-27Exit message: use singular & plural :-)Alexander Barton
2013-01-27IRC_WHO_Channel(): Use strlcpy() instead of strcpy()Alexander Barton
This fixes the following warning, at least on OpenBSD 4.8: irc-info.o(.text+0x2427): In function `IRC_WHO': src/ngircd/irc-info.c:896: warning: strcpy() is almost always misused, please use strlcpy()
2013-01-26Streamline punctuation of log messagesAlexander Barton
Make sure that all log messages end with a correct punctuation mark. The rules for formatting log messages are: 1. Add punctuation marks to all messages passed to the actual logging functions like Log() and LogDebug(). 2. Don't add any punctuation marks to messages that are stored in variables for later use or are passed over the network. 3. IP addresses, DNS host names and IRC server names should be quoted. 4. Messages originating in the network should be quoted (at least if they are "untrusted" or variable). Most probably this patch doesn't fix all mistakes, but it should be a good starting point ...
2013-01-22Return better "Connection not registered as server link" errorsAlexander Barton
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).
2013-01-13MODE: don't report error on "more modes than parameters"Alexander Barton
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>
2013-01-07Correctly detect when SSL subsystem must be initializedAlexander Barton
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>
2013-01-02Merge branch 'bug145-ProvideHelp'Alexander Barton
* bug145-ProvideHelp: Use "${docdir}/Commands.txt" as help text file Add a note that "help file" is updated on startup and REHASH only Add doc/Commands.txt which should document all commands Implement Help() function parsing and returning the help text Document "HelpFile" in sample-ngircd.conf and ngircd.conf.5 Implement new configuration option "HelpFile" IRC_HELP(): Code cleanup Refactor Read_Motd() into Read_TextFile()
2013-01-01Use "${docdir}/Commands.txt" as help text fileAlexander Barton
2013-01-01Update Copyright notices for 2013Alexander Barton
2013-01-01Implement Help() function parsing and returning the help textAlexander Barton
This function parses the already read in help text and sends the requested portions to the user. Parsing is done as following when a user user issues a "HELP <cmd>" command: 1. Search the file for a line "- <cmd>", 2. Output all subsequent lines that start with a TAB (ASCII 9) character to the client using NOTICE commands, treat lines containing a single "." after the TAB as empty lines. 3. Break at the first line not starting with a TAB character. This format allows to have information to each command stored in this file which will not be sent to an IRC user requesting help which enables us to have additional annotations stored here which further describe the origin, implementation details, or limits of the specific command. A special "Intro" block is returned to the user when the HELP command is used without a command name.
2012-12-31Allow ERROR command on server and service links onlyAlexander Barton
Ignore it and add a penalty time on all other link types.
2012-12-31Implement new configuration option "HelpFile"Alexander Barton
This new configuration option allows to specify a specially formatted text file which can be used by the HELP command to provide information about the commands and their syntaxes.
2012-12-31IRC_HELP(): Code cleanupAlexander Barton
2012-12-31Refactor Read_Motd() into Read_TextFile()Alexander Barton
Now this function allows to read arbitrary text files into arrays.
2012-12-31Get rid of Conn_ResetPenalty(), it is unusedAlexander Barton
2012-12-31Mode setting: only check channel user modes when on channelAlexander Barton
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-25Add some more casts in assert() statemensAlexander Barton
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-25Add Cygwin binaries (*.exe) to .gitignore filesAlexander Barton
2012-12-25Add a cast in ForwardLookup() to fix a gcc warning on CygwinAlexander Barton
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-10Allow user names up to 20 charactersAlexander Barton
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>.