X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fauth.c;h=8b328078a86a4f9c8d74ba28f79f59e931a2ab6c;hp=f5af43f9726dac031a76de6b65b92a2555ce885e;hb=8e689b28eefc1a93797f299c33f7ec3e2e340329;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d;ds=sidebyside diff --git a/imap/auth.c b/imap/auth.c index f5af43f..8b32807 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -11,34 +11,16 @@ /* IMAP login/authentication code */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include "lib/mem.h" -#include "lib/intl.h" -#include "lib/debug.h" +#include #include "mutt.h" #include "imap_private.h" #include "auth.h" static imap_auth_t imap_authenticators[] = { -#ifdef USE_SASL {imap_auth_sasl, NULL}, -#else - {imap_auth_anon, "anonymous"}, -#endif -#ifdef USE_GSS - {imap_auth_gss, "gssapi"}, -#endif - /* SASL includes CRAM-MD5 (and GSSAPI, but that's not enabled by default) */ -#ifndef USE_SASL - {imap_auth_cram_md5, "cram-md5"}, -#endif {imap_auth_login, "login"}, - - {NULL} + {NULL, NULL} }; /* imap_authenticate: Attempt to authenticate using either user-specified @@ -53,7 +35,7 @@ int imap_authenticate (IMAP_DATA * idata) if (ImapAuthenticators && *ImapAuthenticators) { /* Try user-specified list of authentication methods */ - methods = str_dup (ImapAuthenticators); + methods = m_strdup(ImapAuthenticators); for (method = methods; method; method = delim) { delim = strchr (method, ':'); @@ -62,7 +44,6 @@ int imap_authenticate (IMAP_DATA * idata) if (!method[0]) continue; - debug_print (2, ("Trying method %s\n", method)); authenticator = imap_authenticators; while (authenticator->authenticate) { @@ -70,7 +51,7 @@ int imap_authenticate (IMAP_DATA * idata) !ascii_strcasecmp (authenticator->method, method)) if ((r = authenticator->authenticate (idata, method)) != IMAP_AUTH_UNAVAIL) { - FREE (&methods); + p_delete(&methods); return r; } @@ -78,11 +59,10 @@ int imap_authenticate (IMAP_DATA * idata) } } - FREE (&methods); + p_delete(&methods); } else { /* Fall back to default: any authenticator */ - debug_print (2, ("Using any available method.\n")); authenticator = imap_authenticators; while (authenticator->authenticate) {