[evolution-ews/gnome-3-8] Bug 703181 — Asked for pa ssword which is never used



commit 2c1dbe742faf9e4231ca3376066b18c3f7e427be
Author: David Woodhouse <David Woodhouse intel com>
Date:   Mon Jul 15 10:05:11 2013 +0100

    Bug 703181 — Asked for password which is never used
    
    This isn't a complete fix, but it's a step in the right direction…
    
    (cherry picked from commit 27f206674f9df60bb8d6ab1c3036dd0d76420c4d)

 src/camel/camel-ews-store.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/camel/camel-ews-store.c b/src/camel/camel-ews-store.c
index e87227c..38d4e5b 100644
--- a/src/camel/camel-ews-store.c
+++ b/src/camel/camel-ews-store.c
@@ -496,6 +496,8 @@ ews_connect_sync (CamelService *service,
        EEwsConnection *connection;
        CamelEwsStore *ews_store;
        CamelSession *session;
+       CamelSettings *settings;
+       gchar *auth_mech;
        gboolean success;
 
        ews_store = CAMEL_EWS_STORE (service);
@@ -510,11 +512,17 @@ ews_connect_sync (CamelService *service,
        }
 
        session = camel_service_ref_session (service);
+       settings = camel_service_ref_settings (service);
 
        /* Try running an operation that requires authentication
-        * to make sure we have a valid password available. */
+        * to make sure we have valid credentials available. */
+       auth_mech = camel_network_settings_dup_auth_mechanism (
+                                      CAMEL_NETWORK_SETTINGS (settings));
        success = camel_session_authenticate_sync (
-               session, service, NULL, cancellable, error);
+                  session, service, auth_mech?:"NTLM", cancellable, error);
+
+       g_free (auth_mech);
+       g_object_unref (settings);
 
        g_object_unref (session);
 
@@ -966,14 +974,6 @@ ews_authenticate_sync (CamelService *service,
 
        password = camel_service_get_password (service);
 
-       if (password == NULL) {
-               g_set_error_literal (
-                       error, CAMEL_SERVICE_ERROR,
-                       CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
-                       _("Authentication password not available"));
-               return CAMEL_AUTHENTICATION_ERROR;
-       }
-
        settings = camel_service_ref_settings (service);
 
        ews_settings = CAMEL_EWS_SETTINGS (settings);


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