Bug 28557 - escaped characters in accounts.cfg are dealt with incorrectly / accounts.cfg becomes very large
Summary: escaped characters in accounts.cfg are dealt with incorrectly / accounts.cfg ...
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: git master
Hardware: Other All
: high major
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-06-15 10:46 UTC by Simon McVittie
Modified: 2010-06-16 03:33 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2010-06-15 10:46:50 UTC
If a connection manager parameter's value contains '\', the number of '\' is doubled every time accounts.cfg is written.
Comment 1 Simon McVittie 2010-06-15 10:49:44 UTC
> static gchar *
> get_value (const McpAccountManager *ma,
>     const gchar *acct,
>     const gchar *key)
> {
>   McdPluginAccountManager *self = MCD_PLUGIN_ACCOUNT_MANAGER (ma);
>   return g_key_file_get_value (self->keyfile, acct, key, NULL);
                      ^^^^^^^^^
> }

but:

> static void
> set_value (const McpAccountManager *ma,
>     const gchar *acct,
>     const gchar *key,
>     const gchar *value)
> {
>   McdPluginAccountManager *self = MCD_PLUGIN_ACCOUNT_MANAGER (ma);
> 
>   if (value != NULL)
>     g_key_file_set_string (self->keyfile, acct, key, value);
                 ^^^^^^^^^^
>   else
>     g_key_file_remove_key (self->keyfile, acct, key, NULL);
> }

This is not how you do GKeyFile.
Comment 2 Simon McVittie 2010-06-15 11:58:46 UTC
See attached branch.
Comment 3 Vivek Dasmohapatra 2010-06-15 15:46:06 UTC
Looks right. Couldn't find any stray (_get/_set)_strings any more.
Comment 4 Simon McVittie 2010-06-16 03:33:16 UTC
Fixed in git, will be in 5.5.2. Some notes for any users who've been hit by this bug:

Working around excessively large accounts.cfg
=============================================

If one of your accounts has a parameter that contains a special character (backslash, tab or newline), it may have made your ~/.mission-control/accounts/accounts.cfg extremely large (multiple megabytes). This bug exists in versions 5.5.0 and 5.5.1.

First, make sure you're running a version of MC that doesn't have this bug (either 5.4.x, or 5.5.2 or later). To do that, install the new version, then log out and back in (or kill the mission-control-5 process). 

The best way to repair a huge accounts.cfg is to remove and re-create the account that caused it, preferably via the normal account editing UI in Empathy.

If the account has become so large that Empathy's account editing UI no longer works, you can do the same via the command line, with the "mc-tool" utility provided with Mission Control. First, list your accounts:

    mc-tool list

This will output a list of account IDs, something like:

    gabble/jabber/telepathy-user_40example_2ecom0
    haze/facebook/telepathy-user0
    idle/irc/telepathy-user0
    salut/local_xmpp/account0

You can examine an account with a command like:

    mc-tool show haze/facebook/telepathy-user0

For a typical account, you'll get a small amount of output (about 15 lines in a terminal). If you get huge numbers of backslashes instead, the account has been affected by this bug.

You can delete an account with a command like:

    mc-tool remove haze/facebook/telepathy-user0

accounts.cfg should now reduce to a sensible size (about 15 lines per account, which might add up to a few kilobytes if you have lots of accounts), and you can re-create the account using Empathy.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.