mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 04:38:55 +00:00
secret-backend: Allow override the backend also under Flatpak/Snap
This can help applications, which rely on certain behavior, like when multiple processes are accessing the secrets and expect that secrets saved by one process can be read by another process. It also adds consistency, to be able to change the backend with the host system libsecret and sandboxed libsecret. Related to https://gitlab.gnome.org/GNOME/libsecret/-/issues/62
This commit is contained in:
parent
cc309e255a
commit
51725df97d
@ -152,18 +152,16 @@ backend_get_impl_type (void)
|
||||
g_type_ensure (secret_file_backend_get_type ());
|
||||
#endif
|
||||
|
||||
envvar = g_getenv ("SECRET_BACKEND");
|
||||
if (envvar == NULL || *envvar == '\0') {
|
||||
extension_name = "service";
|
||||
#ifdef WITH_CRYPTO
|
||||
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
|
||||
if ((g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS) || g_getenv ("SNAP_NAME") != NULL) &&
|
||||
_secret_file_backend_check_portal_version ())
|
||||
extension_name = "file";
|
||||
#endif
|
||||
{
|
||||
envvar = g_getenv ("SECRET_BACKEND");
|
||||
if (envvar == NULL || *envvar == '\0')
|
||||
extension_name = "service";
|
||||
else
|
||||
extension_name = envvar;
|
||||
} else {
|
||||
extension_name = envvar;
|
||||
}
|
||||
|
||||
ep = g_io_extension_point_lookup (SECRET_BACKEND_EXTENSION_POINT_NAME);
|
||||
|
Loading…
Reference in New Issue
Block a user