From: Christian Ratzenhofer Date: Tue, 6 Apr 2021 12:39:11 +0000 (+0200) Subject: templates/*.in: fixed PATH handling with spaces X-Git-Tag: lxc-5.0.0~217^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3772%2Fhead;p=thirdparty%2Flxc.git templates/*.in: fixed PATH handling with spaces if $PATH already contains a path with a space the append of the default directories in all template scripts fails with an error like the following: /usr/share/lxc/templates/lxc-download: 69: export: (x86)/NVIDIA: bad variable name Signed-off-by: Christian Ratzenhofer --- diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in index 1a8618b1a..266be60cc 100644 --- a/templates/lxc-busybox.in +++ b/templates/lxc-busybox.in @@ -26,7 +26,7 @@ LXC_MAPPED_GID= BUSYBOX_EXE=`which busybox` # Make sure the usual locations are in PATH -export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin +export PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" in_userns() { [ -e /proc/self/uid_map ] || { echo no; return; } diff --git a/templates/lxc-download.in b/templates/lxc-download.in index d688b8f41..72903c497 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -66,7 +66,7 @@ if [ -z "${DOWNLOAD_KEYSERVER:-}" ]; then fi # Make sure the usual locations are in PATH -export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin +export PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" # Some useful functions cleanup() { diff --git a/templates/lxc-local.in b/templates/lxc-local.in index 2e96d63eb..f94a150c7 100644 --- a/templates/lxc-local.in +++ b/templates/lxc-local.in @@ -33,7 +33,7 @@ MODE="system" COMPAT_LEVEL=5 # Make sure the usual locations are in PATH -export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin +export PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" in_userns() { [ -e /proc/self/uid_map ] || { echo no; return; } diff --git a/templates/lxc-oci.in b/templates/lxc-oci.in index dab077191..a46949b68 100644 --- a/templates/lxc-oci.in +++ b/templates/lxc-oci.in @@ -23,7 +23,7 @@ set -eu # Make sure the usual locations are in PATH -export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin +export PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" # Check for required binaries for bin in skopeo umoci jq; do