[evolution-ews/gnome-3-4] Bug #677398 - Can get stuck in e_book_backend_ews_authenticate_user()



commit 0cb2c55797be27a3990aaff9a0048b7610126dcb
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jun 4 18:25:38 2012 +0200

    Bug #677398 - Can get stuck in e_book_backend_ews_authenticate_user()

 src/addressbook/e-book-backend-ews.c |    6 ++++++
 src/calendar/e-cal-backend-ews.c     |    2 +-
 src/server/e-ews-connection.c        |    5 +++++
 3 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index b1b1496..82c99ff 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -2640,6 +2640,12 @@ e_book_backend_ews_authenticate_user (EBookBackend *backend,
 		return;
 	}
 
+	if (!credentials || !e_credentials_peek (credentials, E_CREDENTIALS_KEY_USERNAME)) {
+		e_book_backend_notify_opened (backend, EDB_ERROR (AUTHENTICATION_REQUIRED));
+		e_book_backend_notify_readonly (backend, TRUE);
+		return;
+	}
+
 	esource = e_backend_get_source (E_BACKEND (backend));
 	host_url = e_source_get_property (esource, "hosturl");
 	read_only = e_source_get_property (esource, "read_only");
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index a701ae0..f50b18d 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -686,7 +686,7 @@ e_cal_backend_ews_authenticate_user (ECalBackend *backend,
 
 	if (!credentials || !e_credentials_has_key (credentials, E_CREDENTIALS_KEY_USERNAME)) {
 		PRIV_UNLOCK (priv);
-		g_propagate_error (&error, EDC_ERROR (AuthenticationFailed));
+		g_propagate_error (&error, EDC_ERROR (AuthenticationRequired));
 		e_cal_backend_notify_opened (backend, error);
 		return;
 	}
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 6526b68..da3adeb 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -1210,6 +1210,11 @@ e_ews_connection_new (const gchar *uri,
 
 	g_static_mutex_lock (&connecting);
 
+	if (!username) {
+		g_static_mutex_unlock (&connecting);
+		return NULL;
+	}
+
 	/* search the connection in our hash table */
 	if (loaded_connections_permissions != NULL) {
 		hash_key = g_strdup_printf ("%s %s",



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