mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 13:24:23 +00:00
fix download template for /tmp as tmpfs or noexec
* prepend $LXC_PATH to $DOWNLOAD_TEMP on systems with /tmp mounted securely as a small tmpfs / noexec * gpg_setup() creates $DOWNLOAD_TEMP so remove superflous mkdir * fixes https://github.com/lxc/lxc/issues/516 Signed-off-by: Stuart Cardall <developer@it-offshore.co.uk>
This commit is contained in:
parent
1401329e77
commit
edb5452cec
@ -46,6 +46,7 @@ DOWNLOAD_URL=
|
|||||||
DOWNLOAD_USE_CACHE="false"
|
DOWNLOAD_USE_CACHE="false"
|
||||||
DOWNLOAD_VALIDATE="true"
|
DOWNLOAD_VALIDATE="true"
|
||||||
DOWNLOAD_VARIANT="default"
|
DOWNLOAD_VARIANT="default"
|
||||||
|
DOWNLOAD_TEMP=
|
||||||
|
|
||||||
LXC_MAPPED_GID=
|
LXC_MAPPED_GID=
|
||||||
LXC_MAPPED_UID=
|
LXC_MAPPED_UID=
|
||||||
@ -311,11 +312,15 @@ fi
|
|||||||
# Trap all exit signals
|
# Trap all exit signals
|
||||||
trap cleanup EXIT HUP INT TERM
|
trap cleanup EXIT HUP INT TERM
|
||||||
|
|
||||||
|
# /tmp may be mounted in tmpfs or noexec
|
||||||
|
if mountpoint -q /tmp; then
|
||||||
|
DOWNLOAD_TEMP="${LXC_PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! command -V mktemp >/dev/null 2>&1; then
|
if ! command -V mktemp >/dev/null 2>&1; then
|
||||||
DOWNLOAD_TEMP=/tmp/lxc-download.$$
|
DOWNLOAD_TEMP="${DOWNLOAD_TEMP}/tmp/lxc-download.$$"
|
||||||
mkdir -p "${DOWNLOAD_TEMP}"
|
|
||||||
else
|
else
|
||||||
DOWNLOAD_TEMP=$(mktemp -d)
|
DOWNLOAD_TEMP="${DOWNLOAD_TEMP}$(mktemp -d)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Simply list images
|
# Simply list images
|
||||||
|
Loading…
Reference in New Issue
Block a user