aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_sasl.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-03-01 15:40:07 +0000
committerGravatar Sadie Powell2024-03-01 15:40:07 +0000
commit4b8e69882e8b591102bfb03da1425b04c43272de (patch)
tree577d22f1f3a7eceb367d89f6e0ca5d9c0837a474 /src/modules/m_sasl.cpp
parentRelease v4.0.0 alpha 25. (diff)
Add an option for opting-out of aborting incomplete authentication.
This goes against the expectations of the spec which can break some clients but also not doing this can break others. Blah.
Diffstat (limited to 'src/modules/m_sasl.cpp')
-rw-r--r--src/modules/m_sasl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index 61f529643..258c2f92e 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -409,6 +409,7 @@ private:
CommandAuthenticate auth;
CommandSASL sasl;
ClientProtocol::EventProvider protoev;
+ bool abortonconnect;
public:
ModuleSASL()
@@ -437,6 +438,7 @@ public:
if (target.empty())
throw ModuleException(this, "<sasl:target> must be set to the name of your services server!");
+ abortonconnect = tag->getBool("abortonconnect", true);
cap.requiressl = tag->getBool("requiressl");
sasl_target = target;
servertracker.Reset();
@@ -449,7 +451,7 @@ public:
// in progress, the server SHOULD abort it and send a 906 numeric, then
// register the client without authentication.
SaslAuthenticator* saslauth = authExt.Get(user);
- if (saslauth)
+ if (abortonconnect && saslauth)
{
saslauth->Abort();
saslauth->AnnounceState();