[gnome-keyring] dbus: Don't log into token if already logged in



commit 66eef08df67047f70678764a223ae4d42a9708f3
Author: Stef Walter <stefw gnome org>
Date:   Thu Jun 28 13:25:29 2012 +0200

    dbus: Don't log into token if already logged in

 daemon/dbus/gkd-secret-service.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-service.c b/daemon/dbus/gkd-secret-service.c
index 6beb3cb..5efd66e 100644
--- a/daemon/dbus/gkd-secret-service.c
+++ b/daemon/dbus/gkd-secret-service.c
@@ -1302,6 +1302,7 @@ gkd_secret_service_get_pkcs11_slot (GkdSecretService *self)
 static gboolean
 log_into_pkcs11_session (GckSession *session, GError **error)
 {
+	GckSessionInfo *sess;
 	GckTokenInfo *info;
 	GckSlot *slot;
 	gboolean login;
@@ -1313,6 +1314,14 @@ log_into_pkcs11_session (GckSession *session, GError **error)
 	gck_token_info_free (info);
 	g_object_unref (slot);
 
+	if (login) {
+		sess = gck_session_get_info (session);
+		if (sess->state == CKS_RO_USER_FUNCTIONS ||
+		    sess->state == CKS_RW_USER_FUNCTIONS)
+			login = FALSE;
+		gck_session_info_free (sess);
+	}
+
 	if (login && !gck_session_login (session, CKU_USER, NULL, 0, NULL, error))
 		return FALSE;
 



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