soc.2008.masterpassword: 51374917: Don't allow unloading a plugin if its ke...

qulogic at pidgin.im qulogic at pidgin.im
Fri Feb 3 01:56:06 EST 2012


----------------------------------------------------------------------
Revision: 5137491777eedb18bf61e2165b582b9dfea14c92
Parent:   8b028116f18a48b4ef3385d09d5d114026811358
Author:   qulogic at pidgin.im
Date:     01/28/12 00:43:02
Branch:   im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/5137491777eedb18bf61e2165b582b9dfea14c92

Changelog: 

Don't allow unloading a plugin if its keyring is active.

Changes against parent 8b028116f18a48b4ef3385d09d5d114026811358

  patched  libpurple/plugins/keyrings/gnomekeyring.c
  patched  libpurple/plugins/keyrings/internalkeyring.c
  patched  libpurple/plugins/keyrings/kwallet.cpp

-------------- next part --------------
============================================================
--- libpurple/plugins/keyrings/gnomekeyring.c	9cec2f6be740b3dff0bc3328b521620a32917d9f
+++ libpurple/plugins/keyrings/gnomekeyring.c	387ce07e4dca816b9f154cb549e03d0e43083d0d
@@ -4,7 +4,6 @@
  *
  * @todo
  *   cleanup error handling and reporting
- *   refuse unloading when active (in internal keyring too)
  */
 
 /* purple
@@ -347,7 +346,11 @@ gkp_unload(PurplePlugin *plugin)
 static gboolean
 gkp_unload(PurplePlugin *plugin)
 {
+	if (purple_keyring_get_inuse() == keyring_handler)
+		return FALSE;
+
 	gkp_uninit();
+
 	return TRUE;
 }
 
============================================================
--- libpurple/plugins/keyrings/internalkeyring.c	bda04c3a49c1a0843a927ae132d54deb18862528
+++ libpurple/plugins/keyrings/internalkeyring.c	e08472c31ab1904aaed827f9771526c8f2e4fd95
@@ -211,6 +211,9 @@ internal_keyring_unload(PurplePlugin *pl
 static gboolean
 internal_keyring_unload(PurplePlugin *plugin)
 {
+	if (purple_keyring_get_inuse() == keyring_handler)
+		return FALSE;
+
 	internal_keyring_uninit();
 
 	purple_keyring_free(keyring_handler);
============================================================
--- libpurple/plugins/keyrings/kwallet.cpp	132f1bbe6bce9a6952efbd290e67d23da2728920
+++ libpurple/plugins/keyrings/kwallet.cpp	b9cd47e119d2bb255de663900016fa169d41dca2
@@ -4,7 +4,6 @@
  *
  * @todo
  *   cleanup error handling and reporting
- *   refuse unloading when active (in internal keyring too)
  */
 
 /* purple
@@ -350,7 +349,11 @@ kwallet_unload(PurplePlugin *plugin)
 static gboolean
 kwallet_unload(PurplePlugin *plugin)
 {
+	if (purple_keyring_get_inuse() == keyring_handler)
+		return FALSE;
+
 	kwallet_close(NULL);
+
 	return TRUE;
 }
 


More information about the Commits mailing list