evolution-data-server r8965 - branches/gnome-2-22/libedataserverui



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

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

	** Fix for bug #534946

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




Modified:
   branches/gnome-2-22/libedataserverui/ChangeLog
   branches/gnome-2-22/libedataserverui/e-passwords.c

Modified: branches/gnome-2-22/libedataserverui/e-passwords.c
==============================================================================
--- branches/gnome-2-22/libedataserverui/e-passwords.c	(original)
+++ branches/gnome-2-22/libedataserverui/e-passwords.c	Wed Jun 11 05:29:19 2008
@@ -106,6 +106,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;
 
@@ -837,6 +841,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;
@@ -1205,6 +1216,10 @@
 		key_file = g_key_file_new ();
 		ep_key_file_load ();
 	}
+#ifdef WITH_GNOME_KEYRING
+	if (gnome_keyring_is_available ())
+		gnome_keyring_get_default_keyring_sync (&default_keyring); 
+#endif
 
 	UNLOCK ();
 }
@@ -1243,6 +1258,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]