mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 10:35:36 +00:00
fix PATH variable being empty in trapped function
Signed-off-by: Tin Lai <oscar@tinyiu.com>
This commit is contained in:
parent
507502dc1a
commit
498320de8a
3 changed files with 4 additions and 0 deletions
|
|
@ -103,6 +103,7 @@ function run_env_as_bwrap_fakeroot(){
|
|||
|
||||
# Fix PATH to /usr/bin to make sudo working and avoid polluting with host related bin paths
|
||||
# shellcheck disable=SC2086
|
||||
local JUNEST_ORIGINAL_PATH="$PATH"
|
||||
PATH="/usr/bin" BWRAP="${backend_command}" JUNEST_ENV=1 bwrap_cmd $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 $backend_args sudo "${DEFAULT_SH[@]}" "${args[@]}"
|
||||
}
|
||||
|
||||
|
|
@ -153,6 +154,7 @@ function run_env_as_bwrap_user() {
|
|||
|
||||
# Resets PATH to avoid polluting with host related bin paths
|
||||
# shellcheck disable=SC2086
|
||||
local JUNEST_ORIGINAL_PATH="$PATH"
|
||||
PATH='' BWRAP="${backend_command}" JUNEST_ENV=1 bwrap_cmd $COMMON_BWRAP_OPTION $backend_args "${DEFAULT_SH[@]}" "${args[@]}"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ function _run_env_with_proot(){
|
|||
[[ "$1" != "" ]] && args=("-c" "$(insert_quotes_on_spaces "${@}")")
|
||||
|
||||
# Resets PATH to avoid polluting with host related bin paths
|
||||
local JUNEST_ORIGINAL_PATH="$PATH"
|
||||
PATH='' PROOT="${backend_command}" JUNEST_ENV=1 proot_cmd "${backend_args}" "${DEFAULT_SH[@]}" "${args[@]}"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
# None
|
||||
#######################################
|
||||
function create_wrappers() {
|
||||
local PATH="${JUNEST_ORIGINAL_PATH:-"$PATH"}"
|
||||
local force=${1:-false}
|
||||
local bin_path=${2:-/usr/bin}
|
||||
bin_path=${bin_path%/}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue