about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)Author
2013-07-18Update irc.c to use irc-macros.hAlexander Barton
This includes code cleanups and better documentation for some functions, too.
2013-07-18Handle services in IRC_WHOIS_SendReply()Federico G. Schwindt
If the target is a service, advertise it as such and ignore operator mode.
2013-07-18Fix spellingFederico G. Schwindt
2013-05-30Merge pull request #3 from Cofyc/masterAlexander Barton
irc-info.c: some commands use LINE_LEN as command buffer len
2013-05-30LINE_LEN -> COMMAND_LENYecheng Fu
LINE_LEN is configuration file line length
2013-05-25IncludeDir: default to "$SYSCONFDIR/ngircd.conf.d"Alexander Barton
Now "IncludeDir" defaults to "$SYSCONFDIR/ngircd.conf.d" instead of no directory, but a missing directory is only reported as an error if it has explicitely configured in the main configuration file and simply ignored otherwise. Therefore it is now possible not to touch the default (sample) configuration file at all, and set all distribution and/or system specific configuration options in "*.conf" files stored in "$SYSCONFDIF/ngircd.conf.d/". Thanks to "Elmasloco" for the idea!
2013-05-24"IncludeDir" can't be overwritten by included filesAlexander Barton
2013-05-24Implement new configuration option "IncludeDir"Alexander Barton
The option "IncludeDir" in the [Options] section can be used to specify a directory which can contain further configuration files and configuration file snippets matching the pattern "*.conf" that should be read in after the main configuration file ("ngircd.conf" by default) has been parsed. Closes bug #157.
2013-05-24conf.c: New function Read_Config_File()Alexander Barton
This function reads in and parses a single configuration file. Adjust all other functions to display the correct name of the file being read in currently.
2013-04-21Rename "Mask" variables into "Pattern" in assert() statementsAlexander Barton
This completes commit 3ab00e3a11 which broke debug builds.
2013-04-20Ensure there is enough space for the maskFederico G. Schwindt
As pointed by Alex while strl{cat,cpy} take the full length we need to leave space to ensure a proper mask is always created so revert the removal of - N from my last change.
2013-04-20Better description for Lists_CheckReason()Federico G. Schwindt
2013-04-20Change Lists_MakeMask() to receive a buffer for the maskFederico G. Schwindt
Change callers accordingly so they don't rely on a global buffer and rename Mask to Pattern where it makes sense since some functions where indeed receiving a pattern and not a mask.
2013-04-20Fix use-after-free on Lists_CheckReason()Federico G. Schwindt
Change Lists_CheckReason() to receive a buffer where the reason will be stored and its length. Change callers accordingly. Change Class_GetMemberReason() (and its callers) in a similar way so it doesn't rely on a global buffer for the rejected reason.
2013-03-20Lists_CheckReason(): Check for Client_MaskCloaked()Sebastian Köhler
Look for possible cloaked Masks in Lists. Users with +x usermode can be banned with their cloaked hostname now.
2013-03-09Conn_Handler(): Don't test for penalty timesAlexander Barton
The Conn_Handler() main loop calls Handle_Buffer() which checks for the "penalty time" of each client itself, so don't do it twice.
2013-03-09Don't read SSL client data before DNS resolver is finishedAlexander Barton
Fix the cb_clientserver_ssl() callback function to not read in and store SSL encrypted client data before the asynchronous DNS resolver sub-process has finished: This could have resulted in discarding the resolved client hostname and IDENT reply afterwards, because in some situations (timing dependent) the NICK and USER commands could have already been read in from the client, stored in the buffer, and been processed. Thanks to Julian Brost for reporting the issue and testing, and to Federico G. Schwindt <fgsch@lodoss.net> for helping to debug it!
2013-03-08Increase password length limit to 64 charactersAlexander Barton
Closes bug #154.
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()