summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolchain/3rd-party-g++.in5
-rw-r--r--toolchain/3rd-party-gcc.in5
2 files changed, 10 insertions, 0 deletions
diff --git a/toolchain/3rd-party-g++.in b/toolchain/3rd-party-g++.in
index 17d3374..7c0fa78 100644
--- a/toolchain/3rd-party-g++.in
+++ b/toolchain/3rd-party-g++.in
@@ -1,4 +1,9 @@
#!/bin/sh
+# Reject attempts to include or link host paths.
+if echo " $* " | grep -qE '[[:space:]]-[IL][[:space:]]*(/+usr)?/+((local|X11R6)/+)?(include|lib)'; then
+ echo "$0: poisoned host path detected: $*" >&2
+ exit 1
+fi
exec \
"${ANDROID_TOOLCHAIN}/@CXX@" \
@CXXFLAGS@ \
diff --git a/toolchain/3rd-party-gcc.in b/toolchain/3rd-party-gcc.in
index 3d797aa..3a03f13 100644
--- a/toolchain/3rd-party-gcc.in
+++ b/toolchain/3rd-party-gcc.in
@@ -1,4 +1,9 @@
#!/bin/sh
+# Reject attempts to include or link host paths.
+if echo " $* " | grep -qE '[[:space:]]-[IL][[:space:]]*(/+usr)?/+((local|X11R6)/+)?(include|lib)'; then
+ echo "$0: poisoned host path detected: $*" >&2
+ exit 1
+fi
exec \
"${ANDROID_TOOLCHAIN}/@CC@" \
@CFLAGS@ \