gnome-keyring/gnome-keyring-2.20-no-unset-default.patch
Alexander Larsson 943ca97c72 - Backport fix from svn where newly created keyrings weren't found
- Don't unset default keyring on daemon shutdown
2007-10-03 14:04:37 +00:00

92 lines
3.1 KiB
Diff

diff -ur gnome-keyring-2.20.orig/daemon/gkr-daemon-ops.c gnome-keyring-2.20/daemon/gkr-daemon-ops.c
--- gnome-keyring-2.20.orig/daemon/gkr-daemon-ops.c 2007-10-03 15:01:34.000000000 +0200
+++ gnome-keyring-2.20/daemon/gkr-daemon-ops.c 2007-10-03 15:01:48.000000000 +0200
@@ -1136,7 +1136,7 @@
g_free (keyring_name);
if (res == GNOME_KEYRING_RESULT_OK)
- gkr_keyrings_remove (keyring);
+ gkr_keyrings_remove (keyring, TRUE);
return TRUE;
}
Only in gnome-keyring-2.20/daemon: gkr-daemon-ops.c.orig
diff -ur gnome-keyring-2.20.orig/keyrings/gkr-keyring.c gnome-keyring-2.20/keyrings/gkr-keyring.c
--- gnome-keyring-2.20.orig/keyrings/gkr-keyring.c 2007-10-03 15:01:34.000000000 +0200
+++ gnome-keyring-2.20/keyrings/gkr-keyring.c 2007-10-03 15:01:48.000000000 +0200
@@ -1211,7 +1211,7 @@
if (!gkr_keyring_update_from_disk (keyring, TRUE)) {
/* Failed to re-read, remove the keyring */
g_warning ("Couldn't re-read keyring %s\n", keyring->keyring_name);
- gkr_keyrings_remove (keyring);
+ gkr_keyrings_remove (keyring, TRUE);
}
return TRUE;
diff -ur gnome-keyring-2.20.orig/keyrings/gkr-keyrings.c gnome-keyring-2.20/keyrings/gkr-keyrings.c
--- gnome-keyring-2.20.orig/keyrings/gkr-keyrings.c 2007-10-03 15:01:34.000000000 +0200
+++ gnome-keyring-2.20/keyrings/gkr-keyrings.c 2007-10-03 15:01:48.000000000 +0200
@@ -235,7 +235,7 @@
/* Try and update/load it */
if (!gkr_keyring_update_from_disk (keyring, FALSE) ||
!keyring->keyring_name || !keyring->keyring_name[0]) {
- gkr_keyrings_remove (keyring);
+ gkr_keyrings_remove (keyring, TRUE);
}
}
@@ -257,7 +257,7 @@
keyring = GKR_KEYRING (keyrings->data);
if (keyring == session_keyring)
session_keyring = NULL;
- gkr_keyrings_remove (keyring);
+ gkr_keyrings_remove (keyring, FALSE);
}
g_free (default_keyring);
@@ -411,7 +411,7 @@
if (!keyring->location)
continue;
if (g_hash_table_lookup (checks, GUINT_TO_POINTER (keyring->location)))
- gkr_keyrings_remove (keyring);
+ gkr_keyrings_remove (keyring, TRUE);
}
g_hash_table_destroy (checks);
@@ -434,15 +434,19 @@
}
void
-gkr_keyrings_remove (GkrKeyring *keyring)
+gkr_keyrings_remove (GkrKeyring *keyring,
+ gboolean unset_if_default)
{
keyrings_init ();
-
+
g_assert (GKR_IS_KEYRING (keyring));
+
+
if (g_list_find (keyrings, keyring)) {
- if (default_keyring &&
+ if (unset_if_default &&
+ default_keyring &&
strcmp (keyring->keyring_name, default_keyring) == 0)
gkr_keyrings_set_default (NULL);
diff -ur gnome-keyring-2.20.orig/keyrings/gkr-keyrings.h gnome-keyring-2.20/keyrings/gkr-keyrings.h
--- gnome-keyring-2.20.orig/keyrings/gkr-keyrings.h 2007-10-03 15:01:34.000000000 +0200
+++ gnome-keyring-2.20/keyrings/gkr-keyrings.h 2007-10-03 15:01:48.000000000 +0200
@@ -36,7 +36,8 @@
void gkr_keyrings_add (GkrKeyring *keyring);
-void gkr_keyrings_remove (GkrKeyring *keyring);
+void gkr_keyrings_remove (GkrKeyring *keyring,
+ gboolean unset_if_default);
GkrKeyring* gkr_keyrings_find (const gchar *name);