diff options
author | Peter Powell <petpow@saberuk.com> | 2019-07-31 22:16:28 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-07-31 22:16:28 +0100 |
commit | c6b5da1f6fdb1bc54ebe97ebe3666ad9ae85e99b (patch) | |
tree | d11d931f72e105e8cb5431e05ce23c9eb31fe46c /src/modules | |
parent | 9acece70e533fc45d5401e331af25a5e99dab660 (diff) |
Fix sasl hangs with clients that blindly request the capability.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_sasl.cpp | 11 |
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(); } |