diff options
| author | 2021-07-01 12:33:51 +0100 | |
|---|---|---|
| committer | 2021-07-01 12:33:51 +0100 | |
| commit | d95d7fc4f574b4ce3593b6684dd9fd738c40fcab (patch) | |
| tree | 88bc789896945fac5b82bc19dd4b8e440e590da6 /src/modules/m_sslinfo.cpp | |
| parent | Require that hideserver is set to a valid hostname. (diff) | |
| parent | Allow reloading SSL profiles on rehash. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
| -rw-r--r-- | src/modules/m_sslinfo.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index b83860166..c4d426241 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -385,7 +385,23 @@ class ModuleSSLInfo for (const auto& [_, ifo] : ServerInstance->Config->oper_blocks) { std::string fp = ifo->oper_block->getString("fingerprint"); - if (MatchFP(cert, fp) && ifo->oper_block->getBool("autologin")) + if (!MatchFP(cert, fp)) + continue; + + bool do_login = false; + const std::string autologin = ifo->oper_block->getString("autologin"); + if (stdalgo::string::equalsci(autologin, "if-host-match")) + { + const std::string& userHost = localuser->MakeHost(); + const std::string& userIP = localuser->MakeHostIP(); + do_login = InspIRCd::MatchMask(ifo->oper_block->getString("host"), userHost, userIP); + } + else if (ifo->oper_block->getBool("autologin")) + { + do_login = true; + } + + if (do_login) user->Oper(ifo); } } |
