summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-07-31 22:16:28 +0100
committerPeter Powell <petpow@saberuk.com>2019-07-31 22:16:28 +0100
commitc6b5da1f6fdb1bc54ebe97ebe3666ad9ae85e99b (patch)
treed11d931f72e105e8cb5431e05ce23c9eb31fe46c
parent9acece70e533fc45d5401e331af25a5e99dab660 (diff)
Fix sasl hangs with clients that blindly request the capability.
-rw-r--r--src/modules/m_sasl.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index 0fb277b23..28bce2bf3 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -104,16 +104,15 @@ class SASLCap : public Cap::Capability
bool OnRequest(LocalUser* user, bool adding) CXX11_OVERRIDE
{
- // Requesting this cap is allowed anytime
- if (adding)
- return true;
-
- // But removing it can only be done when unregistered
- return (user->registered != REG_ALL);
+ // Servers MUST NAK any sasl capability request if the authentication layer
+ // is unavailable.
+ return servertracker.IsOnline();
}
bool OnList(LocalUser* user) CXX11_OVERRIDE
{
+ // Servers MUST NOT advertise the sasl capability if the authentication layer
+ // is unavailable.
return servertracker.IsOnline();
}