/cpw/tomkiewicz/masterpassword: 96fcf3176777: Set new keyring in...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sat Mar 23 12:45:55 EDT 2013


Changeset: 96fcf31767777d44eab747939fa8e248d08421f6
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-03-23 17:45 +0100
Branch:	 soc.2008.masterpassword
URL: https://hg.pidgin.im/cpw/tomkiewicz/masterpassword/rev/96fcf3176777

Description:

Set new keyring in use after successful password migration

diffstat:

 libpurple/keyring.c                    |  8 +++-----
 libpurple/plugins/keyrings/kwallet.cpp |  1 -
 2 files changed, 3 insertions(+), 6 deletions(-)

diffs (57 lines):

diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -470,7 +470,6 @@ purple_keyring_set_inuse_check_error_cb(
 			purple_debug_error("keyring",
 				"Failed to change keyring, aborting.\n");
 
-			purple_keyring_inuse = tracker->old;
 			purple_prefs_disconnect_callback(purple_keyring_pref_cb_id);
 			purple_prefs_set_string("/purple/keyring/active",
 				purple_keyring_get_id(tracker->old));
@@ -490,6 +489,7 @@ purple_keyring_set_inuse_check_error_cb(
 
 			purple_debug_info("keyring", "Successfully changed keyring.\n");
 
+			purple_keyring_inuse = tracker->new;
 			purple_keyring_inuse_under_change = FALSE;
 
 			if (tracker->cb != NULL)
@@ -627,8 +627,6 @@ purple_keyring_set_inuse(const PurpleKey
 
 			tracker = g_new(PurpleKeyringChangeTracker, 1);
 
-			purple_keyring_inuse = newkeyring;
-
 			tracker->cb = cb;
 			tracker->data = data;
 			tracker->new = newkeyring;
@@ -993,7 +991,7 @@ purple_keyring_set_password(PurpleAccoun
 
 	g_return_if_fail(account != NULL);
 
-	inuse = purple_keyring_get_inuse();
+	inuse = purple_keyring_get_inuse(); /* TODO: if in change, don't save */
 	if (inuse == NULL) {
 		error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOKEYRING,
 			"No keyring configured.");
@@ -1054,7 +1052,7 @@ purple_keyring_change_master(PurpleKeyri
 	PurpleKeyringChangeMaster change;
 	const PurpleKeyring *inuse;
 
-	inuse = purple_keyring_get_inuse();
+	inuse = purple_keyring_get_inuse(); /* TODO: if in change, don't mess */
 
 	if (inuse == NULL) {
 		error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOKEYRING,
diff --git a/libpurple/plugins/keyrings/kwallet.cpp b/libpurple/plugins/keyrings/kwallet.cpp
--- a/libpurple/plugins/keyrings/kwallet.cpp
+++ b/libpurple/plugins/keyrings/kwallet.cpp
@@ -489,7 +489,6 @@ kwallet_load(PurplePlugin *plugin)
 	purple_keyring_set_read_password(keyring_handler, kwallet_read);
 	purple_keyring_set_save_password(keyring_handler, kwallet_save);
 	purple_keyring_set_close_keyring(keyring_handler, kwallet_close);
-	/* purple_keyring_set_change_master */
 	purple_keyring_set_import_password(keyring_handler, kwallet_import);
 	purple_keyring_set_export_password(keyring_handler, kwallet_export);
 



More information about the Commits mailing list