about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)Author
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-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>.
2012-11-24Rework cloaked hostname handling, implement "METADATA cloakhost"Alexander Barton
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-24RPL_UMODEIS: send correct target name, even on server linksAlexander Barton
2012-11-24Client_HostnameCloaked() -> Client_HostnameDisplayed()Alexander Barton
2012-11-13Test suite: correctly execute tests when stdout is redirectedAlexander Barton
2012-11-12Add a few casts, fix compiler warnings on NetBSD 5Alexander Barton
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-11irc-info.c: Use strlcpy() instead of strcpy()Alexander Barton
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-11conf.c: Use strlcpy() instead of strcpy()Alexander Barton
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-11tool.h: Don't check for and #define PF_INETAlexander Barton
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-11conf-ssl.h: Use "gnutls_session_t" instead of "gnutls_session"Alexander Barton
This fixes the following warning with current versions of GnuTLS: conf-ssl.h:36: warning: "gnutls_session" is deprecated
2012-11-10Add new IRC+ server flag "X": "XOP modes supported"Alexander Barton
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-05Correctly add irc-metadata.{c|h} to Makefile.ng ...Alexander Barton
2012-11-05Generate "METADATA host" commands on "MODE +/-x"Alexander Barton
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-05Don't cloak already cloaked hostname when using METADATAAlexander Barton
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-05Implement METADATA command to update client metadataAlexander Barton
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-04PredefChannelsOnly: Fix message for non pre-defined channelsDNS777
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-04Test suite: add some "remote checks" to whois-test.eAlexander Barton
2012-11-04Send NICK commands with prefix of (target) userAlexander Barton
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-02Implement SVSNICK command to change remote nicknamesAlexander Barton
The SVSNICK command allows other servers (and services on "pseudo-servers") to forcefully change nicknames of remote users. Syntax: ":<from> SVSNICK <oldnick> <newnick>" The SVSNICK command itself doesn't change the nickname, but it becomes forwarded to the server to which the user is connected to. And then this server initiates the real nickname changing using regular NICK commands. This allows to still run networks with old servers not supporting the SVSNICK command, because SVSNICK commands for nicknames on such servers are silently ignored and don't cause a desync of the network.
2012-11-02IRC_NICK(): Code cleanup, new function Change_Nick()Alexander Barton
2012-11-02Spelling fix: "nick name" -> "nickname"Alexander Barton
2012-10-29Fix warning message introduced when cleaning up IRC_SERVER()Alexander Barton
This reverts a not intentional code change and fixes the following compiler warning message (tested with gcc 4.4.5): irc-server.c: In function "IRC_SERVER": irc-server.c:142: warning: suggest parentheses around operand of "!" or change "&" to "&&" or "!" to "~"
2012-10-29Make server reconnect time a little bit more randomAlexander Barton
Add randomly up to 15 seconds to the reconnect delay for outgoing server links when the connection has been "short" and therefore the "ConnectRetry" delay is being enforced. This should make it even more unlikely that two servers deadlock each other when both are trying to connect to the other one at the same time, for example in test environments.
2012-10-29Don't accept connections for servers already beeing linkedAlexander Barton
If two servers try to link each other, there was a time frame that could result in one connection overwriting the other, e. g. the incoming connection overwriting the status of the outgoing one. And this could lead to all kind of weirdness (even crashes!) later on. So now such incoming connections are dropped. But this most probably prevents the two servers from linking until timing changes somehow (network latency?) because each server drops the incoming connection of the other one, so no connection survives in the end. But this has to be addressed by an other patch ...
2012-10-29IRC_SERVER(): Code cleanupAlexander Barton
2012-10-29Use lowercase "package name" for syslog logging againAlexander Barton
This is how ngIRCd up to release 19.2 behaved; "bug" introduced by commit 67e882, "configure.in: require autoconf 2.67 and automake 1.11", which changed the "PACKAGE_NAME" to "ngIRCd"; so use "PACKAGE" which still is the lowercase version for initializing syslog logging.
2012-10-25Make the maximum /list reply length a configurable limit.Brett Smith