Package: debootstrap
Version: 1.0.114
Severity: normal

The following patch fixes issues when the hard-coded 
PATH=/sbin:/usr/sbin:/bin:/usr/bin does not contain chroot or other
commonly used utilities, by changing to PATH=$PATH:/sbin:...

live well,
  vagrant

From 05a3241df281608b710c71e41d9a03d99cc68109 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@debian.org>
Date: Sun, 2 Jun 2019 10:57:29 -0700
Subject: [PATCH] Support distros with unconventional PATH values by adding
 $PATH to calls in in_target_failmsg and in_target_nofail.

Add the $PATH environment variable to the chroot call, otherwise this
fails on foreign distros where PATH=/sbin:/usr/sbin:/bin:/usr/bin does
not contain common utilities such as chroot and other used utilities.
---
 functions | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/functions b/functions
index 6b93617..ed3fc99 100644
--- a/functions
+++ b/functions
@@ -1041,7 +1041,7 @@ extract () { (
 ); }
 
 in_target_nofail () {
-	if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\"" 2>/dev/null; then
+	if ! PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\"" 2>/dev/null; then
 		true
 	fi
 	return 0
@@ -1053,7 +1053,7 @@ in_target_failmsg () {
 	msg="$2"
 	arg="$3"
 	shift; shift; shift
-	if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\""; then
+	if ! PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\""; then
 		warning "$code" "$msg" "$arg"
 		# Try to point user at actual failing package.
 		msg="See %s for details"
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

Reply via email to