13596 Commits

Author SHA1 Message Date
Peter Powell
10b17a0e9f Remove the OnInfo event.
This is not used by anything and On{Post,Pre}Command hooks can
be used if people really want to add stuff to INFO.
2018-08-14 00:18:13 +01:00
Peter Powell
23e29119f8 Replace all references to IRCv3.2 with IRCv3.
IRCv3 no longer does versioned releases.
2018-08-13 22:06:39 +01:00
Peter Powell
584d456903 Add support for the IRCv3 batch specification.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
2018-08-13 22:01:42 +01:00
Peter Powell
2249524355 Add support for the IRCv3 server-time specification.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
2018-08-13 22:01:21 +01:00
Peter Powell
c60f88bb5c Add support for the IRCv3 account-tag specification.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
2018-08-13 21:51:12 +01:00
Peter Powell
58a0a7e014 Implement IRCv3 message tag support.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
2018-08-13 21:51:11 +01:00
Peter Powell
e2a820cce2 Add an accessor for the last mode change list to ModeParser.
GetLastParse will be going away soon.
2018-08-13 16:52:37 +01:00
Peter Powell
ba23c2b115 Convert AWAY to use cross-module events and clean up slightly.
OnSetAway has been replaced with four events. OnUserPreAway and
OnUserPreBack can be used to deny an away state change and/or
change the away message of a local user. OnUserAway and OnUserBack
allow modules to be notified that a user's away state has changed.
2018-08-12 15:01:45 +01:00
Peter Powell
f8a9b6ba4a Pass the Extensible container to ExtensionItem::free(). 2018-08-12 13:29:09 +01:00
Peter Powell
02838a0939 Move message parsing to ProcessBuffer and fix edge cases in it. 2018-08-10 20:04:56 +01:00
Peter Powell
8b418f081f Split irc::tokenparser::GetToken into GetMiddle and GetTrailing.
This simplifies the logic of irc::tokenparser considerably and
removes all of the magic index guessing that was used previously.
2018-08-10 13:55:32 +01:00
Peter Powell
aa6912f1c9 Remove the integer overloads of irc::tokenparser::GetToken().
The int overload was never used and the long overload was used in
one place.
2018-08-10 13:55:32 +01:00
Peter Powell
36899e44ee Parse CAPAB CAPABILITIES and FJOIN messages with spacesepstream.
Special tokenisation rules are not necessary here.
2018-08-10 13:55:32 +01:00
Peter Powell
213e4d9680 Remove the original line parameter of On{Pre,Post}Command.
In the brave new world of message tags and alternate wire formats
this is no longer something that is appropriate to expose.

In reality it was only ever used by m_alias which now reconstitutes
the command name and parameters into a RFC 1459-style message for
whatever it needs to do.
2018-08-10 13:55:32 +01:00
Peter Powell
0218d32903 Fix sending malformed ERR_UNKNOWNCOMMAND messages in some cases.
This is not something the average user will encounter. It can only
happen if the user sends a message with preceding whitespace or a
prefix but no command name.

This is not something that should ever be seen in practise so we
just penalise the user and pretend nothing ever happened.

The previous code also contained undefined behaviour but it acted
sensibly on all compilers we support so it was not crashable.
2018-08-10 10:30:33 +01:00
Peter Powell
626003a7dc Switch m_xline_db to use the xline snomask character. 2018-08-10 06:40:26 +01:00
Peter Powell
090f381758 m_httpd: close the HTTP connection after serving a request.
We always send "Connection: Close" so this is the right behaviour
according to section 8.1 of RFC 2616.

Closes #1507.
2018-08-07 18:38:12 +01:00
Peter Powell
83a2eddaaa Switch m_dnsbl to use its own snomask character. 2018-08-07 16:50:01 +01:00
Peter Powell
c51d80d9d4 Remove the 'debug' snotice character. 2018-08-07 16:45:03 +01:00
Peter Powell
54a15b0185 Make the FJOIN timestamp message easier for users to understand. 2018-08-05 17:18:43 +01:00
Peter Powell
d9a52277df Remove support for static modules.
This has been frequently broken in the past and as far as I know is
used by literally nobody.

