GNOME Bugzilla – Bug 447315
Do not return denied error in case no item are found
Last modified: 2019-02-22 11:47:36 UTC
Right now, the gnome_keyring_find_items* functions return GNOME_KEYRING_RESULT_DENIED when no items are found. I think it would be more consistent to return a GNOME_KEYRING_RESULT_OK error code in this case, and let consumers check the length of the returned array (empty if nothing is found). The denied error code should be used in case access is really denied. Testcase: cd library ./test-keyring f bar found items: res: 1 (GNOME_KEYRING_RESULT_DENIED) nr items: 0 ./test-keyring c foo bar ./test-keyring f bar [...] found items: res: 0 (GNOME_KEYRING_RESULT_OK) nr items: 1 [...]
Correction: the items are returned as a list (a NULL check would have to be done instead).
Thanks for catching that. Fixed. Also added a unit test so we can verify this behavior in the future. 2007-06-14 Stef Walter <stef@memberwebs.com> * daemon/gnome-keyring-daemon-io.c * daemon/gnome-keyring-daemon.c: * daemon/gnome-keyring-daemon.h: * tests/unit-test-keyrings.c: Make a find operation that does not match any results, return OK instead of DENIED. Fixes bug #447315