diff options
| author | 2023-01-08 16:12:43 +0000 | |
|---|---|---|
| committer | 2023-01-08 16:28:40 +0000 | |
| commit | 8831595e1a5306f4204fedc6ecbc4a3c9299fb35 (patch) | |
| tree | f9f27322d35d199240dfeca82415ec94724f2ff9 /src/modules/m_sslinfo.cpp | |
| parent | Switch sqloper to use a local user lookup instead of IS_LOCAL. (diff) | |
Rework how users are assigned to connect classes.
- Move core connect class checks and <performance:clonesonconnect>
to the core_user module.
- Add pre-change and post-change events for when a connect class
changes.
- Split explicit class changing out into its own method.
- Remove the need to almost always call CheckClass after SetClass.
- Add use counting to the connect class instead of relying on the
shared_ptr use count.
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
| -rw-r--r-- | src/modules/m_sslinfo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 2d2db02f6..812962e83 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -384,17 +384,17 @@ public: user->WriteNotice(text); } - ModResult OnSetConnectClass(LocalUser* user, const ConnectClass::Ptr& myclass) override + ModResult OnPreChangeConnectClass(LocalUser* user, const std::shared_ptr<ConnectClass>& klass) override { ssl_cert* cert = cmd.sslapi.GetCertificate(user); const char* error = nullptr; - const std::string requiressl = myclass->config->getString("requiressl"); + const std::string requiressl = klass->config->getString("requiressl"); if (stdalgo::string::equalsci(requiressl, "trusted")) { if (!cert || !cert->IsCAVerified()) error = "a trusted TLS client certificate"; } - else if (myclass->config->getBool("requiressl")) + else if (klass->config->getBool("requiressl")) { if (!cert) error = "a TLS connection"; @@ -402,8 +402,8 @@ public: if (error) { - ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires %s", - myclass->GetName().c_str(), error); + ServerInstance->Logs.Debug("CONNECTCLASS", "The %s connect class is not suitable as it requires %s.", + klass->GetName().c_str(), error); return MOD_RES_DENY; } |
