telepathy-mission-control: Default account backend: when deleting passwords , delete the same thing we will look for

Simon McVittie smcv at kemper.freedesktop.org
Fri Aug 31 07:27:01 PDT 2012


Module: telepathy-mission-control
Branch: master
Commit: 1d9e8f5cfb9e7b426a99ae6e16c35c1101d55a91
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=1d9e8f5cfb9e7b426a99ae6e16c35c1101d55a91

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu Aug 30 18:50:41 2012 +0100

Default account backend: when deleting passwords, delete the same thing we will look for

Deleting secrets with param="param-password" isn't a whole lot of use
when we save, and look up, param="password".

Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088

---

 src/mcd-account-manager-default.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index 71531a8..603ecd8 100644
--- a/src/mcd-account-manager-default.c
+++ b/src/mcd-account-manager-default.c
@@ -197,15 +197,21 @@ _keyring_commit (const McpAccountStorage *self,
       for (j = 0; j < k; j++)
         {
           KeyringSetData *ksd = g_slice_new0 (KeyringSetData);
+          const gchar *key = keys[j];
+
+          /* for compatibility with old gnome keyring code we must strip  *
+           * the param- prefix from the name before saving to the keyring */
+          if (g_str_has_prefix (key, "param-"))
+            key += strlen ("param-");
 
           ksd->account = g_strdup (accts[i]);
-          ksd->name = g_strdup (keys[j]);
+          ksd->name = g_strdup (key);
           ksd->set = FALSE;
 
           gnome_keyring_delete_password (&keyring_schema,
               _keyring_set_cb, ksd, NULL,
               "account", accts[i],
-              "param", keys[j],
+              "param", key,
               NULL);
         }
 



More information about the telepathy-commits mailing list