kov changed libgksu/trunk/ChangeLog, libgksu/trunk/libgksu/libgksu.c

Gustavo Noronha kov at alioth.debian.org
Tue Mar 6 11:39:19 CET 2007


Mensagem de log: 
always try to create the keyring when setting the password;
if the keyring exists this is a no-op, so no problems
(Addressing Debian Bug #412681)


-----


Modified: libgksu/trunk/ChangeLog
===================================================================
--- libgksu/trunk/ChangeLog	2007-03-06 10:35:50 UTC (rev 783)
+++ libgksu/trunk/ChangeLog	2007-03-06 10:39:19 UTC (rev 784)
@@ -1,6 +1,11 @@
 2007-03-06  Gustavo Noronha Silva  <kov at debian.org>
 
 	* libgksu/libgksu.c:
+	- always try to create the keyring when setting the password;
+	  if the keyring exists this is a no-op, so no problems
+	  (Addressing Debian Bug #412681)
+
+	* libgksu/libgksu.c:
 	- improved debugging for getting the password from the
 	  GNOME Keyring; and do not show the password anymore when
 	  debugging

Modified: libgksu/trunk/libgksu/libgksu.c
===================================================================
--- libgksu/trunk/libgksu/libgksu.c	2007-03-06 10:35:50 UTC (rev 783)
+++ libgksu/trunk/libgksu/libgksu.c	2007-03-06 10:39:19 UTC (rev 784)
@@ -648,7 +648,7 @@
   gnome_keyring_attribute_list_free (attributes);
   if (
       (result == GNOME_KEYRING_RESULT_OK) &&
-      (g_list_length(list) == 1)
+      (g_list_length(list) >= 1)
       )
     {
       GnomeKeyringFound *found = list->data;
@@ -689,6 +689,7 @@
       static GMainLoop *keyring_loop = NULL;
       GnomeKeyringAttributeList *attributes;
       GnomeKeyringAttribute attribute;
+      GnomeKeyringResult result;
 
       gchar *keyring_name;
       gchar *key_name;
@@ -718,6 +719,14 @@
       keyring_name = gconf_client_get_string (gconf_client, BASE_PATH"save-keyring", NULL);
       if (keyring_name == NULL)
 	keyring_name = g_strdup ("session");
+
+      /* make sure the keyring exists; if an error occurs, use
+         the session keyring */
+      result = gnome_keyring_create_sync(keyring_name, NULL);
+      if ((result != GNOME_KEYRING_RESULT_OK) &&
+	  (result != GNOME_KEYRING_RESULT_ALREADY_EXISTS))
+	keyring_name = g_strdup ("session");
+
       gnome_keyring_item_create (keyring_name,
 				 GNOME_KEYRING_ITEM_GENERIC_SECRET,
 				 key_name,




More information about the gksu-commits mailing list