From 6ae79027cf27507f0c637ced1c645facaec8bacb Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 3 Aug 2010 21:46:15 -0400 Subject: Fix m_opermodes.so sending modes for unintroduced clients with oper autologin (bug 53) --- src/modules/m_sslinfo.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index e27161dac..7354b16f7 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -130,8 +130,8 @@ class ModuleSSLInfo : public Module ServerInstance->Extensions.Register(&cmd.CertExt); - Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass, I_OnUserConnect }; - ServerInstance->Modules->Attach(eventlist, this, 4); + Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass, I_OnUserConnect, I_OnPostConnect }; + ServerInstance->Modules->Attach(eventlist, this, 5); } Version GetVersion() @@ -205,14 +205,19 @@ class ModuleSSLInfo : public Module if (!req.cert) return; cmd.CertExt.set(user, req.cert); - if (req.cert->fingerprint.empty()) + } + + void OnPostConnect(User* user) + { + ssl_cert *cert = cmd.CertExt.get(user); + if (!cert || cert->fingerprint.empty()) return; // find an auto-oper block for this user for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++) { OperInfo* ifo = i->second; std::string fp = ifo->oper_block->getString("fingerprint"); - if (fp == req.cert->fingerprint && ifo->oper_block->getBool("autologin")) + if (fp == cert->fingerprint && ifo->oper_block->getBool("autologin")) user->Oper(ifo); } } -- cgit v1.2.3