diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-08-22 12:47:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 12:47:33 +0200 |
commit | 33aca20616adb872dfab1b3852fe58b948783cd2 (patch) | |
tree | 5bb46b9b71315986f03b3c1e33d62aec1572f04f | |
parent | d5e979ab87ab894fde132799dac242780b28bc05 (diff) | |
parent | 380bf60c2ef2e364b8ea5c02e9687a601595302b (diff) |
Merge pull request #6916 from edolstra/tmp-slash
Installer: Don't assume TMPDIR ends in a slash
-rw-r--r-- | scripts/install-multi-user.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh index a9f3e74dc..01dbf0c0e 100644 --- a/scripts/install-multi-user.sh +++ b/scripts/install-multi-user.sh @@ -348,8 +348,12 @@ _sudo() { fi } +# Ensure that $TMPDIR exists if defined. +if [[ -n "${TMPDIR:-}" ]] && [[ ! -d "${TMPDIR:-}" ]]; then + mkdir -m 0700 -p "${TMPDIR:-}" +fi -readonly SCRATCH=$(mktemp -d "${TMPDIR:-/tmp/}tmp.XXXXXXXXXX") +readonly SCRATCH=$(mktemp -d) finish_cleanup() { rm -rf "$SCRATCH" } |