Merge tag 'v2.0.25' into master.

This commit is contained in:
Peter Powell 2017-11-12 17:33:21 +00:00
commit d23c030c9a
17 changed files with 61 additions and 53 deletions

View File

@ -810,11 +810,6 @@
# Logging is covered with the <log> tag, which you may use to change
# the behaviour of the logging of the IRCd.
#
# In InspIRCd as of 1.2, logging is pluggable and very extensible.
# Different files can log the same thing, different 'types' of log can
# go to different places, and modules can even extend the log tag
# to do what they want.
#
# An example log tag would be:
# <log method="file" type="OPER" level="default" target="opers.log">
# which would log all information on /oper (failed and successful) to
@ -1007,6 +1002,6 @@
#########################################################################
# #
# - InspIRCd Development Team - #
# http://www.inspircd.org #
# https://www.inspircd.org #
# #
#########################################################################

View File

@ -49,7 +49,7 @@
# fingerprint: If defined, this option will force servers to be
# authenticated using SSL certificate fingerprints. See
# http://wiki.inspircd.org/SSL for more information. This will
# https://wiki.inspircd.org/SSL for more information. This will
# require an SSL link for both inbound and outbound connections.
#fingerprint=""

View File

@ -10,7 +10,7 @@
# #
# By default, ALL modules are commented out. You must uncomment them #
# or add lines to your config to load modules. Please refer to #
# http://wiki.inspircd.org/Modules for a list of modules and #
# https://wiki.inspircd.org/3.0/Modules for a list of modules and #
# each modules link for any additional conf tags they require. #
# #
# ____ _ _____ _ _ ____ _ _ _ #
@ -309,7 +309,7 @@
# #
# Optional - If you specify to use the censor module, then you must #
# specify some censor tags. See also: #
# http://wiki.inspircd.org/Modules/censor #
# https://wiki.inspircd.org/Modules/3.0/censor #
#
#<include file="examples/censor.conf.example">
@ -739,7 +739,7 @@
#<module name="dnsbl"> #
# #
# For configuration options please see the wiki page for dnsbl at #
# http://wiki.inspircd.org/Modules/dnsbl #
# https://wiki.inspircd.org/Modules/3.0/dnsbl #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Exempt channel operators module: Provides support for allowing #
@ -886,7 +886,7 @@
#
#-#-#-#-#-#-#-#-#-#-#- HOSTCHANGE CONFIGURATION -#-#-#-#-#-#-#-#-#-#
# #
# See http://wiki.inspircd.org/Modules/hostchange for help. #
# See https://wiki.inspircd.org/Modules/3.0/hostchange for help. #
# #
#<host suffix="invalid.org" separator="." prefix="">
#<hostchange mask="*@42.theanswer.example.org" action="addnick">
@ -971,7 +971,7 @@
#<inviteexception bypasskey="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# IRCv3 module: Provides the following IRCv3.1 extensions:
# IRCv3 module: Provides the following IRCv3 extensions:
# extended-join, away-notify and account-notify. These are optional
# enhancements to the client-to-server protocol. An extension is only
# active for a client when the client specifically requests it, so this
@ -979,7 +979,7 @@
#
# Further information on these extensions can be found at the IRCv3
# working group website:
# http://ircv3.org/extensions/
# http://ircv3.net/irc/
#
#<module name="ircv3">
# The following block can be used to control which extensions are
@ -1195,7 +1195,7 @@
#-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# mysql is more complex than described here, see the wiki for more #
# info: http://wiki.inspircd.org/Modules/mysql #
# info: https://wiki.inspircd.org/Modules/3.0/mysql #
#
#<database module="mysql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database2">
@ -1472,8 +1472,8 @@
#
#-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# pgsql is more complex than described here, see the wiki for #
# more: http://wiki.inspircd.org/Modules/pgsql #
# pgsql is more complex than described here, see the wiki for #
# more: https://wiki.inspircd.org/Modules/3.0/pgsql #
#
#<database module="pgsql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database" ssl="no">
@ -1700,6 +1700,12 @@
# Layer via AUTHENTICATE. Note: You also need to have cap loaded
# for SASL to work.
#<module name="sasl">
# Define the following to your services server name to improve security
# by ensuring the SASL messages are only sent to the services server
# and not to all connected servers. This prevents a rogue server from
# capturing SASL messages and disables the SASL cap when services is
# down.
#<sasl target="services.mynetwork.com">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Secure list module: Prevent /LIST in the first minute of connection,
@ -1865,7 +1871,7 @@
#-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_gnutls is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/ssl_gnutls #
# https://wiki.inspircd.org/Modules/3.0/ssl_gnutls #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SSL info module: Allows users to retrieve information about other
@ -1896,7 +1902,7 @@
#-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_openssl is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/ssl_openssl #
# https://wiki.inspircd.org/Modules/3.0/ssl_openssl #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Strip color module: Adds channel mode +S that strips color codes and
@ -1926,7 +1932,7 @@
#-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# sqlite is more complex than described here, see the wiki for more #
# info: http://wiki.inspircd.org/Modules/sqlite3 #
# info: https://wiki.inspircd.org/Modules/3.0/sqlite3 #
#
#<database module="sqlite" hostname="/full/path/to/database.db" id="anytext">
@ -1942,7 +1948,7 @@
#-#-#-#-#-#-#-#-#-#-#- SQLAUTH CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# sqlauth is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/sqlauth #
# https://wiki.inspircd.org/Modules/3.0/sqlauth #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SQL oper module: Allows you to store oper credentials in an SQL table
@ -1957,7 +1963,7 @@
# dbid - Database ID to use (see SQL modules). #
# hash - Hashing provider to use for password hashing. #
# #
# See also: http://wiki.inspircd.org/Modules/sqloper #
# See also: https://wiki.inspircd.org/Modules/3.0/sqloper #
# #
#<sqloper dbid="1" hash="bcrypt">

