diff --git a/lib/core.sh b/lib/core.sh index 250917d..bf13710 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -94,7 +94,7 @@ ORIGIN_WD=$(pwd) SH=("/bin/sh" "--login") # List of executables that are run in the host OS: -PROOT_COMPAT="${JUNEST_HOME}/opt/proot/proot-${ARCH}" +PROOT="${JUNEST_HOME}/opt/proot/proot-${ARCH}" CHROOT=${JUNEST_BASE}/bin/jchroot CLASSIC_CHROOT="chroot" WGET="wget --no-check-certificate" @@ -127,12 +127,12 @@ function mkdir_cmd(){ function proot_cmd(){ local proot_args="$1" shift - if ${PROOT_COMPAT} ${proot_args} "${SH[@]}" "-c" ":" + if ${PROOT} ${proot_args} "${SH[@]}" "-c" ":" then - ${PROOT_COMPAT} ${proot_args} "${@}" - elif PROOT_NO_SECCOMP=1 ${PROOT_COMPAT} ${proot_args} "${SH[@]}" "-c" ":" + ${PROOT} ${proot_args} "${@}" + elif PROOT_NO_SECCOMP=1 ${PROOT} ${proot_args} "${SH[@]}" "-c" ":" then - PROOT_NO_SECCOMP=1 ${PROOT_COMPAT} ${proot_args} "${@}" + PROOT_NO_SECCOMP=1 ${PROOT} ${proot_args} "${@}" else die "Error: Check if the ${CMD} arguments are correct and if the kernel is too old use the option ${CMD} -p \"-k 3.10\"" fi diff --git a/tests/test_core.sh b/tests/test_core.sh index d73a613..bd57032 100755 --- a/tests/test_core.sh +++ b/tests/test_core.sh @@ -299,11 +299,11 @@ function test_run_env_as_user_proot_args(){ } function test_run_env_with_proot_compat(){ - PROOT_COMPAT="/bin/true" + PROOT="/bin/true" _run_env_with_proot "" "" &> /dev/null assertEquals 0 $? - $(PROOT_COMPAT="/bin/false" _run_env_with_proot --helps 2> /dev/null) + $(PROOT="/bin/false" _run_env_with_proot --helps 2> /dev/null) assertEquals 1 $? } @@ -322,14 +322,14 @@ function test_run_proot_seccomp(){ envv(){ env } - PROOT_COMPAT=envv + PROOT=envv local output=$(proot_cmd | grep "^PROOT_NO_SECCOMP") assertEquals "" "$output" envv(){ env | grep "^PROOT_NO_SECCOMP" } - PROOT_COMPAT=envv + PROOT=envv local output=$(proot_cmd | grep "^PROOT_NO_SECCOMP") # The variable PROOT_NO_SECCOMP will be produced # twice due to the fallback mechanism