From 9d9e989be49cf708f5e4f896c2ba3395eac07207 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 21 Jul 2021 16:28:35 +0200 Subject: [PATCH] secret-store: Work around bug in gnome-keyring preventing keyring unlocking When a keyring is cold (unlocked) the schema is set as "org.freedesktop.Secret.Generic". If we require the name to strictly match while searching we won't ever get a match. See https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/89 and https://gitlab.gnome.org/GNOME/libsecret/-/issues/7 for more information Closes #316 --- src/calls-secret-store.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calls-secret-store.c b/src/calls-secret-store.c index 802e550..5e7a63a 100644 --- a/src/calls-secret-store.c +++ b/src/calls-secret-store.c @@ -32,7 +32,12 @@ const SecretSchema * calls_secret_get_schema (void) { static const SecretSchema schema = { - "sm.puri.Calls", SECRET_SCHEMA_NONE, + /** SECRET_SCHEMA_DONT_MATCH_NAME is used as a workaround for a bug in gnome-keyring + * which prevents cold keyrings from being searched (and hence does not prompt for unlocking) + * see https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/89 and + * https://gitlab.gnome.org/GNOME/libsecret/-/issues/7 for more information + */ + "sm.puri.Calls", SECRET_SCHEMA_DONT_MATCH_NAME, { { CALLS_USERNAME_ATTRIBUTE, SECRET_SCHEMA_ATTRIBUTE_STRING }, { CALLS_SERVER_ATTRIBUTE, SECRET_SCHEMA_ATTRIBUTE_STRING },