]> jfr.im git - irc/evilnet/znc.git/commitdiff
sasl: Make the first requirement for SET actually mandatory, return information about...
authorJos Ahrens <redacted>
Sat, 5 Nov 2016 17:58:36 +0000 (17:58 +0000)
committerAlexey Sokolov <redacted>
Sat, 12 Nov 2016 14:38:35 +0000 (14:38 +0000)
modules/sasl.cpp

index 941e9f667040ce3d05a97a5131ef0b5fda0766c8..c2ded3096d73ada52b1e720e6fbd3e7b57a68f29 100644 (file)
@@ -101,6 +101,15 @@ class CSASLMod : public CModule {
     }
 
     void Set(const CString& sLine) {
+        if (sLine.Token(1).empty()) {
+            CString sUsername = GetNV("username");
+            CString sPassword = GetNV("password");
+
+            PutModule("Username is currently " + (sUsername.empty() ? "not set" : "set to '" + sUsername + "'") +
+                      ", a password was " + (sPassword.empty() ? "not " : "") + "supplied.");
+            return;
+        }
+
         SetNV("username", sLine.Token(1));
         SetNV("password", sLine.Token(2));