telepathy-mission-control: _keyring_commit: perform deletions for keys in removed, not in secrets

Simon McVittie smcv at kemper.freedesktop.org
Fri Aug 31 07:26:58 PDT 2012


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

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu Aug 30 16:03:08 2012 +0100

_keyring_commit: perform deletions for keys in removed, not in secrets

'removed' is essentially a set of (account, key) tuples that should
be deleted. What we were doing was:

    foreach account in removed
        foreach key in secrets[account]
            delete (account, key)

which makes little sense - if we have param-password and
param-proxy-password and we want to unset Parameters['password'],
the current implementation would delete both. This commit changes it to:

    foreach account in removed
        foreach key in removed[account]
            delete (account, key)

which has the advantage of actually making sense.

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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index 1d90142..726db5d 100644
--- a/src/mcd-account-manager-default.c
+++ b/src/mcd-account-manager-default.c
@@ -187,7 +187,7 @@ _keyring_commit (const McpAccountStorage *self,
     {
       gsize j;
       gsize k;
-      GStrv keys = g_key_file_get_keys (amd->secrets, accts[i], &k, NULL);
+      GStrv keys = g_key_file_get_keys (amd->removed, accts[i], &k, NULL);
 
       if (keys == NULL)
         k = 0;



More information about the telepathy-commits mailing list