[gnome-keyring/gnome-3-0] pkcs11: Simulate a log out when application closes last session.



commit 5b3e79b3b2a06dbc6b65d9c2521209c51ed699c1
Author: Stef Walter <stefw collabora co uk>
Date:   Mon May 30 22:09:08 2011 +0200

    pkcs11: Simulate a log out when application closes last session.
    
     * After the last session is closed by an application, we should return
       to a logged out state.
     * Simulate that log out, if the application didn't do it explicitly.

 pkcs11/gkm/gkm-module.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/gkm/gkm-module.c b/pkcs11/gkm/gkm-module.c
index eecda2f..fa2c1b9 100644
--- a/pkcs11/gkm/gkm-module.c
+++ b/pkcs11/gkm/gkm-module.c
@@ -301,6 +301,20 @@ unregister_apartment (GkmModule *self, Apartment *apt)
 	g_assert (apt);
 	g_assert (GKM_IS_MODULE (self));
 
+	switch (apt->logged_in) {
+	case CKU_NONE:
+		break;
+	case CKU_USER:
+		gkm_module_logout_user (self, apt->apt_id);
+		break;
+	case CKU_SO:
+		gkm_module_logout_so (self, apt->apt_id);
+		break;
+	default:
+		g_return_if_reached ();
+		break;
+	}
+
 	if (!g_hash_table_remove (self->pv->apartments_by_id, &(apt->apt_id)))
 		g_assert_not_reached ();
 }



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