mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
imapauth: Follow RFC more closely
The IMAP RFC allows the server to announce its capabilities before replying to
the LOGIN command. imapauth would misinterpret that as a failed login.
The fix is to only handle lines which contain the tag ("AUTH") used for the
login command.
Thanks to rlpowell for reporting that imapauth doesn't work against
imap.google.com and for testing the fix.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
@@ -134,7 +134,7 @@ void CIMAPSock::ReadLine(const CString& sLine) {
|
||||
}
|
||||
|
||||
Write("AUTH LOGIN " + sUsername + " " + m_spAuth->GetPassword() + "\r\n");
|
||||
} else {
|
||||
} else if (sLine.Left(5) == "AUTH ") {
|
||||
CUser* pUser = CZNC::Get().FindUser(m_spAuth->GetUsername());
|
||||
|
||||
if (pUser && sLine.Equals("AUTH OK", false, 7)) {
|
||||
|
||||
Reference in New Issue
Block a user