gnome-keyring/gnome-keyring-2.30.0-unlocking-when-unavailable.patch
Tomas Bzatek 9db95ed3a2 - More robust error display and handling
- [secret-store] Don't save session keyring to disk
- [dbus] Allow unlocking even when always unlock is not available
- [dbus] Hide the automatically unlock check when login not usable
- [login] Fix various issues storing and using auto unlock passwords
2010-03-22 14:00:10 +00:00

53 lines
2.0 KiB
Diff

From e43a24701767d1a8fd72f2f3ed01fe0937364b6d Mon Sep 17 00:00:00 2001
From: Stef Walter <stef@memberwebs.com>
Date: Sun, 21 Mar 2010 14:06:43 +0000
Subject: [dbus] Allow unlocking even when always unlock is not available.
When the Always Unlock option could not work (due to a missing or
locked login keyring) unlocking a keyring fail when that option
was selected.
Fixes bug #610998
---
diff --git a/daemon/dbus/gkd-secret-unlock.c b/daemon/dbus/gkd-secret-unlock.c
index ee17fd1..52e4978 100644
--- a/daemon/dbus/gkd-secret-unlock.c
+++ b/daemon/dbus/gkd-secret-unlock.c
@@ -271,8 +271,9 @@ attach_credential_to_login (GP11Object *collection, GP11Object *cred)
egg_secure_free (value);
} else {
- g_warning ("couldn't read unlock credentials to save in login keyring: %s",
- egg_error_message (error));
+ if (!g_error_matches (error, GP11_ERROR, CKR_USER_NOT_LOGGED_IN))
+ g_warning ("couldn't read unlock credentials to save in login keyring: %s",
+ egg_error_message (error));
g_clear_error (&error);
}
@@ -295,6 +296,7 @@ authenticate_collection (GkdSecretUnlock *self, GP11Object *collection, gboolean
DBusError derr = DBUS_ERROR_INIT;
GkdSecretSecret *master;
GP11Attributes *template;
+ GP11Attribute *attr;
GP11Object *cred;
gboolean transient;
@@ -321,8 +323,12 @@ authenticate_collection (GkdSecretUnlock *self, GP11Object *collection, gboolean
gkd_prompt_get_unlock_options (GKD_PROMPT (self), template);
/* If it's supposed to save non-transient, then we override that */
- if (!gp11_attributes_find_boolean (template, CKA_GNOME_TRANSIENT, &transient))
- transient = TRUE;
+ attr = gp11_attributes_find (template, CKA_GNOME_TRANSIENT);
+ if (attr != NULL) {
+ transient = gp11_attribute_get_boolean (attr);
+ gp11_attribute_clear (attr);
+ gp11_attribute_init_boolean (attr, CKA_GNOME_TRANSIENT, TRUE);
+ }
cred = gkd_secret_session_create_credential (master->session, NULL, template, master, &derr);
gkd_secret_secret_free (master);
--
cgit v0.8.3.1