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

pv-wrap: Automatically use Flatpak sub-sandboxing if Flatpak is 1.11.x


Now that the ability to specify a custom path for /usr and /app has
been merged into Flatpak git master, we can mostly assume that if the
user has a git snapshot of Flatpak, they have that feature available.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 1a39648f
No related branches found
No related tags found
1 merge request!292Improve Flatpak sub-sandboxing support
...@@ -1078,14 +1078,6 @@ main (int argc, ...@@ -1078,14 +1078,6 @@ main (int argc,
g_debug ("Using \"%s\" as /app instead of runtime", opt_app_path); g_debug ("Using \"%s\" as /app instead of runtime", opt_app_path);
g_assert (api == &subsandbox_api); g_assert (api == &subsandbox_api);
if (g_getenv ("PRESSURE_VESSEL_FLATPAK_PR4018") == NULL)
{
glnx_throw (error,
"--app-path requires an experimental branch of Flatpak");
goto out;
}
check_portal_version ("app-path", 6); check_portal_version ("app-path", 6);
if (opt_app_path[0] == '\0') if (opt_app_path[0] == '\0')
...@@ -1113,14 +1105,6 @@ main (int argc, ...@@ -1113,14 +1105,6 @@ main (int argc,
g_debug ("Using %s as /usr instead of runtime", opt_usr_path); g_debug ("Using %s as /usr instead of runtime", opt_usr_path);
g_assert (api == &subsandbox_api); g_assert (api == &subsandbox_api);
if (g_getenv ("PRESSURE_VESSEL_FLATPAK_PR4018") == NULL)
{
glnx_throw (error,
"--usr-path requires an experimental branch of Flatpak");
goto out;
}
check_portal_version ("usr-path", 6); check_portal_version ("usr-path", 6);
handle = path_to_handle (fd_list, opt_usr_path, home_realpath, handle = path_to_handle (fd_list, opt_usr_path, home_realpath,
......
...@@ -149,11 +149,18 @@ pv_wrap_check_flatpak (const char *tools_dir, ...@@ -149,11 +149,18 @@ pv_wrap_check_flatpak (const char *tools_dir,
"pressure-vessel-launch", "pressure-vessel-launch",
NULL); NULL);
if (flatpak_version != NULL && strverscmp (flatpak_version, "1.11.0") >= 0)
{
g_warning ("Using experimental Flatpak sub-sandboxing "
"(requires Flatpak 1.11.x commit 1.10.1-65-g3ebf371f "
"or later)");
subsandbox = get_subsandbox_adverb (launch_executable);
}
/* Deliberately not documented: only people who are in a position /* Deliberately not documented: only people who are in a position
* to run their own modified versions of Flatpak and pressure-vessel * to run their own modified versions of Flatpak and pressure-vessel
* should be using this, and those people can find this in the * should be using this, and those people can find this in the
* source code */ * source code */
if (g_getenv ("PRESSURE_VESSEL_FLATPAK_PR4018") != NULL) else if (g_getenv ("PRESSURE_VESSEL_FLATPAK_PR4018") != NULL)
{ {
g_warning ("Assuming your version of Flatpak contains unmerged " g_warning ("Assuming your version of Flatpak contains unmerged "
"changes (#4018, #4125, #4126, #4093)"); "changes (#4018, #4125, #4126, #4093)");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment