diff options
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | docs/conf/inspircd.conf.example | 3 | ||||
-rw-r--r-- | docs/conf/links.conf.example | 2 | ||||
-rw-r--r-- | docs/conf/modules.conf.example | 30 | ||||
-rw-r--r-- | docs/conf/modules/charybdis.conf.example | 6 | ||||
-rw-r--r-- | docs/conf/modules/unrealircd.conf.example | 8 | ||||
-rw-r--r-- | include/dynamic.h | 2 | ||||
-rw-r--r-- | include/typedefs.h | 6 | ||||
-rw-r--r-- | src/commands.cpp | 6 | ||||
-rw-r--r-- | src/commands/cmd_restart.cpp | 4 | ||||
-rw-r--r-- | src/dynamic.cpp | 15 | ||||
-rw-r--r-- | src/inspircd.cpp | 5 | ||||
-rw-r--r-- | src/modules.cpp | 9 | ||||
-rw-r--r-- | src/modules/extra/README | 2 | ||||
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_blockcaps.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_cap.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_noctcp.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 2 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 3 | ||||
-rw-r--r-- | src/xline.cpp | 11 |
24 files changed, 72 insertions, 65 deletions
@@ -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/inspircd.conf.example b/docs/conf/inspircd.conf.example index 7099cefe2..7ca028ac0 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -394,7 +394,8 @@ # represented as 192.168.1.0/24). This means that abuse across an ISP # # is detected and curtailed much easier. Here is a good chart that # # shows how many IPs the different CIDRs correspond to: # -# http://en.wikipedia.org/wiki/CIDR#Prefix_aggregation # +# https://en.wikipedia.org/wiki/IPv4_subnetting_reference # +# https://en.wikipedia.org/wiki/IPv6_subnetting_reference # # # <cidr 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 8e193904d..d2dad8af5 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 # # #<include file="conf/examples/censor.conf.example"> @@ -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. # <cgiirc opernotice="no"> @@ -745,7 +745,7 @@ #<module name="m_dnsbl.so"> # # # # 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. # # # #<host suffix="invalid.org" separator="." prefix=""> #<hostchange mask="*@42.theanswer.example.org" action="addnick"> @@ -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 # # #<database module="mssql" name="db" user="user" pass="pass" host="localhost" id="db1"> @@ -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 # # #<database module="mysql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database2"> @@ -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 # # #<database module="pgsql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database" ssl="no"> @@ -1722,7 +1722,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 @@ -1749,7 +1749,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 @@ -1768,7 +1768,7 @@ # SQLite3 module: Allows other SQL modules to access SQLite3 # # databases through a unified API. # # This module is in extras. Re-run configure with: # -# ./configure --enable-extras=m_sqlite.cpp +# ./configure --enable-extras=m_sqlite3.cpp # and run make install, then uncomment this module to enable it. # # #<module name="m_sqlite3.so"> @@ -1776,7 +1776,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 # # #<database module="sqlite" hostname="/full/path/to/database.db" id="anytext"> @@ -1792,7 +1792,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 @@ -1807,7 +1807,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 # # # #<sqloper dbid="1" hash="md5"> 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 # <cgiirc opernotice="no"> @@ -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 # <module name="m_stripcolor.so"> <module name="m_svshold.so"> 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 # <cgiirc opernotice="no"> @@ -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 # <module name="m_operlevels.so"> <module name="m_opermodes.so"> @@ -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 # <module name="m_sslinfo.so"> @@ -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 # <module name="m_stripcolor.so"> <module name="m_svshold.so"> diff --git a/include/dynamic.h b/include/dynamic.h index 5e66ddbb0..bbe89dc7e 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -33,11 +33,9 @@ class CoreExport DLLManager : public classbase */ std::string err; -#ifdef _WIN32 /** Sets the last error string */ void RetrieveLastError(); -#endif public: /** This constructor loads the module using dlopen() 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<std::string, file_cache> ConfigFileCache; /** A hash of commands used by the core */ -typedef nspace::hash_map<std::string,Command*> Commandtable; +#ifdef HASHMAP_DEPRECATED + typedef nspace::hash_map<std::string, Command*, nspace::insensitive, irc::StrHashComp> Commandtable; +#else + typedef nspace::hash_map<std::string, Command*, nspace::hash<std::string>, irc::StrHashComp> Commandtable; +#endif /** Membership list of a channel */ typedef std::map<User*, Membership*> UserMembList; diff --git a/src/commands.cpp b/src/commands.cpp index d805a1f65..5bf2aeb03 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -42,8 +42,8 @@ bool InspIRCd::HostMatchesEveryone(const std::string &mask, User* user) for (user_hash::iterator u = this->Users->clientlist->begin(); u != this->Users->clientlist->end(); u++) { - if ((InspIRCd::Match(u->second->MakeHost(), mask, ascii_case_insensitive_map)) || - (InspIRCd::Match(u->second->MakeHostIP(), mask, ascii_case_insensitive_map))) + if ((InspIRCd::MatchCIDR(u->second->MakeHost(), mask, ascii_case_insensitive_map)) || + (InspIRCd::MatchCIDR(u->second->MakeHostIP(), mask, ascii_case_insensitive_map))) { matches++; } @@ -74,7 +74,7 @@ bool InspIRCd::IPMatchesEveryone(const std::string &ip, User* user) for (user_hash::iterator u = this->Users->clientlist->begin(); u != this->Users->clientlist->end(); u++) { - if (InspIRCd::Match(u->second->GetIPString(), ip, ascii_case_insensitive_map)) + if (InspIRCd::MatchCIDR(u->second->GetIPString(), ip, ascii_case_insensitive_map)) matches++; } 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<std::string>& 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<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)); } diff --git a/src/dynamic.cpp b/src/dynamic.cpp index 3a6a151cb..25178cfa1 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -43,11 +43,7 @@ DLLManager::DLLManager(const char *fname) h = dlopen(fname, RTLD_NOW|RTLD_LOCAL); if (!h) { -#ifdef _WIN32 RetrieveLastError(); -#else - err = dlerror(); -#endif } } @@ -72,11 +68,7 @@ Module* DLLManager::CallInit() initfn.vptr = dlsym(h, MODULE_INIT_STR); if (!initfn.vptr) { -#ifdef _WIN32 RetrieveLastError(); -#else - err = dlerror(); -#endif return NULL; } @@ -94,18 +86,21 @@ std::string DLLManager::GetVersion() return "Unversioned module"; } -#ifdef _WIN32 void DLLManager::RetrieveLastError() { +#if defined _WIN32 char errmsg[500]; DWORD dwErrorCode = GetLastError(); if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)errmsg, _countof(errmsg), NULL) == 0) sprintf_s(errmsg, _countof(errmsg), "Error code: %u", dwErrorCode); SetLastError(ERROR_SUCCESS); err = errmsg; +#else + char* errmsg = dlerror(); + err = errmsg ? errmsg : "Unknown error"; +#endif std::string::size_type p; while ((p = err.find_last_of("\r\n")) != std::string::npos) err.erase(p, 1); } -#endif diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 0fa90fca5..66f9bfdc5 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -223,6 +223,11 @@ void InspIRCd::RehashUsersAndChans() (**i).already_sent = 0; (**i).RemoveExpiredInvites(); } + + // HACK: ELines are not expired properly at the moment but it can't be fixed as + // the 2.0 XLine system is a spaghetti nightmare. Instead we skip over expired + // ELines in XLineManager::CheckELines() and expire them here instead. + ServerInstance->XLines->GetAll("E"); } void InspIRCd::SetSignals() 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)) { 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_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 200693699..7146ee068 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -67,7 +67,7 @@ public: { if (target_type == TYPE_CHANNEL) { - if ((!IS_LOCAL(user)) || (text.length() < minlen)) + if ((!IS_LOCAL(user)) || (text.length() < minlen) || (text == "\1ACTION\1") || (text == "\1ACTION")) return MOD_RES_PASSTHRU; Channel* c = (Channel*)dest; 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; } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 09f6a4659..9e1a546d6 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -99,7 +99,7 @@ class CommandWebirc : public Command realhost.set(user, user->host); realip.set(user, user->GetIPString()); - bool host_ok = (parameters[2].length() < 64); + bool host_ok = (parameters[2].length() < 64) && (parameters[2].find_first_not_of("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-") == std::string::npos); const std::string& newhost = (host_ok ? parameters[2] : parameters[3]); if (notify) diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 1dd6fe34a..c934a05c6 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -67,7 +67,7 @@ class ModuleNoCTCP : public Module if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) { Channel* c = (Channel*)dest; - if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ",8))) + if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ", 8)) || (text == "\1ACTION\1") || (text == "\1ACTION")) return MOD_RES_PASSTHRU; ModResult res = ServerInstance->OnCheckExemption(user,c,"noctcp"); diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 8ac43fba7..7108e0c07 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -103,6 +103,15 @@ class SaslAuthenticator params.push_back(host); params.push_back(ip); + LocalUser* lu = IS_LOCAL(user); + if (lu) + { + // NOTE: SaslAuthenticator instances are only created for local + // users so this parameter will always be appended. + SocketCertificateRequest req(&lu->eh, ServerInstance->Modules->Find("m_sasl.so")); + params.push_back(req.cert ? "S" : "P"); + } + SendSASL(params); } 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. diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index b47327704..61095d6eb 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -119,7 +119,7 @@ class CommandTban : public Command // 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") ? '%' : '@'; + 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); return CMD_SUCCESS; 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)); } diff --git a/src/xline.cpp b/src/xline.cpp index 66d24f439..0506005ad 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -159,6 +159,7 @@ void XLineManager::CheckELines() for (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) { User* u = (User*)(*u2); + u->exempt = false; /* This uses safe iteration to ensure that if a line expires here, it doenst trash the iterator */ LookupIter safei; @@ -169,7 +170,8 @@ void XLineManager::CheckELines() safei++; XLine *e = i->second; - u->exempt = e->Matches(u); + if ((!e->duration || ServerInstance->Time() < e->expiry) && e->Matches(u)) + u->exempt = true; i = safei; } @@ -325,13 +327,6 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User* void ELine::Unset() { - /* remove exempt from everyone and force recheck after deleting eline */ - for (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) - { - User* u = (User*)(*u2); - u->exempt = false; - } - ServerInstance->XLines->CheckELines(); } |