summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)Author
2016-01-07Send_Message: Fix handling of "empty" targetsAlexander Barton
Clients can specify multiple targets for the "PRIVMSG", "NOTICE", and "SQUERY" commands, separated by commas (e. g. "PRIVMSG a,#b,c :text"). Since commit 49ab79d0 ("Limit the number of message targes, and suppress duplicates"), ngIRCd crashed when the client sent the separator character only as target(s), e. g. "," or ",,,," etc.! This patch fixes the bug and adds a test case for this issue. Thanks to Florian Westphal <fw@strlen.de> for spotting the issue!
2016-01-04Update copyright notices for 2016Alexander Barton
2016-01-04Limit the number of message targes, and suppress duplicatesAlexander Barton
This prevents an user from flooding the server using commands like this: PRIVMSG nick1,nick1,nick1,... Duplicate targets are suppressed silently (channels and clients). In addition, the maximum number of targets per PRIVMSG/NOTICE/... command are limited to MAX_HNDL_TARGETS (25). If there are more, the daemon sends the new 407 (ERR_TOOMANYTARGETS_MSG) numeric, containing the first target that hasn't been handled any more. Closes #187.
2016-01-04Add "_MSG" postfix to ERR_WILDTOPLEVEL_MSGAlexander Barton
2016-01-04Enahnce comments for Send_Message() and Send_Message_Mask()Alexander Barton
No functional changes.
2016-01-04Get rid of unclever assert() in Send_Message_Mask()Alexander Barton
Either we use assert() to _guarantee_ a certain condition, or we use if(...) to test for it. But never both. So get rid of the assert() in Send_Message_Mask() and handle the case that the target mask doesn't contain a dot (".") as regular error, don't require the caller to assure that any more. This polishes commit 5a312824. Please note: The test in Send_Message() is still _required_ to detect whether the target is a channel (no dot) or a "target mask" (at least one dot)!
2015-12-30Test suite: Add new test for server-server loginsAlexander Barton
This test detects the recent NJOIN breakage, for example ...
2015-12-30Fix NJOIN handler killing all clientsAlexander Barton
This bug has been introduced by commit 1e386fb7ac which had the logic reversed :-( Reported by "ninguno" in #ngircd, thanks a lot!
2015-12-13Make NJOIN handler more fault-tolerantAlexander Barton
Don't crash the daemon when the NJOIN handler can't join the new client to a channel (when the Channel_Join() function failed) but try to KILL this client -- which is the only possible reaction besides crashing: otherwise the network would get out of sync.
2015-12-13IRC_KillClient(): Don't break when called without "Client"Alexander Barton
The IRC_KillClient() function is documented to handle the case that the "Client" structure is NULL, so make sure that this actually works and can't crash the daemon. Please note: The current code doesn't make use of this feature, so this fix is definitely the "right" thing to do but doesn't fix an actual problem.
2015-12-13IRC_NJOIN(): Code cleanupAlexander Barton
No functional changes.
2015-12-13Fix NJOIN not propagating "half ops" statusAlexander Barton
ngIRCd tested for the wrong prefix of "half ops" when processing NJOIN commands and therefore never classified a remote user as "half op". Thanks to wowaname for pointing this out on #ngircd!
2015-11-15Explicitly cast time_t to long when printing it outAlexander Barton
This prevents wrong sizes data types on platforms where time_t doesn't equal a long any more, for example on OpenBSD.
2015-09-03Make server-to-server protocol more robustAlexander Barton
Now ngIRCd catches more errors on the server-to-server (S2S) protocol that could crash the daemon before. This hasn't been a real problem because the IRC S2S protocol is "trusted" by design, but the behavior is much better now. Thanks to wowaname on #ngircd for pointing this out!
2015-08-26Reproducible buildsChristoph Biedl
At the moment ngircd fails the tests for reproducible builds in Debian since it uses the __DATE__ and __TIME__ macros for the INFO command. Instead of patching this out I decided to implement an optional constant BIRTHTIME that allows you to set a time stamp for the "Birth Date" information, in seconds since the epoch, like in export CFLAGS += -DBIRTHTIME=$(shell date +%s --date="2015/08/15 23:42:22") In the future, Debian will provide a SOURCE_DATE_EPOCH environment variable, dealing with the situation until then will be my job. The time format was taken from the NGIRCd_StartStr formatting in ngircd.c so the "Birth Date" and "On-line since" lines in the INFO output look similar: :irc.example.net 371 nick :ngIRCd 22.1-IDENT+IPv6+IRCPLUS+PAM+SSL+SYSLOG+ZLIB-x86_64/pc/linux-gnu :irc.example.net 371 nick :Birth Date: Tue Aug 25 2015 at 18:11:11 (CEST) :irc.example.net 371 nick :On-line since Tue Aug 25 2015 at 18:11:33 (CEST) :irc.example.net 374 nick :End of INFO list The format of the time stamped is changed, but as far as I can tell, there's no rule that is violated by that. Bonus level: Reformat the messages so the time stamps are aligned.
2015-08-01Whitespace fixes (no functional changes)Alexander Barton
2015-08-01Fix debug message "Client ... is closing connection"Alexander Barton
It should be "host:port"!
2015-08-01"NoticeAuth" configuration variable is deprecated now!Alexander Barton
2015-08-01Merge pull request #217 from SaberUK/master+notice-authAlexander Barton
Use "NOTICE *" before registration instead of "NOTICE AUTH".
2015-08-01First check if channel has mode "N", then check membershipAlexander Barton
This should be more efficient.
2015-08-01Merge pull request #214 from Flupsy/channel-mode-NAlexander Barton
Channel mode N (users on this channel can't change their nick)
2015-07-19Streamline ".gitignore" filesAlexander Barton
2015-07-14Rename NoticeAuth to NoticeBeforeRegistration.Peter Powell
The old name is still supported for compatibility reasons.
2015-07-14Use "NOTICE *" before registration instead of "NOTICE AUTH".Peter Powell
AUTH is a valid nickname so sending notices to it is probably not a good idea. Use * as the target instead as done with numerics when the nick is not available. This mimics the behaviour in Charybdis, IRCD-Hybrid, InspIRCd 2.2, Plexus 4, etc.
2015-06-26Only enforce channel mode N on users (not servers or services)Ian Chard
2015-06-26Specify session context for OpenSSL clientsTom Ryder
Reconnecting to ngIRCd 22.1 built with OpenSSL with some OpenSSL clients, including Pidgin and stunnel 5.06, attempts to reuse a session and fails due to the absence of this line. The error message in syslog from ngIRCd is: > SSL protocol error: SSL_accept (error:140D9115:SSL > routines:SSL_GET_PREV_SESSION:session id context uninitialized) This patch appears to fix the problem for both Pidgin and stunnel; it may work for other OpenSSL clients that attempt to re-use sessions. * <https://github.com/ngircd/ngircd/issues/182> * <https://developer.pidgin.im/ticket/11568> * <https://www.openssl.org/docs/ssl/SSL_CTX_set_session_id_context.html>
2015-06-24Don't bother looking for +N channels for an opIan Chard
2015-06-24Don't use a standard message numberIan Chard
2015-06-24Add channel mode N (normal user can't change nick while on channel)Ian Chard
2015-06-07Merge remote-tracking branch 'LucentW/master'Alexander Barton
* LucentW/master: Fix with oneshot invites Fixed building issues\ Implement timestamp tracking of invites Keep track of who placed bans/invites/excepts IRC operators w/OperCanMode can kick anyone [already cherry-picked] Closes #203, Closes #205.
2015-06-06Make setgroups(3) function optionalAlexander Barton
For example, Interix is missing this function, which prevented ngIRCd to build on this platform. When setgroups(3) isn't available, a warning message is issued when ngIRCd starts up.
2015-05-16IRC operators w/OperCanMode can kick anyoneLucentW
Closes #202. (cherry picked from commit 10c7ba99e73b42ec8c4c191ccdae60bdd35bba7d)
2015-05-16Implement numeric RPL_LISTSTART(321)LucentW
lightIRC and other clients expecting RPL_LISTSTART should now behave correctly. Closes #207. (cherry picked from commit 0680ce5fd99bc643651d1433bcdaf271aeb73c46)
2015-05-15Fix with oneshot invitesLucentW
This should finally implement correctly oneshot invites sent via /INVITE
2015-05-13Fix MatchCaseInsensitive[List]](): lowercase string _and_ patternAlexander Barton
Up to now, only the the string ("haystack") became lowercased and was the compared to the pattern ("needle") -- which failed, when the pattern itself wasn't all lowercase ...
2015-05-13Streamline effect of "MorePrivacy" option (WHOIS, LIST)Alexander Barton
- Update documentation in ngircd.conf(5) - LIST: Don't hide channels for IRC Ops when "MorePrivacy" is in effect - WHOIS: Don't hide IP addresses/hostnames when "MorePrivacy" is in effect Closes #198
2015-05-13Fixed building issues\LucentW
Now builds cleanly. Pass all tests from make check.
2015-05-11Implement timestamp tracking of invitesLucentW
Now lists nodes also have the "onlyonce" field, since the valid_until is used to keep the timestamp of placing. Found no references to onlyonce or about valid_until being == 1, though, so it might be unused, but still available for other enhancements.
2015-05-11Keep track of who placed bans/invites/exceptsLucentW
Implements #203. WARNING: it does not track the time of placement of invites, since the time_t is already used as a flag for single use invites!
2015-05-11IRC operators w/OperCanMode can kick anyoneLucentW
2015-04-29Fixed indents 2LucentW
2015-04-29Fixed indents and documentationLucentW
(also updated the copyright date on the txt I edited)
2015-04-29Implement +I (private channel list on whois)LucentW
Implements enhancement requested in issue #179
2015-04-12Make sure that the target user is able to join a local channelAlexander Barton
Implement ERR_USERNOTONSERV(504) numeric and make sure that the target user is on the same server when inviting other users to local ("&") channels. ircd-ratbox uses the ERR_USERNOTONSERV(504) numeric for this, and I think this is a good idea -- other IRC daemons (like ircu) silently drop such impossible invites, but thats not a big benefit ... Idea by Cahata, thanks! Closes #183.
2015-04-12INVITE command: Enforce 1 second penalty timeAlexander Barton
This prevents flooding of the target client. This closes #186. Reported by Cahata, thanks!
2015-04-12MODE command: Always report channel creation timeAlexander Barton
Up to now when receiving a MODE command, ngIRCd only reported the channel creation time to clients that were members of the channel. This patch reports the channel creation time to all clients, regardless if they are joined to that channel or not. At least ircd-seven behaves like this. This closes #188. Thanks Cahata!
2015-03-27Fix spelling of RPL_WHOISBOT message textAlexander Barton
2015-03-14Don't send nick name as default PART reasonAlexander Barton
No other IRC daemon seems to do this (today?), don't remember why ngIRCd did it in the first place ... Closes #185. Reported by Cahata in #ngircd, thanks!
2015-03-14Fix "WHO #<chan>" showing invisible users and hiding all visibleAlexander Barton
The logic is reversed ... This bug has been introduced by commit c74115f2, "Simplify mode checking on channels and users within a channel", ngIRCd releases 21, 21.1, and 22 are affected :-( Problem reported by Cahata in #ngircd, Thanks!
2015-03-11Fix typo in src/testsuite/READMEAlexander Barton