From 1298c7812c2c068a58e119de3db898bcffb2c3b2 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Fri, 19 Feb 2021 09:16:23 +0100 Subject: [PATCH] Handle snaps the same way as flatpaks --- libsecret/secret-backend.c | 2 +- libsecret/secret-file-backend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsecret/secret-backend.c b/libsecret/secret-backend.c index 946b342..73f0fd7 100644 --- a/libsecret/secret-backend.c +++ b/libsecret/secret-backend.c @@ -155,7 +155,7 @@ backend_get_impl_type (void) #endif #ifdef WITH_GCRYPT - if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS) && + if ((g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS) || g_getenv ("SNAP_NAME") != NULL) && _secret_file_backend_check_portal_version ()) extension_name = "file"; else diff --git a/libsecret/secret-file-backend.c b/libsecret/secret-file-backend.c index 649ef0d..ad19347 100644 --- a/libsecret/secret-file-backend.c +++ b/libsecret/secret-file-backend.c @@ -488,7 +488,7 @@ secret_file_backend_real_init_async (GAsyncInitable *initable, NULL); g_object_unref (file); secret_value_unref (password); - } else if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS)) { + } else if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS) || g_getenv ("SNAP_NAME") != NULL) { init = g_slice_new0 (InitClosure); init->io_priority = io_priority; init->file = file;