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

Bug#686853: marked as done (unblock: telepathy-mission-control-5/1:5.12.1-3)



Your message dated Thu, 06 Sep 2012 19:14:27 +0100
with message-id <1346955267.8753.0.camel@jacala.jungle.funky-badger.org>
and subject line Re: Bug#686853: unblock: telepathy-mission-control-5/1:5.12.1-3
has caused the Debian Bug report #686853,
regarding unblock: telepathy-mission-control-5/1:5.12.1-3
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
686853: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686853
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please consider:

    unblock telepathy-mission-control-5/1:5.12.1-3

In my opinion, both the bugs mentioned in the changelog are RC: they
cause accounts to disappear or be stuck with an old password when
upgrading from squeeze to wheezy.

telepathy-mission-control-5 (1:5.12.1-3) unstable; urgency=low

  * Add patches from upstream stable release 5.12.2 to fix deletion of
    passwords from gnome-keyring, in particular when upgrading Empathy
    from squeeze to wheezy triggers a format migration. (Closes: #686836)
  * Add patch from upstream stable release 5.12.2 to enable migration of
    Butterfly accounts to Haze after Butterfly has been uninstalled
    (Closes: #686835)
  * Add patch from upstream stable release 5.12.2 to migrate the
    passwords of Butterfly accounts too

The attached file mc-5.12.1-3-debdiff.diff is the full debdiff.
It consists of a subset of patches from upstream release 5.12.2;
I've also attached the patches separately so you don't have to read a
diff-of-diffs.

Thanks,
    S

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diffstat for telepathy-mission-control-5-5.12.1 telepathy-mission-control-5-5.12.1

 changelog                                                               |   13 +
 patches/0010-Default-account-backend-when-deleting-always-delete-.patch |   71 +++++++
 patches/0011-_keyring_commit-perform-deletions-for-keys-in-remove.patch |   47 ++++
 patches/0012-Default-account-backend-when-deleting-from-the-keyri.patch |   38 +++
 patches/0013-Default-account-backend-when-deleting-passwords-dele.patch |   48 ++++
 patches/0014-Migrate-from-Butterfly-to-Haze-even-if-Butterfly-is-.patch |   98 ++++++++++
 patches/0015-Butterfly-account-migration-migrate-the-password-too.patch |   55 +++++
 patches/series                                                          |    6 
 8 files changed, 376 insertions(+)

diff -Nru telepathy-mission-control-5-5.12.1/debian/changelog telepathy-mission-control-5-5.12.1/debian/changelog
--- telepathy-mission-control-5-5.12.1/debian/changelog	2012-08-10 14:39:56.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/changelog	2012-09-06 17:06:48.000000000 +0100
@@ -1,3 +1,16 @@
+telepathy-mission-control-5 (1:5.12.1-3) unstable; urgency=low
+
+  * Add patches from upstream stable release 5.12.2 to fix deletion of
+    passwords from gnome-keyring, in particular when upgrading Empathy
+    from squeeze to wheezy triggers a format migration. (Closes: #686836)
+  * Add patch from upstream stable release 5.12.2 to enable migration of
+    Butterfly accounts to Haze after Butterfly has been uninstalled
+    (Closes: #686835)
+  * Add patch from upstream stable release 5.12.2 to migrate the
+    passwords of Butterfly accounts too
+
+ -- Simon McVittie <smcv@debian.org>  Thu, 06 Sep 2012 17:06:32 +0100
+
 telepathy-mission-control-5 (1:5.12.1-2) unstable; urgency=low
 
   * Upload to unstable
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/0010-Default-account-backend-when-deleting-always-delete-.patch telepathy-mission-control-5-5.12.1/debian/patches/0010-Default-account-backend-when-deleting-always-delete-.patch
--- telepathy-mission-control-5-5.12.1/debian/patches/0010-Default-account-backend-when-deleting-always-delete-.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/0010-Default-account-backend-when-deleting-always-delete-.patch	2012-09-06 17:06:48.000000000 +0100
@@ -0,0 +1,71 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Thu, 30 Aug 2012 18:09:21 +0100
+Subject: [PATCH 10/16] Default account backend: when deleting, always delete
+ from both places
+
+Our tracking of whether something is "secret" (in the gnome-keyring) is
+pretty shaky, and in particular, we can forget that things are meant
+to be "secret" sometimes (we lose that information when deleting
+parameters).
+
+Happily, when we're deleting things, it doesn't actually matter: the
+right thing to do is clearly to delete from both locations, regardless
+of where we think it ought to be.
+
+Similarly, when we're setting a property to a new value, it's appropriate
+to delete it from both locations, then put it in the right location
+(only).
+
+Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
+Cherry-picked-from: 5b4954d2c959c4ba7f6c67b7d8e16eaa5ab272dd
+Origin: upstream, 5.12.2, commit:dbba880903def15bc7bb5fdb9d05ee310f1a5bfe
+---
+ src/mcd-account-manager-default.c |   15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
+index e156de1..221c5d0 100644
+--- a/src/mcd-account-manager-default.c
++++ b/src/mcd-account-manager-default.c
+@@ -411,6 +411,10 @@ _set (const McpAccountStorage *self,
+   /* if we have a keyring, secrets are segregated */
+   secret = mcp_account_manager_parameter_is_secret (am, account, key);
+ 
++  /* remove it from both sets, then re-add it to the right one if non-null */
++  g_key_file_remove_key (amd->secrets, account, key, NULL);
++  g_key_file_remove_key (amd->keyfile, account, key, NULL);
++
+   if (val != NULL)
+     {
+       if (secret)
+@@ -418,13 +422,6 @@ _set (const McpAccountStorage *self,
+       else
+         g_key_file_set_value (amd->keyfile, account, key, val);
+     }
+-  else
+-    {
+-      if (secret)
+-        g_key_file_remove_key (amd->secrets, account, key, NULL);
+-      else
+-        g_key_file_remove_key (amd->keyfile, account, key, NULL);
+-    }
+ 
+   /* if we removed the account before, it now exists again, so... */
+   g_hash_table_remove (amd->removed_accounts, account);
+@@ -561,8 +558,10 @@ _delete (const McpAccountStorage *self,
+           g_key_file_remove_group (amd->keyfile, account, NULL);
+           _delete_from_keyring (self, am, account, NULL);
+         }
+-      else if (mcp_account_manager_parameter_is_secret (am, account, key))
++      else
+         {
++          /* always delete from keyring, even if we didn't previously
++           * think it was secret - we might have been wrong */
+           _delete_from_keyring (self, am, account, key);
+         }
+ 
+-- 
+1.7.10.4
+
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/0011-_keyring_commit-perform-deletions-for-keys-in-remove.patch telepathy-mission-control-5-5.12.1/debian/patches/0011-_keyring_commit-perform-deletions-for-keys-in-remove.patch
--- telepathy-mission-control-5-5.12.1/debian/patches/0011-_keyring_commit-perform-deletions-for-keys-in-remove.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/0011-_keyring_commit-perform-deletions-for-keys-in-remove.patch	2012-09-06 17:06:48.000000000 +0100
@@ -0,0 +1,47 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Thu, 30 Aug 2012 16:03:08 +0100
+Subject: [PATCH 11/16] _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@collabora.co.uk>
+Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
+Cherry-picked-from: d4ca35cffea9d0093e127e0be633501d22ded35f
+Origin: upstream, 5.12.2, commit:efc15381535a2d94eeec2b19651302768f65d0ad
+---
+ src/mcd-account-manager-default.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
+index 221c5d0..6989d62 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;
+-- 
+1.7.10.4
+
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/0012-Default-account-backend-when-deleting-from-the-keyri.patch telepathy-mission-control-5-5.12.1/debian/patches/0012-Default-account-backend-when-deleting-from-the-keyri.patch
--- telepathy-mission-control-5-5.12.1/debian/patches/0012-Default-account-backend-when-deleting-from-the-keyri.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/0012-Default-account-backend-when-deleting-from-the-keyri.patch	2012-09-06 17:06:48.000000000 +0100
@@ -0,0 +1,38 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Thu, 30 Aug 2012 18:12:06 +0100
+Subject: [PATCH 12/16] Default account backend: when deleting from the
+ keyring, remove from secrets
+
+Otherwise we'd just delete it, then (because it's still in secrets)
+re-commit it!
+
+Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
+Cherry-picked-from: 16e4507c5001f6f45158ef3d0b46998fa8c1ca2a
+Origin: upstream, 5.12.2, commit:bd56ee0e36a681ee50d3e02d4f158bbc5df462f1
+---
+ src/mcd-account-manager-default.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
+index 6989d62..22eb29e 100644
+--- a/src/mcd-account-manager-default.c
++++ b/src/mcd-account-manager-default.c
+@@ -78,11 +78,13 @@ _delete_from_keyring (const McpAccountStorage *self,
+       /* flag the whole account as purged */
+       gchar *removed = g_strdup (account);
+       g_hash_table_replace (amd->removed_accounts, removed, removed);
++      g_key_file_remove_group (amd->secrets, removed, NULL);
+     }
+   else
+     {
+       /* remember to forget this one param */
+       g_key_file_set_value (amd->removed, account, key, "");
++      g_key_file_remove_key (amd->secrets, account, key, NULL);
+     }
+ }
+ 
+-- 
+1.7.10.4
+
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/0013-Default-account-backend-when-deleting-passwords-dele.patch telepathy-mission-control-5-5.12.1/debian/patches/0013-Default-account-backend-when-deleting-passwords-dele.patch
--- telepathy-mission-control-5-5.12.1/debian/patches/0013-Default-account-backend-when-deleting-passwords-dele.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/0013-Default-account-backend-when-deleting-passwords-dele.patch	2012-09-06 17:06:48.000000000 +0100
@@ -0,0 +1,48 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Thu, 30 Aug 2012 18:50:41 +0100
+Subject: [PATCH 13/16] 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@collabora.co.uk>
+Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
+Cherry-picked-from: 1d9e8f5cfb9e7b426a99ae6e16c35c1101d55a91
+Origin: upstream, 5.12.2, commit:1ce1e32bc7f83b5dfc3b75407e896c7bd7e6cbdb
+---
+ src/mcd-account-manager-default.c |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
+index 22eb29e..cd6d019 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);
+         }
+ 
+-- 
+1.7.10.4
+
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/0014-Migrate-from-Butterfly-to-Haze-even-if-Butterfly-is-.patch telepathy-mission-control-5-5.12.1/debian/patches/0014-Migrate-from-Butterfly-to-Haze-even-if-Butterfly-is-.patch
--- telepathy-mission-control-5-5.12.1/debian/patches/0014-Migrate-from-Butterfly-to-Haze-even-if-Butterfly-is-.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/0014-Migrate-from-Butterfly-to-Haze-even-if-Butterfly-is-.patch	2012-09-06 17:06:48.000000000 +0100
@@ -0,0 +1,98 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Thu, 6 Sep 2012 16:43:19 +0100
+Subject: [PATCH 14/16] Migrate from Butterfly to Haze even if Butterfly is no
+ longer installed
+
+Mission Control has a bug/design flaw/whatever in which it doesn't
+know the types of parameters without looking at the corresponding
+connection manager, which doesn't work if that connection manager has
+been uninstalled. This turns out to be bad for the upgrade from
+Debian 6 to Debian 7, which upgrades MC to a version that will
+perform the migration from Butterfly to Haze, but also uninstalls
+Butterfly...
+
+Since we know what the type of 'account' is, with a bit of refactoring
+we can tell McdAccount that we know it's a string, get its value
+anyway, and get on with our lives.
+
+Bug-Debian: http://bugs.debian.org/686835
+Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
+Origin: upstream, 5.12.2, commit:3ae49c706e93d06131cabf5b4a0421869948ec62
+---
+ src/mcd-account-manager.c |    4 +++-
+ src/mcd-account.c         |   18 +++++++++++++++---
+ src/mcd-account.h         |    6 ++++++
+ 3 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
+index 4d93220..a13ba03 100644
+--- a/src/mcd-account-manager.c
++++ b/src/mcd-account-manager.c
+@@ -1222,7 +1222,9 @@ migrate_butterfly_haze_ready (McdManager *manager,
+     }
+ 
+     /* Parameters; we just care about 'account' */
+-    if (!mcd_account_get_parameter (ctx->account, "account", &v, NULL))
++    if (!mcd_account_get_parameter_of_known_type (ctx->account,
++                                                  "account", G_TYPE_STRING,
++                                                  &v, NULL))
+     {
+         _mcd_account_set_enabled (ctx->account, FALSE, TRUE, NULL);
+         goto error;
+diff --git a/src/mcd-account.c b/src/mcd-account.c
+index 192d8d9..1864e7d 100644
+--- a/src/mcd-account.c
++++ b/src/mcd-account.c
+@@ -429,16 +429,28 @@ mcd_account_get_parameter (McdAccount *account, const gchar *name,
+                            GError **error)
+ {
+     McdAccountPrivate *priv = account->priv;
+-    McdStorage *storage = priv->storage;
+-    gchar key[MAX_KEY_LENGTH];
+     const TpConnectionManagerParam *param;
+     GType type;
+-    const gchar *account_name = mcd_account_get_unique_name (account);
+ 
+     param = mcd_manager_get_protocol_param (priv->manager,
+                                             priv->protocol_name, name);
+     type = mc_param_type (param);
+ 
++    return mcd_account_get_parameter_of_known_type (account, name,
++                                                    type, parameter, error);
++}
++
++gboolean
++mcd_account_get_parameter_of_known_type (McdAccount *account,
++                                         const gchar *name,
++                                         GType type,
++                                         GValue *parameter,
++                                         GError **error)
++{
++    const gchar *account_name = mcd_account_get_unique_name (account);
++    McdStorage *storage = account->priv->storage;
++    gchar key[MAX_KEY_LENGTH];
++
+     g_snprintf (key, sizeof (key), "param-%s", name);
+ 
+     if (mcd_storage_has_value (storage, account_name, key))
+diff --git a/src/mcd-account.h b/src/mcd-account.h
+index 6b0dd60..90e429a 100644
+--- a/src/mcd-account.h
++++ b/src/mcd-account.h
+@@ -148,6 +148,12 @@ gboolean mcd_account_get_parameter (McdAccount *account, const gchar *name,
+                            GValue *parameter,
+                            GError **error);
+ 
++gboolean mcd_account_get_parameter_of_known_type (McdAccount *account,
++                                                  const gchar *name,
++                                                  GType type,
++                                                  GValue *parameter,
++                                                  GError **error);
++
+ gchar * mcd_account_dup_icon (McdAccount *self);
+ 
+ gchar * mcd_account_dup_nickname (McdAccount *self);
+-- 
+1.7.10.4
+
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/0015-Butterfly-account-migration-migrate-the-password-too.patch telepathy-mission-control-5-5.12.1/debian/patches/0015-Butterfly-account-migration-migrate-the-password-too.patch
--- telepathy-mission-control-5-5.12.1/debian/patches/0015-Butterfly-account-migration-migrate-the-password-too.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/0015-Butterfly-account-migration-migrate-the-password-too.patch	2012-09-06 17:06:48.000000000 +0100
@@ -0,0 +1,55 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Thu, 6 Sep 2012 16:40:37 +0100
+Subject: [PATCH 15/16] Butterfly account migration: migrate the password too,
+ if stored
+
+Otherwise the upgrade from Debian 6 to 7 forgets MSN passwords, which
+is not the end of the world, but seems less nice than it could be.
+
+Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
+Origin: upstream, 5.12.2, commit:5e1bbe8f891af4d86cb9dfd2f0b36fdfbbb7b2ef
+---
+ src/mcd-account-manager.c |   12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
+index a13ba03..e4a81f7 100644
+--- a/src/mcd-account-manager.c
++++ b/src/mcd-account-manager.c
+@@ -1209,6 +1209,7 @@ migrate_butterfly_haze_ready (McdManager *manager,
+     MigrateCtx *ctx = user_data;
+     gchar *display_name;
+     GValue v = {0,};
++    GValue password_v = {0,};
+     GHashTable *parameters, *properties;
+     gchar *str;
+     GPtrArray *supersedes;
+@@ -1221,7 +1222,7 @@ migrate_butterfly_haze_ready (McdManager *manager,
+         goto error;
+     }
+ 
+-    /* Parameters; we just care about 'account' */
++    /* Parameters; the only mandatory one is 'account' */
+     if (!mcd_account_get_parameter_of_known_type (ctx->account,
+                                                   "account", G_TYPE_STRING,
+                                                   &v, NULL))
+@@ -1233,6 +1234,15 @@ migrate_butterfly_haze_ready (McdManager *manager,
+     parameters = g_hash_table_new (g_str_hash, g_str_equal);
+     g_hash_table_insert (parameters, "account", &v);
+ 
++    /* If MC is storing the password, let's copy that too, so Empathy
++     * can migrate it somewhere better. */
++    if (mcd_account_get_parameter_of_known_type (ctx->account,
++                                                 "password", G_TYPE_STRING,
++                                                 &password_v, NULL))
++    {
++        g_hash_table_insert (parameters, "password", &password_v);
++    }
++
+     display_name = mcd_account_dup_display_name (ctx->account);
+ 
+     /* Properties */
+-- 
+1.7.10.4
+
diff -Nru telepathy-mission-control-5-5.12.1/debian/patches/series telepathy-mission-control-5-5.12.1/debian/patches/series
--- telepathy-mission-control-5-5.12.1/debian/patches/series	2012-08-10 14:39:56.000000000 +0100
+++ telepathy-mission-control-5-5.12.1/debian/patches/series	2012-09-06 17:06:48.000000000 +0100
@@ -1 +1,7 @@
 0001-Revert-stop-using-deprecated-tp-glib-functions.patch
+0010-Default-account-backend-when-deleting-always-delete-.patch
+0011-_keyring_commit-perform-deletions-for-keys-in-remove.patch
+0012-Default-account-backend-when-deleting-from-the-keyri.patch
+0013-Default-account-backend-when-deleting-passwords-dele.patch
+0014-Migrate-from-Butterfly-to-Haze-even-if-Butterfly-is-.patch
+0015-Butterfly-account-migration-migrate-the-password-too.patch
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Thu, 30 Aug 2012 18:09:21 +0100
Subject: [PATCH 10/16] Default account backend: when deleting, always delete
 from both places

Our tracking of whether something is "secret" (in the gnome-keyring) is
pretty shaky, and in particular, we can forget that things are meant
to be "secret" sometimes (we lose that information when deleting
parameters).

Happily, when we're deleting things, it doesn't actually matter: the
right thing to do is clearly to delete from both locations, regardless
of where we think it ought to be.

Similarly, when we're setting a property to a new value, it's appropriate
to delete it from both locations, then put it in the right location
(only).

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
Cherry-picked-from: 5b4954d2c959c4ba7f6c67b7d8e16eaa5ab272dd
Origin: upstream, 5.12.2, commit:dbba880903def15bc7bb5fdb9d05ee310f1a5bfe
---
 src/mcd-account-manager-default.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index e156de1..221c5d0 100644
--- a/src/mcd-account-manager-default.c
+++ b/src/mcd-account-manager-default.c
@@ -411,6 +411,10 @@ _set (const McpAccountStorage *self,
   /* if we have a keyring, secrets are segregated */
   secret = mcp_account_manager_parameter_is_secret (am, account, key);
 
+  /* remove it from both sets, then re-add it to the right one if non-null */
+  g_key_file_remove_key (amd->secrets, account, key, NULL);
+  g_key_file_remove_key (amd->keyfile, account, key, NULL);
+
   if (val != NULL)
     {
       if (secret)
@@ -418,13 +422,6 @@ _set (const McpAccountStorage *self,
       else
         g_key_file_set_value (amd->keyfile, account, key, val);
     }
-  else
-    {
-      if (secret)
-        g_key_file_remove_key (amd->secrets, account, key, NULL);
-      else
-        g_key_file_remove_key (amd->keyfile, account, key, NULL);
-    }
 
   /* if we removed the account before, it now exists again, so... */
   g_hash_table_remove (amd->removed_accounts, account);
@@ -561,8 +558,10 @@ _delete (const McpAccountStorage *self,
           g_key_file_remove_group (amd->keyfile, account, NULL);
           _delete_from_keyring (self, am, account, NULL);
         }
-      else if (mcp_account_manager_parameter_is_secret (am, account, key))
+      else
         {
+          /* always delete from keyring, even if we didn't previously
+           * think it was secret - we might have been wrong */
           _delete_from_keyring (self, am, account, key);
         }
 
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Thu, 30 Aug 2012 16:03:08 +0100
Subject: [PATCH 11/16] _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@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
Cherry-picked-from: d4ca35cffea9d0093e127e0be633501d22ded35f
Origin: upstream, 5.12.2, commit:efc15381535a2d94eeec2b19651302768f65d0ad
---
 src/mcd-account-manager-default.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index 221c5d0..6989d62 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;
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Thu, 30 Aug 2012 18:12:06 +0100
Subject: [PATCH 12/16] Default account backend: when deleting from the
 keyring, remove from secrets

Otherwise we'd just delete it, then (because it's still in secrets)
re-commit it!

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
Cherry-picked-from: 16e4507c5001f6f45158ef3d0b46998fa8c1ca2a
Origin: upstream, 5.12.2, commit:bd56ee0e36a681ee50d3e02d4f158bbc5df462f1
---
 src/mcd-account-manager-default.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index 6989d62..22eb29e 100644
--- a/src/mcd-account-manager-default.c
+++ b/src/mcd-account-manager-default.c
@@ -78,11 +78,13 @@ _delete_from_keyring (const McpAccountStorage *self,
       /* flag the whole account as purged */
       gchar *removed = g_strdup (account);
       g_hash_table_replace (amd->removed_accounts, removed, removed);
+      g_key_file_remove_group (amd->secrets, removed, NULL);
     }
   else
     {
       /* remember to forget this one param */
       g_key_file_set_value (amd->removed, account, key, "");
+      g_key_file_remove_key (amd->secrets, account, key, NULL);
     }
 }
 
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Thu, 30 Aug 2012 18:50:41 +0100
Subject: [PATCH 13/16] 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@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088
Cherry-picked-from: 1d9e8f5cfb9e7b426a99ae6e16c35c1101d55a91
Origin: upstream, 5.12.2, commit:1ce1e32bc7f83b5dfc3b75407e896c7bd7e6cbdb
---
 src/mcd-account-manager-default.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c
index 22eb29e..cd6d019 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);
         }
 
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Thu, 6 Sep 2012 16:43:19 +0100
Subject: [PATCH 14/16] Migrate from Butterfly to Haze even if Butterfly is no
 longer installed

Mission Control has a bug/design flaw/whatever in which it doesn't
know the types of parameters without looking at the corresponding
connection manager, which doesn't work if that connection manager has
been uninstalled. This turns out to be bad for the upgrade from
Debian 6 to Debian 7, which upgrades MC to a version that will
perform the migration from Butterfly to Haze, but also uninstalls
Butterfly...

Since we know what the type of 'account' is, with a bit of refactoring
we can tell McdAccount that we know it's a string, get its value
anyway, and get on with our lives.

Bug-Debian: http://bugs.debian.org/686835
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
Origin: upstream, 5.12.2, commit:3ae49c706e93d06131cabf5b4a0421869948ec62
---
 src/mcd-account-manager.c |    4 +++-
 src/mcd-account.c         |   18 +++++++++++++++---
 src/mcd-account.h         |    6 ++++++
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 4d93220..a13ba03 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -1222,7 +1222,9 @@ migrate_butterfly_haze_ready (McdManager *manager,
     }
 
     /* Parameters; we just care about 'account' */
-    if (!mcd_account_get_parameter (ctx->account, "account", &v, NULL))
+    if (!mcd_account_get_parameter_of_known_type (ctx->account,
+                                                  "account", G_TYPE_STRING,
+                                                  &v, NULL))
     {
         _mcd_account_set_enabled (ctx->account, FALSE, TRUE, NULL);
         goto error;
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 192d8d9..1864e7d 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -429,16 +429,28 @@ mcd_account_get_parameter (McdAccount *account, const gchar *name,
                            GError **error)
 {
     McdAccountPrivate *priv = account->priv;
-    McdStorage *storage = priv->storage;
-    gchar key[MAX_KEY_LENGTH];
     const TpConnectionManagerParam *param;
     GType type;
-    const gchar *account_name = mcd_account_get_unique_name (account);
 
     param = mcd_manager_get_protocol_param (priv->manager,
                                             priv->protocol_name, name);
     type = mc_param_type (param);
 
+    return mcd_account_get_parameter_of_known_type (account, name,
+                                                    type, parameter, error);
+}
+
+gboolean
+mcd_account_get_parameter_of_known_type (McdAccount *account,
+                                         const gchar *name,
+                                         GType type,
+                                         GValue *parameter,
+                                         GError **error)
+{
+    const gchar *account_name = mcd_account_get_unique_name (account);
+    McdStorage *storage = account->priv->storage;
+    gchar key[MAX_KEY_LENGTH];
+
     g_snprintf (key, sizeof (key), "param-%s", name);
 
     if (mcd_storage_has_value (storage, account_name, key))
diff --git a/src/mcd-account.h b/src/mcd-account.h
index 6b0dd60..90e429a 100644
--- a/src/mcd-account.h
+++ b/src/mcd-account.h
@@ -148,6 +148,12 @@ gboolean mcd_account_get_parameter (McdAccount *account, const gchar *name,
                            GValue *parameter,
                            GError **error);
 
+gboolean mcd_account_get_parameter_of_known_type (McdAccount *account,
+                                                  const gchar *name,
+                                                  GType type,
+                                                  GValue *parameter,
+                                                  GError **error);
+
 gchar * mcd_account_dup_icon (McdAccount *self);
 
 gchar * mcd_account_dup_nickname (McdAccount *self);
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Thu, 6 Sep 2012 16:40:37 +0100
Subject: [PATCH 15/16] Butterfly account migration: migrate the password too,
 if stored

Otherwise the upgrade from Debian 6 to 7 forgets MSN passwords, which
is not the end of the world, but seems less nice than it could be.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
Origin: upstream, 5.12.2, commit:5e1bbe8f891af4d86cb9dfd2f0b36fdfbbb7b2ef
---
 src/mcd-account-manager.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index a13ba03..e4a81f7 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -1209,6 +1209,7 @@ migrate_butterfly_haze_ready (McdManager *manager,
     MigrateCtx *ctx = user_data;
     gchar *display_name;
     GValue v = {0,};
+    GValue password_v = {0,};
     GHashTable *parameters, *properties;
     gchar *str;
     GPtrArray *supersedes;
@@ -1221,7 +1222,7 @@ migrate_butterfly_haze_ready (McdManager *manager,
         goto error;
     }
 
-    /* Parameters; we just care about 'account' */
+    /* Parameters; the only mandatory one is 'account' */
     if (!mcd_account_get_parameter_of_known_type (ctx->account,
                                                   "account", G_TYPE_STRING,
                                                   &v, NULL))
@@ -1233,6 +1234,15 @@ migrate_butterfly_haze_ready (McdManager *manager,
     parameters = g_hash_table_new (g_str_hash, g_str_equal);
     g_hash_table_insert (parameters, "account", &v);
 
+    /* If MC is storing the password, let's copy that too, so Empathy
+     * can migrate it somewhere better. */
+    if (mcd_account_get_parameter_of_known_type (ctx->account,
+                                                 "password", G_TYPE_STRING,
+                                                 &password_v, NULL))
+    {
+        g_hash_table_insert (parameters, "password", &password_v);
+    }
+
     display_name = mcd_account_dup_display_name (ctx->account);
 
     /* Properties */
-- 
1.7.10.4


--- End Message ---
--- Begin Message ---
On Thu, 2012-09-06 at 18:36 +0100, Simon McVittie wrote:
> Please consider:
> 
>     unblock telepathy-mission-control-5/1:5.12.1-3
> 
> In my opinion, both the bugs mentioned in the changelog are RC: they
> cause accounts to disappear or be stuck with an old password when
> upgrading from squeeze to wheezy.

Unblocked; thanks.

Regards,

Adam

--- End Message ---

Reply to: