mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-18 21:55:22 -04:00
Pass host xdg dirs into the sandbox
There are some use cases where apps might legitimately need
to know the host values of xdg variables. Since we use them
for our own purposes, we can't just propagate them as-is.
Instead, set HOST_XDG_{DATA,CONFIG,CACHE}_HOME if the corresponding
xdg variables are set on the host.
Closes: #2424
Closes: #2440
Approved by: alexlarsson
This commit is contained in:
committed by
Atomic Bot
parent
d13211f5e6
commit
2a8a0ec69a
@@ -1318,6 +1318,13 @@ flatpak_run_apply_env_appid (FlatpakBwrap *bwrap,
|
||||
flatpak_bwrap_set_env (bwrap, "XDG_DATA_HOME", flatpak_file_get_path_cached (app_dir_data), TRUE);
|
||||
flatpak_bwrap_set_env (bwrap, "XDG_CONFIG_HOME", flatpak_file_get_path_cached (app_dir_config), TRUE);
|
||||
flatpak_bwrap_set_env (bwrap, "XDG_CACHE_HOME", flatpak_file_get_path_cached (app_dir_cache), TRUE);
|
||||
|
||||
if (g_getenv ("XDG_DATA_HOME"))
|
||||
flatpak_bwrap_set_env (bwrap, "HOST_XDG_DATA_HOME", g_getenv ("XDG_DATA_HOME"), TRUE);
|
||||
if (g_getenv ("XDG_CONFIG_HOME"))
|
||||
flatpak_bwrap_set_env (bwrap, "HOST_XDG_CONFIG_HOME", g_getenv ("XDG_CONFIG_HOME"), TRUE);
|
||||
if (g_getenv ("XDG_CACHE_HOME"))
|
||||
flatpak_bwrap_set_env (bwrap, "HOST_XDG_CACHE_HOME", g_getenv ("XDG_CACHE_HOME"), TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user