GNOME Bugzilla – Bug 622959
inconsistent default keyring behaviour
Last modified: 2011-03-09 16:34:27 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".
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.