From 655d10ed7f4eff465cf2be1f0a3664f86df7b83c Mon Sep 17 00:00:00 2001 From: Christian Ratzenhofer Date: Tue, 6 Apr 2021 14:39:11 +0200 Subject: [PATCH] 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 --- templates/lxc-busybox.in | 2 +- templates/lxc-download.in | 2 +- templates/lxc-local.in | 2 +- templates/lxc-oci.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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