diff options
| author | 2021-03-10 04:53:30 +0000 | |
|---|---|---|
| committer | 2021-03-10 04:53:30 +0000 | |
| commit | ae997d094597251ec0ec9c5931c97b4db49a31d1 (patch) | |
| tree | 8bbf2c9346800da792d442ec7f8b6708274e7e06 /src/modules | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Rename `<bind:ssl>` to `<bind:sslprofile>`. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 4 | ||||
| -rw-r--r-- | src/modules/extra/m_ssl_mbedtls.cpp | 4 | ||||
| -rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_callerid.cpp | 6 | ||||
| -rw-r--r-- | src/modules/m_cloaking.cpp | 20 | ||||
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 23 | ||||
| -rw-r--r-- | src/modules/m_ircv3_sts.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 2 |
8 files changed, 46 insertions, 19 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 0ad6e3b99..9ebfbb2db 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -1074,13 +1074,13 @@ int GnuTLS::X509Credentials::cert_callback(gnutls_session_t sess, const gnutls_d return 0; } -class GnuTLSIOHookProvider : public IOHookProvider +class GnuTLSIOHookProvider : public SSLIOHookProvider { GnuTLS::Profile profile; public: GnuTLSIOHookProvider(Module* mod, GnuTLS::Profile::Config& config) - : IOHookProvider(mod, "ssl/" + config.name, IOHookProvider::IOH_SSL) + : SSLIOHookProvider(mod, config.name) , profile(config) { ServerInstance->Modules.AddService(*this); diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp index 89a1d24a7..722aee472 100644 --- a/src/modules/extra/m_ssl_mbedtls.cpp +++ b/src/modules/extra/m_ssl_mbedtls.cpp @@ -806,13 +806,13 @@ class mbedTLSIOHook : public SSLIOHook bool IsHandshakeDone() const { return (status == ISSL_HANDSHAKEN); } }; -class mbedTLSIOHookProvider : public IOHookProvider +class mbedTLSIOHookProvider : public SSLIOHookProvider { mbedTLS::Profile profile; public: mbedTLSIOHookProvider(Module* mod, mbedTLS::Profile::Config& config) - : IOHookProvider(mod, "ssl/" + config.name, IOHookProvider::IOH_SSL) + : SSLIOHookProvider(mod, config.name) , profile(config) { ServerInstance->Modules.AddService(*this); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 6ab3da6c3..1b165fd85 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -861,13 +861,13 @@ static int OpenSSL::BIOMethod::read(BIO* bio, char* buffer, int size) return ret; } -class OpenSSLIOHookProvider : public IOHookProvider +class OpenSSLIOHookProvider : public SSLIOHookProvider { OpenSSL::Profile profile; public: OpenSSLIOHookProvider(Module* mod, const std::string& profilename, std::shared_ptr<ConfigTag> tag) - : IOHookProvider(mod, "ssl/" + profilename, IOHookProvider::IOH_SSL) + : SSLIOHookProvider(mod, profilename) , profile(profilename, tag) { ServerInstance->Modules.AddService(*this); diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 615832185..dae75dae9 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -66,8 +66,10 @@ class callerid_data for (UserSet::const_iterator i = accepting.begin(); i != accepting.end(); ++i) { User* u = *i; - // Encode UIDs. - oss << "," << (human ? u->nick : u->uuid); + if (human) + oss << ' ' << u->nick; + else + oss << ',' << u->uuid; } return oss.str(); } diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 46d2a86de..657f05721 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -81,20 +81,32 @@ struct CloakInfo typedef std::vector<std::string> CloakList; -/** Handles user mode +x - */ +class CloakExtItem : public SimpleExtItem<CloakList> +{ + public: + CloakExtItem(Module* Creator) + : SimpleExtItem(Creator, "cloaks", ExtensionItem::EXT_USER) + { + } + + std::string ToHuman(const Extensible* container, void* item) const override + { + return stdalgo::string::join(*static_cast<CloakList*>(item), ' '); + } +}; + class CloakUser : public ModeHandler { public: bool active = false; - SimpleExtItem<CloakList> ext; + CloakExtItem ext; std::string debounce_uid; time_t debounce_ts = 0; int debounce_count = 0; CloakUser(Module* source) : ModeHandler(source, "cloak", 'x', PARAM_NONE, MODETYPE_USER) - , ext(source, "cloaked_host", ExtensionItem::EXT_USER) + , ext(source) { } diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 545a315cf..28a09034b 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -84,7 +84,10 @@ class DNSBLResolver : public DNS::Request /* Check the user still exists */ LocalUser* them = IS_LOCAL(ServerInstance->Users.FindUUID(theiruid)); if (!them || them->client_sa != theirsa) + { + ConfEntry->stats_misses++; return; + } int i = countExt.get(them); if (i) @@ -242,6 +245,20 @@ class DNSBLResolver : public DNS::Request void OnError(const DNS::Query *q) override { + bool is_miss = true; + switch (q->error) + { + case DNS::ERROR_NO_RECORDS: + case DNS::ERROR_DOMAIN_NOT_FOUND: + ConfEntry->stats_misses++; + break; + + default: + ConfEntry->stats_errors++; + is_miss = false; + break; + } + LocalUser* them = IS_LOCAL(ServerInstance->Users.FindUUID(theiruid)); if (!them || them->client_sa != theirsa) return; @@ -250,13 +267,9 @@ class DNSBLResolver : public DNS::Request if (i) countExt.set(them, i - 1); - if (q->error == DNS::ERROR_NO_RECORDS || q->error == DNS::ERROR_DOMAIN_NOT_FOUND) - { - ConfEntry->stats_misses++; + if (is_miss) return; - } - ConfEntry->stats_errors++; ServerInstance->SNO.WriteGlobalSno('d', "An error occurred whilst checking whether %s (%s) is on the '%s' DNS blacklist: %s", them->GetFullRealHost().c_str(), them->GetIPString().c_str(), ConfEntry->name.c_str(), this->manager->GetErrorStr(q->error).c_str()); } diff --git a/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index 3ece15889..ef1586208 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -142,7 +142,7 @@ class ModuleIRCv3STS : public Module continue; // Is this listener using TLS (SSL)? - if (ls->bind_tag->getString("ssl").empty()) + if (ls->bind_tag->getString("sslprofile").empty()) continue; // TODO: Add a way to check if a listener's TLS cert is CA-verified. diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 3f16bfebe..9494e910a 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -270,7 +270,7 @@ void SpanningTreeUtilities::ReadConfiguration() L->Fingerprint = tag->getString("fingerprint"); L->HiddenFromStats = tag->getBool("statshidden"); L->Timeout = tag->getDuration("timeout", 30); - L->Hook = tag->getString("ssl"); + L->Hook = tag->getString("sslprofile"); L->Bind = tag->getString("bind"); L->Hidden = tag->getBool("hidden"); |
