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 622959 - inconsistent default keyring behaviour
inconsistent default keyring behaviour
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-06-27 16:58 UTC by Christian Krause
Modified: 2011-03-09 16:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small program to demonstrate the issue (1022 bytes, text/x-csrc)
2010-06-27 16:58 UTC, Christian Krause
Details

Description Christian Krause 2010-06-27 16:58:25 UTC
Created attachment 164754 [details]
small program to demonstrate the issue

During investigating a problem of the gnome-keyring integration of gnome-rdp I stumbled over the following strange behaviour of the libgnome-keyring API:

Assume the following sequence of API calls:

1. get_default_keyring_sync(&keyring) -> keyring = NULL
2. set_network_password_sync(keyring, network_entry_parameters) -> OK, id 
3. find_network_password(network_entry_parameters) -> one entry
4. print entry->keyring: "login"

IMHO there is an inconsistency here:
a) set_network_password_sync(NULL, ...) will use the default keyring (which is OK)
b) the default keyring which is actually used is "login" (as it is associated with the entry)
c) however, get_default_keyring does only return NULL

I would assume the API should work like this:
- set_network_password_sync(NULL, ...) would save the entry to the default keyring whatever it is
- set_network_password_sync("name_of_default_keyring", ...) would do exactly the same

So IMHO the real problem is:
- get_default_keyring_sync should retrieve the name of the real default keyring, so it can be used e.g. to compare the keyring of any keyring entries with the default keyring

I have attached a small program which demonstrates the issue. It can be compiled with:
gcc -o keyring-test `pkg-config --cflags --libs gnome-keyring-1` keyring-test.c

Please note, that the same test works (on my systems) with gnome-keyring-2.28.2 without any problems, get_default_keyring_sync retrieves correctly "default".
Comment 1 Stef Walter 2011-03-09 16:34:27 UTC
I've merged bunch of changes to gnome-keyring-daemon and the secret service API which should fix this:


commit c8b3144f36edb54f3af4d08bd0cb65acca5bf4e9
Author: Stef Walter <stefw@collabora.co.uk>
Date:   Wed Mar 9 10:27:51 2011 +0100

    [dbus] Pass an alias argument along to a CreateCollection dbus method.
    
    This is new in the specification and prevents problems with race
    conditions and multiple applications all trying to create the
    default keyring.