From ba1efa77c3a2af31287a6050bf30285ef701216c Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 10 May 2015 00:37:28 +0200 Subject: m_ssl_gnutls Hold users in pre-registration state until the handshake is completed --- src/modules/extra/m_ssl_gnutls.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 3b67a6180..59ac1acb3 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -316,7 +316,7 @@ class ModuleSSLGnuTLS : public Module ServerInstance->GenRandom = &randhandler; Implementation eventlist[] = { I_On005Numeric, I_OnRehash, I_OnModuleRehash, I_OnUserConnect, - I_OnEvent, I_OnHookIO }; + I_OnEvent, I_OnHookIO, I_OnCheckReady }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); ServerInstance->Modules->AddService(iohook); @@ -974,6 +974,13 @@ info_done_dealloc: if (starttls.enabled) capHandler.HandleEvent(ev); } + + ModResult OnCheckReady(LocalUser* user) + { + if ((user->eh.GetIOHook() == this) && (sessions[user->eh.GetFd()].status != ISSL_HANDSHAKEN)) + return MOD_RES_DENY; + return MOD_RES_PASSTHRU; + } }; MODULE_INIT(ModuleSSLGnuTLS) -- cgit v1.2.3 From 15b0a1853d2912ae10d218b00c2e6f175bb5ae30 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 28 Apr 2015 20:22:34 +0100 Subject: Fix not being able to message ulines when m_restrictmsg is loaded. --- docs/conf/modules.conf.example | 3 +++ src/modules/m_restrictmsg.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 71a0fb079..32701f0c4 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1486,6 +1486,9 @@ # You probably *DO NOT* want to load this module on a public network. # # +# +# Uncomment this to allow users to message ulines (e.g. services): +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # R-Line module: Ban users through regular expression patterns. diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index e814f3b16..2a9f1dc93 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -26,15 +26,22 @@ class ModuleRestrictMsg : public Module { + private: + bool uline; public: void init() { - Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice }; + OnRehash(NULL); + Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } + void OnRehash(User*) + { + uline = ServerInstance->Config->ConfValue("restrictmsg")->getBool("uline", false); + } virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) { @@ -45,8 +52,9 @@ class ModuleRestrictMsg : public Module // message allowed if: // (1) the sender is opered // (2) the recipient is opered + // (3) the recipient is on a ulined server // anything else, blocked. - if (IS_OPER(u) || IS_OPER(user)) + if (IS_OPER(u) || IS_OPER(user) || (uline && ServerInstance->ULine(u->server))) { return MOD_RES_PASSTHRU; } -- cgit v1.2.3 From 819d9bade20c5f6f2ea688e337be4844183f4528 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 10 May 2015 07:24:10 +0200 Subject: Release v2.0.20 --- src/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.sh b/src/version.sh index 01c651a29..8686e33ae 100755 --- a/src/version.sh +++ b/src/version.sh @@ -1,2 +1,2 @@ #!/bin/sh -echo "InspIRCd-2.0.19" +echo "InspIRCd-2.0.20" -- cgit v1.2.3