X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fauth.c;h=d4b4efd5f9d7d4f62942bfe1376fb98a7293619d;hp=4e30c9c6a78a2fd67c9532f2eb188a88181c05ec;hb=23e6291cb5d5b4cd2008403d8b628007fd75ff23;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/imap/auth.c b/imap/auth.c index 4e30c9c..d4b4efd 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -1,21 +1,12 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996-8 Michael R. Elkins * Copyright (C) 1996-9 Brandon Long * Copyright (C) 1999-2001 Brendan Cully - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ /* IMAP login/authentication code */ @@ -24,6 +15,11 @@ # include "config.h" #endif +#include + +#include +#include + #include "mutt.h" #include "imap_private.h" #include "auth.h" @@ -43,7 +39,7 @@ static imap_auth_t imap_authenticators[] = { #endif {imap_auth_login, "login"}, - {NULL} + {NULL, NULL} }; /* imap_authenticate: Attempt to authenticate using either user-specified @@ -58,7 +54,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, ':'); @@ -67,8 +63,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) { @@ -76,7 +70,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; } @@ -84,12 +78,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) {