mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 04:38:55 +00:00
sync-search: unlock keyring before getting secret attributes
In gnome-keyring, the secret items attributes are not visible until the keyring is unlocked. But in libsecret, the synchronous secret search function unlocks the keyring after and not before the attributes dbus pull. So when the keyring is locked and you run secret_service_search_sync(), you get hashed or empty attributes because the keyring was locked at the time these attributes were pulled. If you run this function when the keyring is already unlocked, there is no problem. This commit moves the unlock routine before the attributes pull to make the synchronous search function working correctly when the keyring is locked initially. Issues #6 gnome-shell#4780
This commit is contained in:
parent
31ea8cb41d
commit
7387774263
@ -475,6 +475,10 @@ secret_service_search_sync (SecretService *service,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (flags & SECRET_SEARCH_UNLOCK)
|
||||
secret_service_unlock_dbus_paths_sync (service, (const gchar**) locked_paths,
|
||||
cancellable, NULL, NULL);
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
want = 1;
|
||||
@ -509,9 +513,6 @@ secret_service_search_sync (SecretService *service,
|
||||
items = g_list_concat (items, g_list_copy (unlocked));
|
||||
items = g_list_reverse (items);
|
||||
|
||||
if (flags & SECRET_SEARCH_UNLOCK)
|
||||
secret_service_unlock_sync (service, locked, cancellable, NULL, NULL);
|
||||
|
||||
if (flags & SECRET_SEARCH_LOAD_SECRETS)
|
||||
secret_item_load_secrets_sync (items, NULL, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user