From 15b20e644b407602288402f97fc348b00921cc54 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sat, 27 Jan 2018 11:04:11 +0100 Subject: Don't let host PATH leak into the target commands This fixes debootstrap on Fedora host, with unified /usr and PATH lacking /bin and /sbin. --- functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions b/functions index 43969ee..b780488 100644 --- a/functions +++ b/functions @@ -976,7 +976,7 @@ extract () { ( ); } in_target_nofail () { - if ! $CHROOT_CMD "$@" 2>/dev/null; then + if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD "$@" 2>/dev/null; then true fi return 0 @@ -987,7 +987,7 @@ in_target_failmsg () { local msg="$2" local arg="$3" shift; shift; shift - if ! $CHROOT_CMD "$@"; then + if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD "$@"; then warning "$code" "$msg" "$arg" # Try to point user at actual failing package. msg="See %s for details" -- cgit v0.12