View File

@ -37,7 +37,7 @@
# Optional - If you specify to use cgiirc, then you must specify one
# or more cgihost tags which indicate authorised CGI:IRC servers which
# will be connecting to your network, and an optional cgiirc tag.
# For more information see: http://wiki.inspircd.org/Modules/cgiirc
# For more information see: https://wiki.inspircd.org/Modules/3.0/cgiirc
#
# Set to yes if you want to notice opers when CGI clients connect
# <cgiirc opernotice="no">
@ -262,7 +262,7 @@
#-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_gnutls is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/ssl_gnutls #
# https://wiki.inspircd.org/Modules/3.0/ssl_gnutls #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SSL Info module: Allows users to retrieve information about other
@ -289,7 +289,7 @@
#-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_openssl is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/ssl_openssl #
# https://wiki.inspircd.org/Modules/3.0/ssl_openssl #
<module name="stripcolor">
<module name="svshold">

View File

@ -59,7 +59,7 @@
# Optional - If you specify to use cgiirc, then you must specify one
# or more cgihost tags which indicate authorised CGI:IRC servers which
# will be connecting to your network, and an optional cgiirc tag.
# For more information see: http://wiki.inspircd.org/Modules/cgiirc
# For more information see: https://wiki.inspircd.org/Modules/3.0/cgiirc
#
# Set to yes if you want to notice opers when CGI clients connect
# <cgiirc opernotice="no">
@ -273,7 +273,7 @@
#-#-#-#-#-#-#-#-#-#-# OVERRIDE CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#
# #
# The override module is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/override #
# https://wiki.inspircd.org/Modules/3.0/override #
<module name="operlevels">
<module name="opermodes">
@ -361,7 +361,7 @@
#-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_gnutls is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/ssl_gnutls #
# https://wiki.inspircd.org/Modules/3.0/ssl_gnutls #
<module name="sslinfo">
@ -375,7 +375,7 @@
#-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_openssl is too complex to describe here, see the wiki: #
# http://wiki.inspircd.org/Modules/ssl_openssl #
# https://wiki.inspircd.org/Modules/3.0/ssl_openssl #
<module name="stripcolor">
<module name="svshold">

View File

@ -26,10 +26,10 @@
---- To change, see motd.txt.example -----
/ \
/ * Web: http://www.inspircd.org \
/ * Web: https://www.inspircd.org \
| * IRC: irc.inspircd.org #inspircd |
| * Docs: http://wiki.inspircd.org |
| * Bugs: http://inspircd.org/bugs |
| * Docs: https://wiki.inspircd.org |
| * Bugs: https://inspircd.org/bugs |
| |
| We hope you like this software. Please do |
| make sure you put some effort into |

View File

@ -26,10 +26,10 @@
-- To change, see opermotd.txt.example ---
/ \
/ * Web: http://www.inspircd.org \
/ * Web: https://www.inspircd.org \
| * IRC: irc.inspircd.org #inspircd |
| * Docs: http://wiki.inspircd.org |
| * Bugs: http://inspircd.org/bugs |
| * Docs: https://wiki.inspircd.org |
| * Bugs: https://inspircd.org/bugs |
| |
| We hope you like this software. Please do |
| make sure you put some effort into |

View File