Also, even if all modules are compiled into the core any libraries
linked against are and have always been linked dynamically making
this unusable on platforms without dynamic libraries.
2018-07-31 03:20:18 +01:00
Peter Powell
abbf70b2a3 Rename User::fullname to realname and make it private. 2018-07-30 18:50:34 +01:00
Peter Powell
7bde9de9b3 Replace most usages of "name" with "real" or "real name". 2018-07-30 18:34:57 +01:00
Peter Powell
8cb20e3545 Replace most usages of "GECOS" with "real" or "real name". 2018-07-30 18:30:11 +01:00
Peter Powell
9cf448a332 Replace irc::stringjoiner with a generic stdalgo::string::join.
This can also be used with different types of collection containing
values which are not a string.
2018-07-26 21:41:36 +01:00
Peter Powell
384ef31bc0 Use CommandBase::Params instead of std::vector<std::string>.
This is presently a typedef but will soon be replaced with a class
that encapsulates both tags and parameters.
2018-07-26 20:12:14 +01:00
Peter Powell
09c5439c02 Add a module which implements the HAProxy PROXY v2 protocol. 2018-07-26 12:35:22 +01:00
Peter Powell
97a1d6429a Make more config stuff case insensitive. 2018-07-24 21:55:10 +01:00
Peter Powell
7a24867d97 Fix building on Windows. 2018-07-24 11:05:51 +01:00
Peter Powell
ef48486b09 Rename IntModuleList to Module::List. 2018-07-24 10:02:27 +01:00
Peter Powell
2beb73aba7 Get rid of the unused string_list typedef. 2018-07-24 10:02:07 +01:00
Peter Powell
4df41508c1 Fix the Windows build system to use the new license file location. 2018-07-23 15:13:11 +01:00
Peter Powell
6522f7e3e7 Remove Log() calls made unnecessary by the previous commit. 2018-07-20 12:34:24 +01:00
Peter Powell
8faa6ac773 Log snotices with their description rather than just as "snomask". 2018-07-20 12:34:24 +01:00
Peter Powell
0438ae0aa4 Define HAS_ARC4RANDOM_BUF in config.h if available. 2018-07-20 12:30:40 +01:00
Peter Powell
ec6bdd1ae9 Use arc4random_buf() instead of random() when available. 2018-07-20 11:48:22 +01:00
Peter Powell
b7716ed577 Initial support for listening on UNIX socket endpoints. 2018-07-18 19:22:17 +01:00
Peter Powell
87e328a1fb Add the family() member to the sockaddrs union. 2018-07-18 19:21:45 +01:00
Peter Powell
8f5952d1e5 Release v3.0.0 alpha 8. v3.0.0a8 2018-07-15 16:42:48 +01:00
Peter Powell
124c17e141 Merge branch 'insp20' into master. 2018-07-15 16:42:36 +01:00
Peter Powell
d0dac3a275 Use mysql_real_escape_string instead of mysql_escape string.
This is not exploitable as far as I know but it is probably best
that we use the newer function just in case.

Closes #649 (although the attack mentioned in that issue was not
feasible).
2018-07-15 14:15:35 +01:00
Peter Powell
227484c6c0 Implement support for the WHOX extension.
This is a massive rewrite of core_who which was initially developed
by Adam in 2014. I have rebased and cleaned it up and tightened up
compliance with the specifications.

Co-authored-by: Adam <Adam@anope.org>
2018-07-12 14:37:56 +01:00
Peter Powell
a37c11101a Clean up the WHO helpop documentation. 2018-07-12 01:31:24 +01:00
Peter Powell
11e67c494a Fix replying with the source user in oper-restricted WHO lookups. 2018-07-11 12:10:18 +01:00
Peter Powell
49b9c6bcb9 Switch core_dns validation to use InspIRCd::IsHost. 2018-07-10 21:14:56 +01:00
Peter Powell
32eb5386ba Switch <server:name> validation to use InspIRCd::IsHost. 2018-07-10 21:14:56 +01:00
Peter Powell
87361360e6 Add InspIRCd::IsHost for checking the validity of hostnames. 2018-07-10 21:14:56 +01:00
Peter Powell
e22383c6f4 Add a ConfigTag::getString overload that calls a validation method. 2018-07-10 21:14:56 +01:00
Peter Powell
39b51a7c11 Allow exempting of registered users from securelist. 2018-07-10 21:07:38 +01:00
Peter Powell
2a022cb9b7 Add a silent option to <options:restrictbannedusers>.
This is useful when dealing with spambots that switch method when
they receive ERR_CANNOTSENDTOCHAN.
2018-07-10 21:01:35 +01:00