mirror of
https://github.com/flatpak/flatpak.git
synced 2026-09-26 23:25:59 -04:00
portal: Pass run-environ to the spawned flatpak process, not the sandbox
Instead of modifying the host-like run environment to clear the sandbox environment, we'll use the new --clear-env flag which does the correct thing. Assisted-by: Claude:opus-4.6 Closes: #5271
This commit is contained in:
1 parent
7322a05c7f
commit
afbabdc32c
1 file changed
+3
-11
+3
-11
@@ -917,17 +917,6 @@ handle_spawn (PortalFlatpak *object,
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Ideally we should let `flatpak run` inherit the run environment
|
||||
* of the instance, in case e.g. a LD_LIBRARY_PATH is needed to be able
|
||||
* to run `flatpak run`, but tell it to start from a blank environment
|
||||
* when running the Flatpak app; but this isn't currently possible, so
|
||||
* for now we preserve existing behaviour. */
|
||||
if (arg_flags & FLATPAK_SPAWN_FLAGS_CLEAR_ENV)
|
||||
{
|
||||
char *empty[] = { NULL };
|
||||
env = g_strdupv (empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
static const char * const mock_run_environ[] = { "FOO=bar", NULL };
|
||||
|
||||
@@ -965,6 +954,9 @@ handle_spawn (PortalFlatpak *object,
|
||||
|
||||
g_ptr_array_add (flatpak_argv, g_strdup ("run"));
|
||||
|
||||
if (arg_flags & FLATPAK_SPAWN_FLAGS_CLEAR_ENV)
|
||||
g_ptr_array_add (flatpak_argv, g_strdup ("--clear-env"));
|
||||
|
||||
sandboxed = (arg_flags & FLATPAK_SPAWN_FLAGS_SANDBOX) != 0;
|
||||
|
||||
if (sandboxed)
|
||||
|
||||
Reference in new issue
Block a user