aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-10 06:00:53 +0800
committerDan Winship <danw@src.gnome.org>2000-06-10 06:00:53 +0800
commit2aefadf282648010e9403e4a7f643fe78dc6df53 (patch)
tree9bb5f4816da0d70674ae4e27cf0f131f9c94b466 /camel/providers
parentcd84bd758091a39792e13c46804b496ce34fd940 (diff)
downloadgsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.tar
gsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.tar.gz
gsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.tar.bz2
gsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.tar.lz
gsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.tar.xz
gsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.tar.zst
gsoc2013-evolution-2aefadf282648010e9403e4a7f643fe78dc6df53.zip
Add another argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or
* camel-session.c (camel_session_query_authenticator): Add another argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or CAMEL_AUTHENTICATOR_TELL, so callers can get the app to un-cache bad info. * providers/pop3/camel-pop3-store.c (pop3_connect): uncache the password if it doesn't work. svn path=/trunk/; revision=3496
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 9607d6723f..d82ef7b0b4 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -393,11 +393,10 @@ pop3_connect (CamelService *service, CamelException *ex)
char *prompt = g_strdup_printf ("Please enter the POP3 password for %s@%s",
service->url->user,
service->url->host);
- service->url->passwd =
- camel_session_query_authenticator (camel_service_get_session (service),
- prompt, TRUE,
- service, "password",
- ex);
+ service->url->passwd = camel_session_query_authenticator (
+ camel_service_get_session (service),
+ CAMEL_AUTHENTICATOR_ASK, prompt, TRUE,
+ service, "password", ex);
g_free (prompt);
if (!service->url->passwd) {
pop3_disconnect (service, ex);
@@ -415,7 +414,7 @@ pop3_connect (CamelService *service, CamelException *ex)
"server. Error sending username:"
" %s", msg ? msg : "(Unknown)");
g_free (msg);
- pop3_disconnect (service, ex);
+ goto lose;
}
g_free (msg);
@@ -440,8 +439,7 @@ pop3_connect (CamelService *service, CamelException *ex)
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
"No support for requested "
"authentication mechanism.");
- pop3_disconnect (service, ex);
- return FALSE;
+ goto lose;
}
if (status != CAMEL_POP3_OK) {
@@ -450,13 +448,21 @@ pop3_connect (CamelService *service, CamelException *ex)
"server. Error sending password:"
" %s", msg ? msg : "(Unknown)");
g_free (msg);
- pop3_disconnect (service, ex);
- return FALSE;
+ goto lose;
}
g_free (msg);
service_class->connect (service, ex);
return TRUE;
+
+ lose:
+ /* Uncache the password. */
+ camel_session_query_authenticator (camel_service_get_session (service),
+ CAMEL_AUTHENTICATOR_TELL, NULL,
+ TRUE, service, "password", ex);
+
+ pop3_disconnect (service, ex);
+ return FALSE;
}
static gboolean