X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fauth.c;h=8b328078a86a4f9c8d74ba28f79f59e931a2ab6c;hb=8e689b28eefc1a93797f299c33f7ec3e2e340329;hp=6f000add8c57c229f65ee2ea6f6b16fb93e6c982;hpb=492434e350e3ca2d3330c2589de3f9485929dab7;p=apps%2Fmadmutt.git diff --git a/imap/auth.c b/imap/auth.c index 6f000ad..8b32807 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -11,33 +11,16 @@ /* IMAP login/authentication code */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include "lib/mem.h" -#include "lib/intl.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 @@ -52,7 +35,7 @@ int imap_authenticate (IMAP_DATA * idata) if (ImapAuthenticators && *ImapAuthenticators) { /* Try user-specified list of authentication methods */ - methods = safe_strdup (ImapAuthenticators); + methods = m_strdup(ImapAuthenticators); for (method = methods; method; method = delim) { delim = strchr (method, ':'); @@ -61,8 +44,6 @@ int imap_authenticate (IMAP_DATA * idata) if (!method[0]) continue; - dprint (2, - (debugfile, "imap_authenticate: 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,12 +59,10 @@ int imap_authenticate (IMAP_DATA * idata) } } - FREE (&methods); + p_delete(&methods); } else { /* Fall back to default: any authenticator */ - dprint (2, - (debugfile, "imap_authenticate: Using any available method.\n")); authenticator = imap_authenticators; while (authenticator->authenticate) {