mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-24 16:57:42 -04:00
Make sure /var/tmp is not on tmpfs
Apps may rely on /var/tmp not being in ram, for instance when downloading large files. See for instance: http://0pointer.net/blog/projects/tmp.html We make /var/tmp point to ~/.var/app/cache/tmp so that each app get its own instane, and so that its cleared whe removing xdg-cache-dir for the app.
This commit is contained in:
@@ -2829,6 +2829,7 @@ flatpak_ensure_data_dir (const char *app_id,
|
||||
g_autoptr(GFile) dir = flatpak_get_data_dir (app_id);
|
||||
g_autoptr(GFile) data_dir = g_file_get_child (dir, "data");
|
||||
g_autoptr(GFile) cache_dir = g_file_get_child (dir, "cache");
|
||||
g_autoptr(GFile) tmp_dir = g_file_get_child (cache_dir, "tmp");
|
||||
g_autoptr(GFile) config_dir = g_file_get_child (dir, "config");
|
||||
|
||||
if (!flatpak_mkdir_p (data_dir, cancellable, error))
|
||||
@@ -2837,6 +2838,9 @@ flatpak_ensure_data_dir (const char *app_id,
|
||||
if (!flatpak_mkdir_p (cache_dir, cancellable, error))
|
||||
return NULL;
|
||||
|
||||
if (!flatpak_mkdir_p (tmp_dir, cancellable, error))
|
||||
return NULL;
|
||||
|
||||
if (!flatpak_mkdir_p (config_dir, cancellable, error))
|
||||
return NULL;
|
||||
|
||||
@@ -3797,6 +3801,7 @@ flatpak_run_setup_base_argv (GPtrArray *argv_array,
|
||||
if (app_id_dir != NULL)
|
||||
{
|
||||
g_autoptr(GFile) app_cache_dir = g_file_get_child (app_id_dir, "cache");
|
||||
g_autoptr(GFile) app_tmp_dir = g_file_get_child (app_cache_dir, "tmp");
|
||||
g_autoptr(GFile) app_data_dir = g_file_get_child (app_id_dir, "data");
|
||||
g_autoptr(GFile) app_config_dir = g_file_get_child (app_id_dir, "config");
|
||||
|
||||
@@ -3805,6 +3810,7 @@ flatpak_run_setup_base_argv (GPtrArray *argv_array,
|
||||
"--bind", flatpak_file_get_path_cached (app_cache_dir), "/var/cache",
|
||||
"--bind", flatpak_file_get_path_cached (app_data_dir), "/var/data",
|
||||
"--bind", flatpak_file_get_path_cached (app_config_dir), "/var/config",
|
||||
"--bind", flatpak_file_get_path_cached (app_tmp_dir), "/var/tmp",
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user