[gnome-keyring] gpg-agent: Don't barf when retrieving password when not unlocked



commit 63ea3bfaa8c15406790553c5cf7348d56e30f012
Author: Stef Walter <stefw gnome org>
Date:   Thu Jun 28 15:50:42 2012 +0200

    gpg-agent: Don't barf when retrieving password when not unlocked
    
     * Secret store returns CKR_USER_NOT_LOGGED_IN when password doesn't
       exist. Don't g_warning in that case

 daemon/gpg-agent/gkd-gpg-agent-ops.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gpg-agent/gkd-gpg-agent-ops.c b/daemon/gpg-agent/gkd-gpg-agent-ops.c
index a0e8731..be6c4d3 100644
--- a/daemon/gpg-agent/gkd-gpg-agent-ops.c
+++ b/daemon/gpg-agent/gkd-gpg-agent-ops.c
@@ -280,7 +280,8 @@ do_lookup_password (GckSession *session, const gchar *keyid)
 	for (l = objects; l; l = g_list_next (l)) {
 		data = gck_object_get_data_full (l->data, CKA_VALUE, egg_secure_realloc, NULL, &n_data, &error);
 		if (error) {
-			g_warning ("couldn't lookup gpg agent password: %s", egg_error_message (error));
+			if (!g_error_matches (error, GCK_ERROR, CKR_USER_NOT_LOGGED_IN))
+				g_warning ("couldn't lookup gpg agent password: %s", egg_error_message (error));
 			g_clear_error (&error);
 			data = NULL;
 		} else {



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