From a5d110282a864fd2e91b51ce360a977cd0643657 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 20 Aug 2017 17:47:38 +0100 Subject: [PATCH 01/13] Update wiki links to use HTTPS and point to the correct pages. When we release 3.0 these links will break as they will point to the pages for 3.0 rather than 2.0. --- configure | 2 +- docs/conf/links.conf.example | 2 +- docs/conf/modules.conf.example | 28 +++++++++++------------ docs/conf/modules/charybdis.conf.example | 6 ++--- docs/conf/modules/unrealircd.conf.example | 8 +++---- src/modules/extra/README | 2 +- src/modules/extra/m_mysql.cpp | 2 -- src/modules/m_spanningtree/main.h | 2 +- 8 files changed, 25 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 8b9689b29..39968db6e 100755 --- a/configure +++ b/configure @@ -716,7 +716,7 @@ if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) { print "Please note: for \e[1;32mSSL support\e[0m you will need to load required\n"; print "modules in your config. This configure script has added those modules to the\n"; print "build process. For more info, please refer to:\n"; - print "\e[1;32mhttp://wiki.inspircd.org/Installation_From_Tarball\e[0m\n"; + print "\e[1;32mhttps://wiki.inspircd.org/Installation_From_Tarball\e[0m\n"; } print "*** \e[1;32mRemember to edit your configuration files!!!\e[0m ***\n\n\n"; if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) { diff --git a/docs/conf/links.conf.example b/docs/conf/links.conf.example index a1bab2b3a..ba18c5325 100644 --- a/docs/conf/links.conf.example +++ b/docs/conf/links.conf.example @@ -46,7 +46,7 @@ ssl="gnutls" # fingerprint: If defined, this option will force servers to be - # authenticated using SSL Fingerprints. See http://wiki.inspircd.org/SSL + # authenticated using SSL Fingerprints. See https://wiki.inspircd.org/SSL # for more information. This will require an SSL link for both inbound # and outbound connections. #fingerprint="" diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index b0c24194a..34e25b1e2 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -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/2.0/Modules for a list of modules and # # each modules link for any additional conf tags they require. # # # # ____ _ _____ _ _ ____ _ _ _ # @@ -313,7 +313,7 @@ # # # Optional - If you specify to use the m_censor module, then you must # # specify some censor tags. See also: # -# http://wiki.inspircd.org/Modules/censor # +# https://wiki.inspircd.org/Modules/2.0/censor # # # @@ -327,7 +327,7 @@ # Optional - If you specify to use m_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/2.0/cgiirc # # Set to yes if you want to notice opers when CGI:IRC clients connect. # @@ -745,7 +745,7 @@ # # # # # For configuration options please see the wiki page for m_dnsbl at # -# http://wiki.inspircd.org/Modules/dnsbl # +# https://wiki.inspircd.org/Modules/2.0/dnsbl # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Exempt channel operators module: Provides support for allowing # @@ -868,7 +868,7 @@ # #-#-#-#-#-#-#-#-#-#-#- HOSTCHANGE CONFIGURATION -#-#-#-#-#-#-#-#-#-# # # -# See http://wiki.inspircd.org/Modules/hostchange for help. # +# See https://wiki.inspircd.org/Modules/2.0/hostchange for help. # # # # # @@ -1129,7 +1129,7 @@ #-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-# # # # m_mssql.so is more complex than described here, see wiki for more # -# info http://wiki.inspircd.org/Modules/mssql # +# info https://wiki.inspircd.org/Modules/2.0/mssql # # # @@ -1144,7 +1144,7 @@ #-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-# # # # m_mysql.so is more complex than described here, see the wiki for # -# more: http://wiki.inspircd.org/Modules/mysql # +# more: https://wiki.inspircd.org/Modules/2.0/mysql # # # @@ -1309,7 +1309,7 @@ #-#-#-#-#-#-#-#-#-#-# OVERRIDE CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# # # # m_override.so is too complex it describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/override # +# https://wiki.inspircd.org/Modules/2.0/override # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Oper levels module: Gives each oper a level and prevents actions @@ -1402,7 +1402,7 @@ #-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-# # # # m_pgsql.so is more complex than described here, see the wiki for # -# more: http://wiki.inspircd.org/Modules/pgsql # +# more: https://wiki.inspircd.org/Modules/2.0/pgsql # # # @@ -1715,7 +1715,7 @@ #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/ssl_gnutls # +# https://wiki.inspircd.org/Modules/2.0/ssl_gnutls # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SSL info module: Allows users to retrieve information about other @@ -1742,7 +1742,7 @@ #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/ssl_openssl # +# https://wiki.inspircd.org/Modules/2.0/ssl_openssl # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Strip color module: Adds channel mode +S that strips mIRC color @@ -1769,7 +1769,7 @@ #-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-# # # # m_sqlite.so is more complex than described here, see the wiki for # -# more: http://wiki.inspircd.org/Modules/sqlite3 # +# more: https://wiki.inspircd.org/Modules/2.0/sqlite3 # # # @@ -1785,7 +1785,7 @@ #-#-#-#-#-#-#-#-#-#-#- SQLAUTH CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_sqlauth.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/sqlauth # +# https://wiki.inspircd.org/Modules/2.0/sqlauth # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SQL oper module: Allows you to store oper credentials in an SQL table @@ -1800,7 +1800,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/2.0/sqloper # # # # diff --git a/docs/conf/modules/charybdis.conf.example b/docs/conf/modules/charybdis.conf.example index 7840b4ef5..91260c7d3 100644 --- a/docs/conf/modules/charybdis.conf.example +++ b/docs/conf/modules/charybdis.conf.example @@ -37,7 +37,7 @@ # Optional - If you specify to use m_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/2.0/cgiirc # # Set to yes if you want to notice opers when CGI clients connect # @@ -262,7 +262,7 @@ #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/ssl_gnutls # +# https://wiki.inspircd.org/Modules/2.0/ssl_gnutls # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SSL Info module: Allows users to retrieve information about other @@ -289,7 +289,7 @@ #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/ssl_openssl # +# https://wiki.inspircd.org/Modules/2.0/ssl_openssl # diff --git a/docs/conf/modules/unrealircd.conf.example b/docs/conf/modules/unrealircd.conf.example index 58f36da23..65d713394 100644 --- a/docs/conf/modules/unrealircd.conf.example +++ b/docs/conf/modules/unrealircd.conf.example @@ -59,7 +59,7 @@ # Optional - If you specify to use m_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/2.0/cgiirc # # Set to yes if you want to notice opers when CGI clients connect # @@ -283,7 +283,7 @@ #-#-#-#-#-#-#-#-#-#-# OVERRIDE CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# # # # m_override.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/override # +# https://wiki.inspircd.org/Modules/2.0/override # @@ -371,7 +371,7 @@ #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/ssl_gnutls # +# https://wiki.inspircd.org/Modules/2.0/ssl_gnutls # @@ -385,7 +385,7 @@ #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex to describe here, see the wiki: # -# http://wiki.inspircd.org/Modules/ssl_openssl # +# https://wiki.inspircd.org/Modules/2.0/ssl_openssl # diff --git a/src/modules/extra/README b/src/modules/extra/README index 2478b57cf..b59494df9 100644 --- a/src/modules/extra/README +++ b/src/modules/extra/README @@ -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 diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 01b1553b0..159a0b8b2 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -67,8 +67,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; diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 17adc9287..3e0a83111 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -31,7 +31,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. From f237007bc1137dce5a7955238e7f0acd55942129 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 16 Oct 2017 17:00:53 +0100 Subject: [PATCH 02/13] Fix the command table not being case insensitive. This is not an issue normally but in some circumstances (e.g. when disabling commands) it can result in command lookups failing even when they exist. --- include/typedefs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/typedefs.h b/include/typedefs.h index 06f704120..03593d40f 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -120,7 +120,11 @@ typedef std::map ConfigFileCache; /** A hash of commands used by the core */ -typedef nspace::hash_map Commandtable; +#ifdef HASHMAP_DEPRECATED + typedef nspace::hash_map Commandtable; +#else + typedef nspace::hash_map, irc::StrHashComp> Commandtable; +#endif /** Membership list of a channel */ typedef std::map UserMembList; From 7e4cc45149f41346f18e581cb301a1196b92bf68 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 18 Oct 2017 00:36:26 +0100 Subject: [PATCH 03/13] Fix sending a malformed 410 numeric when sent empty CAP commands. --- src/modules/m_cap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 6b4387fdd..ae9e824f4 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -120,7 +120,7 @@ class CommandCAP : public Command } else { - user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, "%s %s :Invalid CAP subcommand", user->nick.c_str(), subcommand.c_str()); + user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, "%s %s :Invalid CAP subcommand", user->nick.c_str(), subcommand.empty() ? "*" : subcommand.c_str()); return CMD_FAILURE; } From 7b7953aaf2aa0895604e57fe0136ba9a5831349c Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 26 Oct 2017 20:23:24 -0400 Subject: [PATCH 04/13] ConfigReader: fix compilers optimizing NULL check in ConfigTag::readString() See: 66f82ccf926aac39273bfc652c85c08080cc9a46 Fixes inspircd/inspircd-extras#110 --- src/modules.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules.cpp b/src/modules.cpp index b2d2f23c6..79a33e617 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -641,7 +641,8 @@ static ConfigTag* SlowGetTag(const std::string &tag, int index) std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds) { std::string result = default_value; - if (!SlowGetTag(tag, index)->readString(name, result, allow_linefeeds)) + ConfigTag* conftag = SlowGetTag(tag, index); + if (!conftag || !conftag->readString(name, result, allow_linefeeds)) { this->error = CONF_VALUE_NOT_FOUND; } @@ -656,7 +657,8 @@ std::string ConfigReader::ReadValue(const std::string &tag, const std::string &n bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, const std::string &default_value, int index) { bool def = (default_value == "yes"); - return SlowGetTag(tag, index)->getBool(name, def); + ConfigTag* conftag = SlowGetTag(tag, index); + return conftag ? conftag->getBool(name, def) : def; } bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int index) @@ -668,7 +670,8 @@ bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool need_positive) { int v = atoi(default_value.c_str()); - int result = SlowGetTag(tag, index)->getInt(name, v); + ConfigTag* conftag = SlowGetTag(tag, index); + int result = conftag ? conftag->getInt(name, v) : v; if ((need_positive) && (result < 0)) { From 5f3360a217f28d1ba80fdf5db3167c87dd70449c Mon Sep 17 00:00:00 2001 From: Jordyn/The Linux Geek Date: Sat, 4 Nov 2017 18:13:41 -0500 Subject: [PATCH 05/13] Fix CMD_RESTART with relative paths as argv[0]. --- src/commands/cmd_restart.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/cmd_restart.cpp b/src/commands/cmd_restart.cpp index bdbcfed35..48f902d1e 100644 --- a/src/commands/cmd_restart.cpp +++ b/src/commands/cmd_restart.cpp @@ -47,7 +47,7 @@ CmdResult CommandRestart::Handle (const std::vector& parameters, Us ServerInstance->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), @@ -61,7 +61,7 @@ CmdResult CommandRestart::Handle (const std::vector& 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)); } From 52de083afcd1608f030551f532bdcdb1f45f1513 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 22 Oct 2017 23:51:15 +0100 Subject: [PATCH 06/13] Use InvalidateCache in the sockaddrs overload of OnSetClientIP. This was done to the string variant in d3b82b2f7f. --- src/users.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/users.cpp b/src/users.cpp index 4dbb73a1f..9e06485e5 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1008,8 +1008,7 @@ bool User::SetClientIP(const char* sip, 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)); } From 9d4b4344b49de3c474302e8316576b759249c409 Mon Sep 17 00:00:00 2001 From: genius3000 Date: Thu, 27 Jul 2017 03:05:44 -0600 Subject: [PATCH 07/13] Inform the client when a SASL message cannot be sent When SASL is properly configured with a 'target' server, we are able to inform the client when the message fails to send. Currently if a target is configured and it is offline, no response is sent. This can cause some clients to time out while waiting for a response. If a target isn't configured, behaviour will not change with this commit. The default of '*' will still send to all servers. Updated example config with 'target' variable. --- docs/conf/modules.conf.example | 7 +++++++ src/modules/m_sasl.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index b39ee5d2b..8e193904d 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1591,6 +1591,13 @@ # Layer via AUTHENTICATE. Note: You also need to have m_cap.so loaded # for SASL to work. # +# 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. Having this defined can also improve client +# connections when your services are down, as the client will be told +# that SASL failed rather than just timing out on registration. +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Secure list module: Prevent /LIST in the first minute of connection, diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 5afab9502..8ac43fba7 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -35,6 +35,10 @@ static void SendSASL(const parameterlist& params) { if (!ServerInstance->PI->SendEncapsulatedData(params)) { + User* u = ServerInstance->FindUUID(params[2]); + if (u) + u->WriteNumeric(904, "%s :SASL authentication failed", u->nick.c_str()); + SASLFallback(NULL, params); } } From 3eefb336c670d5b2f39696913717e0c47b75232c Mon Sep 17 00:00:00 2001 From: genius3000 Date: Mon, 21 Nov 2016 22:00:27 -0700 Subject: [PATCH 08/13] Improve (synchronize) the notices in m_timedbans * Send to remote servers upon setting * Send to halfop if available upon expiry --- src/modules/m_timedbans.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 61095d6eb..bbbc518bd 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -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 ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); 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 setban.push_back(mask); CUList empty; - std::string expiry = "*** Timed ban on " + chan + " 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 " + chan + " expired."; + // If halfop is loaded, send notice to halfops and above, otherwise send to ops and above + ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); + 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); ServerInstance->SendGlobalMode(setban, ServerInstance->FakeClient); } From e83506b7abde9fdd628b9065fb3b6c01d370808f Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 9 Nov 2017 11:04:52 +0000 Subject: [PATCH 09/13] Revert the code changes to m_sasl made in commit 9d4b4344b4. This is causing problems such as duplicate 904 messages. --- src/modules/m_sasl.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 7108e0c07..0ef93ec5a 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -35,10 +35,6 @@ static void SendSASL(const parameterlist& params) { if (!ServerInstance->PI->SendEncapsulatedData(params)) { - User* u = ServerInstance->FindUUID(params[2]); - if (u) - u->WriteNumeric(904, "%s :SASL authentication failed", u->nick.c_str()); - SASLFallback(NULL, params); } } From f57dbb6dbe0a49b0f0aa80c327904d4273a76b55 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 7 Nov 2017 18:18:35 +0000 Subject: [PATCH 10/13] Work around removing shuns on nicks when the nick is online. --- src/modules/m_shun.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 8bf4d30e7..3147d5476 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -114,13 +114,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(), 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->WriteServ("NOTICE %s :*** Shun %s not found in list, try /stats H.",user->nick.c_str(),target.c_str()); + user->WriteServ("NOTICE %s :*** Shun %s not found in list, try /stats H.", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } } From a137eb1c2649e702efee7cb1a50b4da467f9d4bd Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 12 Nov 2017 11:58:49 +0000 Subject: [PATCH 11/13] Various minor documentation fixes. - Remind admins that not setting a DIE/RESTART password does not disable use of those commands. - Remove references to 1.2 and modules being able to create custom logging methods. This was never implemented in the 2.0 branch. - Remove references to an SASL improvement that was reverted. - Update various InspIRCd website links to use HTTPS over HTTP. - Update a link to the IRCv3 website to point to the new website. --- docs/conf/inspircd.conf.example | 15 +++++++++------ docs/conf/modules.conf.example | 8 +++----- docs/conf/motd.txt.example | 6 +++--- docs/conf/opermotd.txt.example | 6 +++--- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index 7ca028ac0..8ec6616bd 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -187,10 +187,18 @@ # diepass: Password for opers to use if they need to shutdown (die) # a server. + # + # IMPORTANT: leaving this field empty does not disable the use of + # the DIE command. In order to prevent the use of this command you + # should remove it from the command privileges of your opers. diepass="" # restartpass: Password for opers to use if they need to restart # a server. + # + # IMPORTANT: leaving this field empty does not disable the use of + # the RESTART command. In order to prevent the use of this command + # you should remove it from the command privileges of your opers. restartpass=""> @@ -796,11 +804,6 @@ # Logging is covered with the 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: # # which would log all information on /oper (failed and successful) to @@ -978,6 +981,6 @@ ######################################################################### # # # - InspIRCd Development Team - # -# http://www.inspircd.org # +# https://www.inspircd.org # # # ######################################################################### diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index d2dad8af5..b672367f9 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -941,7 +941,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# 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 @@ -949,7 +949,7 @@ # # Further information on these extensions can be found at the IRCv3 # working group website: -# http://ircv3.org/extensions/ +# http://ircv3.net/irc/ # # # The following block can be used to control which extensions are @@ -1594,9 +1594,7 @@ # 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. Having this defined can also improve client -# connections when your services are down, as the client will be told -# that SASL failed rather than just timing out on registration. +# capturing SASL messages. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/docs/conf/motd.txt.example b/docs/conf/motd.txt.example index 04f7b11b2..891aaa51c 100644 --- a/docs/conf/motd.txt.example +++ b/docs/conf/motd.txt.example @@ -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 | diff --git a/docs/conf/opermotd.txt.example b/docs/conf/opermotd.txt.example index 0ac4cfea1..4bf7c85e4 100644 --- a/docs/conf/opermotd.txt.example +++ b/docs/conf/opermotd.txt.example @@ -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 | From c2f9865bb8807c006b5ab12ff7a051168bda9047 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 12 Nov 2017 14:33:08 +0000 Subject: [PATCH 12/13] Don't mess with the encoding of extras modules in modulemanager. This fixes installing extras modules such as m_qrcode which contain characters from outside of the Unicode Basic Multilingual Plane. --- modulemanager | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modulemanager b/modulemanager index 42566d3b1..bc4619408 100755 --- a/modulemanager +++ b/modulemanager @@ -75,7 +75,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+)/) { @@ -359,7 +359,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 { From 53d822a7d19aded988ee74eb05437e587cb1ac92 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 12 Nov 2017 15:55:01 +0000 Subject: [PATCH 13/13] Release v2.0.25 --- src/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.sh b/src/version.sh index 2025a4810..4172331bf 100755 --- a/src/version.sh +++ b/src/version.sh @@ -1,2 +1,2 @@ #!/bin/sh -echo "InspIRCd-2.0.24" +echo "InspIRCd-2.0.25"