@ -30,7 +30,7 @@
class CoreExport CommandParser
{
public:
typedef TR1NS::unordered_map<std::string, Command*> CommandMap;
typedef TR1NS::unordered_map<std::string, Command*, irc::insensitive, irc::StrHashComp> CommandMap;
private:
/** Process a command from a user.

View File

@ -73,7 +73,7 @@ sub parse_url {
}
my $mod;
for (split /\n+/, $response->decoded_content) {
for (split /\n+/, $response->content) {
s/^\s+//; # ignore whitespace at start
next if /^#/;
if (/^module (\S+) (\S+) (\S+)/) {
@ -334,7 +334,7 @@ for my $mod (sort keys %todo) {
if ($response->is_success) {
open(MF, ">src/modules/$mod.cpp") or die "\nFilesystem not writable: $!";
print MF $response->decoded_content;
print MF $response->content;
close(MF);
print " - done\n";
} else {

View File

@ -38,7 +38,7 @@ CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, Us
DieRestart::SendError("Server restarting.");
#ifndef _WIN32
/* XXX: This hack sets FD_CLOEXEC on all possible file descriptors, so they're closed if the execv() below succeeds.
/* XXX: This hack sets FD_CLOEXEC on all possible file descriptors, so they're closed if the execvp() below succeeds.
* Certainly, this is not a nice way to do things and it's slow when the fd limit is high.
*
* A better solution would be to set the close-on-exec flag for each fd we create (or create them with O_CLOEXEC),
@ -52,7 +52,7 @@ CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, Us
}
#endif
execv(ServerInstance->Config->cmdline.argv[0], ServerInstance->Config->cmdline.argv);
execvp(ServerInstance->Config->cmdline.argv[0], ServerInstance->Config->cmdline.argv);
ServerInstance->SNO->WriteGlobalSno('a', "Failed RESTART - could not execute '%s' (%s)",
ServerInstance->Config->cmdline.argv[0], strerror(errno));
}

View File

@ -2,7 +2,7 @@ This directory stores modules which require external libraries to compile.
For example, m_filter_pcre requires the PCRE libraries.
To compile any of these modules first ensure you have the required dependencies
(read the online documentation at http://wiki.inspircd.org/) and then symlink
(read the online documentation at https://wiki.inspircd.org/) and then symlink
the .cpp file from this directory into the parent directory (src/modules/).
Alternatively, use the command: ./configure --enable-extras=m_extra.cpp, which will

View File

@ -76,8 +76,6 @@
* if a module is ever put in a re-enterant state (stack corruption could occur, crashes, data
* corruption, and worse, so DONT think about it until the day comes when InspIRCd is 100%
* gauranteed threadsafe!)
*
* For a diagram of this system please see http://wiki.inspircd.org/Mysql2
*/
class SQLConnection;

View File

@ -399,7 +399,7 @@ class CommandCap : public SplitCommand
}
else
{
user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, subcommand, "Invalid CAP subcommand");
user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, subcommand.empty() ? "*" : subcommand, "Invalid CAP subcommand");
return CMD_FAILURE;
}

View File

@ -106,13 +106,17 @@ class CommandShun : public Command
if (parameters.size() == 1)
{
if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user))
if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "SHUN", user))
{
ServerInstance->SNO->WriteToSnoMask('x',"%s removed SHUN on %s",user->nick.c_str(),target.c_str());
ServerInstance->SNO->WriteToSnoMask('x', "%s removed SHUN on %s", user->nick.c_str(), parameters[0].c_str());
}
else if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user))
{
ServerInstance->SNO->WriteToSnoMask('x',"%s removed SHUN on %s", user->nick.c_str(), target.c_str());
}
else
{
user->WriteNotice("*** Shun " + target + " not found in list, try /stats H.");
user->WriteNotice("*** Shun " + parameters[0] + " not found in list, try /stats H.");
return CMD_FAILURE;
}
}

View File

@ -34,7 +34,7 @@
* If you completely change the protocol, completely change the number.
*
* IMPORTANT: If you make changes, document your changes here, without fail:
* http://wiki.inspircd.org/List_of_protocol_changes_between_versions
* https://wiki.inspircd.org/List_of_protocol_changes_between_versions
*
* Failure to document your protocol changes will result in a painfully
* painful death by pain. You have been warned.

View File

@ -117,11 +117,13 @@ class CommandTban : public Command
T.chan = channel;
TimedBanList.push_back(T);
const std::string addban = user->nick + " added a timed ban on " + mask + " lasting for " + ConvToStr(duration) + " seconds.";
// If halfop is loaded, send notice to halfops and above, otherwise send to ops and above
PrefixMode* mh = ServerInstance->Modes->FindPrefixMode('h');
char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
channel->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration);
channel->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, tmp, "NOTICE %s :%s", channel->name.c_str(), addban.c_str());
ServerInstance->PI->SendChannelNotice(channel, pfxchar, addban);
return CMD_SUCCESS;
}
@ -207,9 +209,13 @@ class ModuleTimedBans : public Module
Channel* cr = i->chan;
{
CUList empty;
std::string expiry = "*** Timed ban on " + cr->name + " expired.";
cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str());
ServerInstance->PI->SendChannelNotice(cr, '@', expiry);
const std::string expiry = "*** Timed ban on " + cr->name + " expired.";
// If halfop is loaded, send notice to halfops and above, otherwise send to ops and above
PrefixMode* mh = ServerInstance->Modes->FindPrefixMode('h');
char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
cr->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str());
ServerInstance->PI->SendChannelNotice(cr, pfxchar, expiry);
Modes::ChangeList setban;
setban.push_remove(ServerInstance->Modes->FindMode('b', MODETYPE_CHANNEL), mask);

View File

@ -730,8 +730,7 @@ bool User::SetClientIP(const std::string& address, bool recheck_eline)
void User::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline)
{
cachedip.clear();
cached_hostip.clear();
this->InvalidateCache();
memcpy(&client_sa, &sa, sizeof(irc::sockets::sockaddrs));
}