]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge pull request #1359 from genius3000/insp20+sasl_no_server
authorPeter Powell <petpow@saberuk.com>
Mon, 6 Nov 2017 11:11:22 +0000 (11:11 +0000)
committerGitHub <noreply@github.com>
Mon, 6 Nov 2017 11:11:22 +0000 (11:11 +0000)
2.0: Inform the client when a SASL message cannot be sent

24 files changed:
configure
docs/conf/inspircd.conf.example
docs/conf/links.conf.example
docs/conf/modules.conf.example
docs/conf/modules/charybdis.conf.example
docs/conf/modules/unrealircd.conf.example
include/dynamic.h
include/typedefs.h
src/commands.cpp
src/commands/cmd_restart.cpp
src/dynamic.cpp
src/inspircd.cpp
src/modules.cpp
src/modules/extra/README
src/modules/extra/m_mysql.cpp
src/modules/m_blockcaps.cpp
src/modules/m_cap.cpp
src/modules/m_cgiirc.cpp
src/modules/m_noctcp.cpp
src/modules/m_sasl.cpp
src/modules/m_spanningtree/main.h
src/modules/m_timedbans.cpp
src/users.cpp
src/xline.cpp

index 8b9689b2908e0cf0f36a7d32ce40e1eb147810da..39968db6e6932954db2535c28606a2480602d9d8 100755 (executable)
--- 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++")) {
index 7099cefe262a6a7c4b53e4c7ca6dfa6696c1a9fb..7ca028ac06f76a484f9540b5a00fb7263b52b6ef 100644 (file)
 # 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
index a1bab2b3aaebe9241df556136f896d8abc7748ff..ba18c5325205ff46150a2f80709f74e1c46f060d 100644 (file)
@@ -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=""
index 8e193904df97862efc81487b787227445fdfd7f5..d2dad8af56c9f962c37d60443ba433a825bd8905 100644 (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/2.0/Modules for a list of modules and    #
 #  each modules link for any additional conf tags they require.       #
 #                                                                     #
 #    ____                _   _____ _     _       ____  _ _   _        #
 #                                                                     #
 # 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">
 
 # 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">
 #<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      #
 #
 #-#-#-#-#-#-#-#-#-#-#-  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">
 #-#-#-#-#-#-#-#-#-#-#-#- 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">
 
 #-#-#-#-#-#-#-#-#-#-#-#- 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">
 
 #-#-#-#-#-#-#-#-#-#-#   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
 #-#-#-#-#-#-#-#-#-#-#-#- 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">
 
 #-#-#-#-#-#-#-#-#-#-#-  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
 #-#-#-#-#-#-#-#-#-#-#- 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
 # 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">
 #-#-#-#-#-#-#-#-#-#-#-#- 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">
 
 #-#-#-#-#-#-#-#-#-#-#- 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
 # 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">
 
index 7840b4ef54fddf821b692be3a85add46bf058315..91260c7d3133979923736996ce05c3d7d02d789a 100644 (file)
@@ -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">
 #-#-#-#-#-#-#-#-#-#-#-  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
 #-#-#-#-#-#-#-#-#-#-#- 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">
index 58f36da23b1e6e96888df8391f132aa4455bc49b..65d71339455709cf2ca2b430798282b11ea3312c 100644 (file)
@@ -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">
 #-#-#-#-#-#-#-#-#-#-#   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">
 #-#-#-#-#-#-#-#-#-#-#-  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">
 
 #-#-#-#-#-#-#-#-#-#-#- 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">
index 5e66ddbb0493938a440eb42afcabf1f3c0447833..bbe89dc7ee94c04de5b386fa2531217664bfe068 100644 (file)
@@ -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()
index 06f704120126309a93114d0996ea20d24139e75e..03593d40f45e616998a9509d37fad8b400d8c280 100644 (file)
@@ -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;
index d805a1f6591df580feb874adf6e82b4990747f12..5bf2aeb03a420e024289d0478ed05b2fe4419195 100644 (file)
@@ -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++;
        }
 
index bdbcfed35d314069b8355917dd0d502b960a5ae9..48f902d1ee1677f83c2e37daffb889188b8638a5 100644 (file)
@@ -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));
        }
index 3a6a151cb5d047db124b4caca75d1a8063c0a1bf..25178cfa111c7f287461e9fd4053e7f70e22cb0a 100644 (file)
@@ -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
index 0fa90fca5b6028ed764f94f6878d470b530320cb..66f9bfdc56ca0de5edba55836444c8031a74c710 100644 (file)
@@ -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()
index b2d2f23c68af1acf45b429bd3de819298f0393de..79a33e6172599f5f618627c58e3413fc902991b9 100644 (file)
@@ -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))
        {
index 2478b57cf49e34b7f9dc23ab99c2dff9fd93d490..b59494df9e0104c46dd1cc9cc0091ff10292114d 100644 (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
index 01b1553b0b1d36b0e15433f5b8bb17793ca22cd7..159a0b8b2318b1b336300a243da7e00c2c848cc8 100644 (file)
@@ -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;
index 2006936992aa333723efa750548e38acd964030a..7146ee068d421b0cf83525117eaad13355cd7b09 100644 (file)
@@ -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;
index 6b4387fdd96ccec55db075d0391be07a6478c02f..ae9e824f448c61ab2b94dfe20f29c47572c2a5e0 100644 (file)
@@ -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;
                }
 
index 09f6a4659d88e0d760a85d48166514ed825b68d8..9e1a546d6ae41ffe89b6a766b1f3051282ac00a2 100644 (file)
@@ -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)
index 1dd6fe34ad467d71617f55b52316685cc9b3e9b7..c934a05c6edbfbe254d17b28f27d8c84d7a1fb5d 100644 (file)
@@ -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");
index 8ac43fba7319e6a03e1a1c09baa7bcd30034d4e2..7108e0c07e84f285788eb10e36dff885bd75e75b 100644 (file)
@@ -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);
        }
 
index 17adc928780a4f9f3aa04f01bd4686c5a2acfcbc..3e0a831111ed205efc98c9242b0b9c0708a34907 100644 (file)
@@ -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.
index b473277046c0af470fbd3afea566c89711090711..61095d6ebae2f2ed70ce316ff21c1f1f66fc2024 100644 (file)
@@ -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;
index 4dbb73a1f55ef7e4e5492784d1165d283c832c53..9e06485e5182c6a1ed511a152e7510438261790a 100644 (file)
@@ -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));
 }
 
index 66d24f439a6b12b600033a17bf40ef3b72ba6efd..0506005add1926b256762955f579b6feea55cbbf 100644 (file)
@@ -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();
 }