]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Ensure that we enter the chroot only in our own NS
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Jul 2024 17:07:41 +0000 (17:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jul 2024 15:39:43 +0000 (15:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 2c231fdd75614b4cbcb8fabf516f392b123dc4a8..afd117b63386460f0798fc6a50ccb2793f145130 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -494,6 +494,11 @@ enterchroot() {
 
        local PATH="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin"
 
+       # Check if we are running in our namespace
+       if [ -z "${IN_NAMESPACE}" ]; then
+               exiterror "Not running in namespace"
+       fi
+
        # Prepend any custom changes to PATH
        if [ -n "${CUSTOM_PATH}" ]; then
                PATH="${CUSTOM_PATH}:${PATH}"