[evolution-data-server] [CalDAV] Force password ask on soup authenticate failure



commit 751b1c07f639e25b1d136fdbe1094bad96833817
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 20 19:12:33 2014 +0100

    [CalDAV] Force password ask on soup authenticate failure
    
    Some servers may allow OPTIONS request on authenticated account with
    a wrong password, but fail on REPORT and other queries, which makes
    the calendar open routine not recognize the wrong password case.

 calendar/backends/caldav/e-cal-backend-caldav.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index 02961ed..dd3c394 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -99,6 +99,7 @@ struct _ECalBackendCalDAVPrivate {
        /* Authentication info */
        gchar *password;
        gboolean auth_required;
+       gboolean force_ask_password;
 
        /* support for 'getctag' extension */
        gboolean ctag_supported;
@@ -1030,8 +1031,10 @@ soup_authenticate (SoupSession *session,
        extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
        auth_extension = e_source_get_extension (source, extension_name);
 
-       if (retrying)
+       if (retrying || cbdav->priv->force_ask_password) {
+               cbdav->priv->force_ask_password = TRUE;
                return;
+       }
 
        if (E_IS_SOUP_AUTH_BEARER (auth)) {
                soup_authenticate_bearer (session, msg, auth, cbdav);
@@ -5169,6 +5172,11 @@ caldav_try_password_sync (ESourceAuthenticator *authenticator,
 
        /* Busy lock is already acquired by caldav_do_open(). */
 
+       if (cbdav->priv->force_ask_password) {
+               cbdav->priv->force_ask_password = FALSE;
+               return E_SOURCE_AUTHENTICATION_REJECTED;
+       }
+
        g_free (cbdav->priv->password);
        cbdav->priv->password = g_strdup (password->str);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]