IMAP uses thread-unsafe NTLM authentication on the IMAP thread
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(Not tracked)
People
(Reporter: rkent, Unassigned)
References
Details
Comment 1•4 years ago
|
||
Are we still doing this wrong?
Comment 2•4 years ago
|
||
FWIW, haven't seen any bug reports for imap users logging in with NTLM. I assume one would need an Exchange server to test this?
Comment 3•4 years ago
|
||
I don't have an exchange server (or a windows build) to check on this, but tracing through the code by hand it does look like the nsIAuthModule functions (init() and getNextToken()) are being called from the IMAP thread.
I don't know the specifics on how M-C views accessing it's auth modules when not on main thread, but if the debug asserts in the original description are still happening, then that'd suggest M-C views it rather dimly :-)
The general flow of execution is:
nsIMapProtocol::ImapThreadMainLoop()
nsIMapProtocol::ProcessCurrentUrl()
nsIMapProtocol::TryToLogon()
nsIMapProtocol::AuthLogin()
nsMsgProtocol::DoNtlmStep1()/DoNtlmStep2()
nsIAuthModule.init()/getNextToken()
I guess the obvious simplest fix is to wrap the nsIAuthModule calls (in DoNtlmStepN()) with:
NS_DispatchToMainThread( ... , NS_DISPATCH_SYNC);
Looks like GSSAPI auth would also suffer from the same problem - it also use an nsIAuthModule.
(See nsMsgProtocol::DoGSSAPIStep1()/DoGSSAPIStep2()).
I think all the other IMAP auth implementations do their own thing.
It looks like the nsMsgProtocol NTLM and GSSAPI DoNtlm/GSSAPIStepN()
helper functions could be merged... (after all, they both use nsIAuthModule, which is supposed to magic away the details!)
Comment 4•3 years ago
|
||
It looks like the nsMsgProtocol NTLM and GSSAPI DoNtlm/GSSAPIStepN() helper functions could be merged... (after all, they both use nsIAuthModule, which is supposed to magic away the details!)
Should we do that first? In a separate bug?
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•10 months ago
|
Description
•