[gnome-builder] flatpak: don't pass PATH environment variable to subprocess



commit 630bba8efe0055bcf530abb93f1dc0b828f526f3
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 21 15:58:36 2017 -0800

    flatpak: don't pass PATH environment variable to subprocess
    
    We don't want to pass PATH along because it can only mess things up.

 plugins/flatpak/gbp-flatpak-subprocess-launcher.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-subprocess-launcher.c 
b/plugins/flatpak/gbp-flatpak-subprocess-launcher.c
index 6975733..cf1d9e9 100644
--- a/plugins/flatpak/gbp-flatpak-subprocess-launcher.c
+++ b/plugins/flatpak/gbp-flatpak-subprocess-launcher.c
@@ -41,6 +41,13 @@ gbp_flatpak_subprocess_launcher_spawn (IdeSubprocessLauncher  *launcher,
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   /*
+   * Don't allow PATH to be set when traversing "flatpak build" from the default
+   * IdeSubprocessLauncher. We need to ensure that /app/bin is available.
+   */
+  if (ide_subprocess_launcher_get_clear_env (launcher))
+    ide_subprocess_launcher_setenv (launcher, "PATH", "/app/bin:/bin:/usr/bin", TRUE);
+
+  /*
    * The "flatpak build" command will filter out all of our environment variables
    * from the subprocess. So we need to look at our configured environment and
    * convert the KEY=VALUE pairs into --env=key=value command line arguments.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]