Skip to content
Snippets Groups Projects
Commit 2debb5f4 authored by Simon McVittie's avatar Simon McVittie
Browse files

FlatpakExports: Modify to use pressure-vessel's list of reserved paths

pressure-vessel reserves more paths than Flatpak does, and we need to
avoid all of them. For most of the code paths that set up exports,
we will avoid the paths anyway (in order to log warnings), but as a
fallback, it would be good to be sure that every possible reason for
paths to be exported is covered.

steamrt/tasks#434

Helps: https://github.com/ValveSoftware/steam-for-linux/issues/10789


Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 3df8290c
No related branches found
No related tags found
1 merge request!706pv-wrap: Improve handling of paths that cannot be exported
......@@ -55,6 +55,9 @@
#include "flatpak-utils-private.h"
#include "flatpak-error.h"
/* pressure-vessel-specific */
#include "pressure-vessel/utils.h"
/* To keep this more similar to the original file, we explicitly disable
* these warnings rather than fixing them */
#if defined(__GNUC__) && __GNUC__ >= 8
......@@ -67,8 +70,6 @@
flatpak_abs_usrmerged_dirs get the same treatment without having to be listed
here. */
const char *dont_export_in[] = {
/* This first line is pressure-vessel-specific */
"/overrides", "/run/pressure-vessel", "/var/pressure-vessel",
/*
* pressure-vessel-specific note:
* When merging from Flatpak, make sure any new paths here are copied
......@@ -891,6 +892,7 @@ _exports_path_expose (FlatpakExports *exports,
int level)
{
g_autofree char *canonical = NULL;
const char * const *pv_reserved_paths;
struct stat st;
struct statfs stfs;
char *slash;
......@@ -961,12 +963,15 @@ _exports_path_expose (FlatpakExports *exports,
/* Syntactic canonicalization only, no need to use host_fd */
path = canonical = flatpak_canonicalize_filename (path);
for (i = 0; dont_export_in[i] != NULL; i++)
/* pressure-vessel-specific: Use a longer list of reserved paths */
pv_reserved_paths = pv_get_reserved_paths ();
for (i = 0; pv_reserved_paths[i] != NULL; i++)
{
/* Don't expose files in non-mounted dirs like /app or /usr, as
they are not the same as on the host, and we generally can't
create the parents for them anyway */
if (flatpak_has_path_prefix (path, dont_export_in[i]))
if (flatpak_has_path_prefix (path, pv_reserved_paths[i]))
{
g_debug ("skipping export for path %s in unsupported prefix", path);
return FALSE;
......
......@@ -8,6 +8,7 @@
#include "steam-runtime-tools/glib-backports-internal.h"
#include "steam-runtime-tools/utils-internal.h"
#include "pressure-vessel/utils.h"
static Tristate
tristate_environment (const gchar *name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment