evolution-data-server r8966 - trunk/libedataserverui



Author: sragavan
Date: Wed Jun 11 05:33:39 2008
New Revision: 8966
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8966&view=rev

Log:
2008-06-11  Srinivasa Ragavan  <sragavan novell com>

	** Fix for bug #534946

	* e-passwords.c: (ep_get_password_keyring), (ep_ask_password),
	(e_passwords_shutdown):




Modified:
   trunk/libedataserverui/ChangeLog
   trunk/libedataserverui/e-passwords.c

Modified: trunk/libedataserverui/e-passwords.c
==============================================================================
--- trunk/libedataserverui/e-passwords.c	(original)
+++ trunk/libedataserverui/e-passwords.c	Wed Jun 11 05:33:39 2008
@@ -91,6 +91,10 @@
 static gint idle_id;
 static gint ep_online_state = TRUE;
 
+#ifdef WITH_GNOME_KEYRING
+static char *default_keyring = NULL;
+#endif
+
 #define KEY_FILE_GROUP_PREFIX "Passwords-"
 static GKeyFile *key_file = NULL;
 
@@ -811,6 +815,13 @@
 		while (iter != NULL) {
 			GnomeKeyringFound *found = iter->data;
 
+			if (default_keyring && strcmp(default_keyring, found->keyring) != 0) {
+				g_message ("Received a password from keyring '%s'. But looking for the password from '%s' keyring\n", found->keyring, default_keyring);
+				iter = g_list_next (iter);
+				continue;			
+			}
+				
+
 			if (ep_keyring_validate (uri->user, uri->host, uri->protocol, found->attributes)) {
 				msg->password = g_strdup (found->secret);
 				break;
@@ -1183,6 +1194,10 @@
 			GTK_TABLE (container), widget,
 			1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
 	}
+#ifdef WITH_GNOME_KEYRING
+	if (gnome_keyring_is_available ())
+		gnome_keyring_get_default_keyring_sync (&default_keyring); 
+#endif
 
 	msg->noreply = noreply;
 
@@ -1256,6 +1271,9 @@
 		g_hash_table_destroy (password_cache);
 		password_cache = NULL;
 	}
+#ifdef WITH_GNOME_KEYRING
+	g_free (default_keyring);
+#endif	
 }
 
 /**



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