After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688165 - Default keyring does not get created
Default keyring does not get created
Status: RESOLVED FIXED
Product: libsecret
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsecret maintainer(s)
libsecret maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-11-12 12:32 UTC by Debarshi Ray
Modified: 2012-11-21 18:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix collection creation bugs in mock service (1.43 KB, patch)
2012-11-14 10:11 UTC, Stef Walter
committed Details | Review
When storing a secret, create default keyring if necessary (9.62 KB, patch)
2012-11-14 10:11 UTC, Stef Walter
committed Details | Review
Translated label for automatically created default keyrings (1.63 KB, patch)
2012-11-14 10:11 UTC, Stef Walter
committed Details | Review
Rework how we strip remote DBus errors (19.29 KB, patch)
2012-11-14 10:11 UTC, Stef Walter
committed Details | Review
Don't print messages when creating default collection (2.54 KB, patch)
2012-11-14 10:11 UTC, Stef Walter
committed Details | Review

Description Debarshi Ray 2012-11-12 12:32:18 UTC
The default keyring does not get created when an attempt is made to store something in it. eg., the Fedora 18 LiveCD does not have a default keyring (ie. SECRET_COLLECTION_DEFAULT) initially. Attempts to store any credentials during the live CD session fails.

$ echo "foo" | secret-tool store --label=Blah attribute value
** Message: Remote error from secret service: org.freedesktop.Secret.Error.NoSuchObject: The '/org/freedesktop/secrets/aliases/default' object does not exist secret-tool: The '/org/freedesktop/secrets/aliases/default' object does not existrpm -q libsecret

Relevant versions:
libsecret-0.11
gnome-keyring-3.6.1
Comment 1 Debarshi Ray 2012-11-13 21:11:47 UTC
One workaround is to use Seahorse to create a keyring (File -> New). Once it is created, right click on it and set it as default.
Comment 2 Stef Walter 2012-11-14 10:11:27 UTC
Created attachment 228949 [details] [review]
Fix collection creation bugs in mock service

 * Guarantee that collections have unique paths
 * Set the alias of new collections correctly
Comment 3 Stef Walter 2012-11-14 10:11:32 UTC
Created attachment 228950 [details] [review]
When storing a secret, create default keyring if necessary

 * If the default keyring does not exist when storing a secret
   try and create it.
 * We handle both secrets that correctly return NoSuchObject
   and ones that just return the silly DBus UnknownMethod error.
Comment 4 Stef Walter 2012-11-14 10:11:36 UTC
Created attachment 228951 [details] [review]
Translated label for automatically created default keyrings
Comment 5 Stef Walter 2012-11-14 10:11:41 UTC
Created attachment 228952 [details] [review]
Rework how we strip remote DBus errors

 * This is necessary because sometimes we don't want to complain,
   for expected errors, when running nested operations.
 * The fact that we have to do this is silly, and soon there
   will be a solution in glib itself.
Comment 6 Stef Walter 2012-11-14 10:11:45 UTC
Created attachment 228953 [details] [review]
Don't print messages when creating default collection

 * This is expected behavior, so don't complain.
Comment 7 Stef Walter 2012-11-14 10:12:54 UTC
Anyone interested in doing some review for these patches?

In particular, the second patch (labeled: "When storing a secret, create default keyring if necessary") is the main one that fixes this bug, and might be back-ported into distros to fix this bug.
Comment 8 Debarshi Ray 2012-11-14 13:52:04 UTC
WORKSFORME.

I tested it on Fedora 18 live CD, which does not have a default keyring. Trying to store something created a keyring for me.

Also tested on a non-live session which already had a default keyring, and it works as before.
Comment 9 Stef Walter 2012-11-21 16:46:05 UTC
Merged into git master.
Comment 10 Debarshi Ray 2012-11-21 18:07:53 UTC
I wonder if distributions should backport it because it affects live CDs.