From: Brendan Cully Date: Tue, 21 Nov 2006 03:06:03 +0000 (+0000) Subject: If a method list has been given, fall back to the next authenticator X-Git-Tag: mutt-1-5-14-rel~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0803f75fab03f3a925f04a953e02f7375172f2e5;p=mutt If a method list has been given, fall back to the next authenticator whenever an attempt returns NO or BAD. --- diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 38a801a9..99ea3ede 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -118,13 +118,6 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) irc = imap_cmd_step (idata); while (irc == IMAP_CMD_CONTINUE); - if (method && irc == IMAP_CMD_NO) - { - dprint (2, (debugfile, "imap_auth_sasl: %s failed\n", method)); - sasl_dispose (&saslconn); - return IMAP_AUTH_UNAVAIL; - } - if (irc == IMAP_CMD_BAD || irc == IMAP_CMD_NO) goto bail; @@ -200,9 +193,16 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) } bail: + sasl_dispose (&saslconn); + + if (method) + { + dprint (2, (debugfile, "imap_auth_sasl: %s failed\n", method)); + return IMAP_AUTH_UNAVAIL; + } + mutt_error _("SASL authentication failed."); mutt_sleep(2); - sasl_dispose (&saslconn); return IMAP_AUTH_FAILURE; }