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 664454 - gnome_keyring_get_default_keyring_sync() returns NULL
gnome_keyring_get_default_keyring_sync() returns NULL
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-11-21 08:19 UTC by Mardy
Modified: 2011-12-01 12:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mardy 2011-11-21 08:19:39 UTC
I'm using Ubuntu 11.10, which ships GNOME keyring 3.2.1.

The gnome_keyring_get_default_keyring_sync() function returns a NULL
string for the keyring (and no error).

But when I store some passwords and specify NULL as the keyring to be
used, they end up into the "login" keyring. This is a problem, because
when I want to find them back, I compare the "keyring" field from the
GnomeKeyringFound structure (which is "login") with the name of the
keyring I'm using (NULL) and they don't match.

I would expect the gnome_keyring_get_default_keyring_sync() to return me
"login", instead.
Comment 1 Stef Walter 2011-11-23 16:41:36 UTC
Found the problem. This is regression due to recent refactoring for the Secret Service implementation [1]. There was an appropriately located "TODO:" :S

Committed fix to gnome-3-2 branch, and will bring that into master soon. The patch applies to both branches.

commit 1436c6bedd0fb7b0a81ab9d7d59766f24d03f745
Author: Stef Walter <stefw@collabora.co.uk>
Date:   Wed Nov 23 17:38:09 2011 +0100

    daemon: Fix ReadAlias() returning null when 'login' keyring exists
    
     * Internally we use the 'login' keyring as the automatic default
       when no default is explicitly set.
     * However this logic was not reflected in the result of the
       ReadAlias() secret serivce API call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664454


Let me know if this patch does the trick for you.

[1] http://standards.freedesktop.org/secret-service/
Comment 2 Mardy 2011-12-01 12:27:08 UTC
Stef, you rock! That commit definitely fixes the issue.
I see that it's not in the master, yet. Please don't forget about it. :-)