mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 02:34:30 +00:00
Change the name of proot variable
This commit is contained in:
parent
0ecd1b297b
commit
d36093b0f5
2 changed files with 9 additions and 9 deletions
10
lib/core.sh
10
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue