Handle snaps the same way as flatpaks

This commit is contained in:
Sebastien Bacher 2021-02-19 09:16:23 +01:00
parent 903b68b116
commit 1298c7812c
2 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ backend_get_impl_type (void)
#endif #endif
#ifdef WITH_GCRYPT #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 ()) _secret_file_backend_check_portal_version ())
extension_name = "file"; extension_name = "file";
else else

View File

@ -488,7 +488,7 @@ secret_file_backend_real_init_async (GAsyncInitable *initable,
NULL); NULL);
g_object_unref (file); g_object_unref (file);
secret_value_unref (password); 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 = g_slice_new0 (InitClosure);
init->io_priority = io_priority; init->io_priority = io_priority;
init->file = file; init->file = file;