summaryrefslogtreecommitdiff
path: root/Ports/.strip_env.sh
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-05-19 23:28:43 +0200
committerAndreas Kling <kling@serenityos.org>2022-05-21 18:12:07 +0200
commit7550017f97d7892f8b7d26074046a87144f491dd (patch)
tree4b5cd7b69598b005abd8c298f30e97c61cc3d96d /Ports/.strip_env.sh
parentbdac8c53ea7f96809e70f7a74a1828c71858b43b (diff)
downloadserenity-7550017f97d7892f8b7d26074046a87144f491dd.zip
Ports: Sanitize environment before handling Ports
This keeps users from leaking their host environment variables (CFLAGS, etc.) into Ports, and it keeps us from leaking Port-specific settings into their dependencies.
Diffstat (limited to 'Ports/.strip_env.sh')
-rwxr-xr-xPorts/.strip_env.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/Ports/.strip_env.sh b/Ports/.strip_env.sh
new file mode 100755
index 0000000000..54265ae791
--- /dev/null
+++ b/Ports/.strip_env.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+exec env -i SERENITY_STRIPPED_ENV=1 \
+ MAKEJOBS="${MAKEJOBS:-}" \
+ IN_SERENITY_PORT_DEV="${IN_SERENITY_PORT_DEV:-}" \
+ SERENITY_ARCH="${SERENITY_ARCH:-}" \
+ SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-}" \
+ "${@}"