update-ca-certificates: compat with non-GNU mktemp(1)

BSD and BusyBox lacks --tmpdir support.

Emulate it with -p instead.

Close bugs #1000847

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
This commit is contained in:
Đoàn Trần Công Danh 2021-11-30 17:26:24 +07:00
parent 07de54fdcc
commit 17b759d697

View file

@ -81,8 +81,8 @@ trap cleanup 0
# Helper files. (Some of them are not simple arrays because we spawn
# subshells later on.)
TEMPBUNDLE="${ETCCERTSDIR}/${CERTBUNDLE}.new"
ADDED="$(mktemp --tmpdir "ca-certificates.tmp.XXXXXX")"
REMOVED="$(mktemp --tmpdir "ca-certificates.tmp.XXXXXX")"
ADDED="$(mktemp -p "${TMPDIR:-/tmp}" "ca-certificates.tmp.XXXXXX")"
REMOVED="$(mktemp -p "${TMPDIR:-/tmp}" "ca-certificates.tmp.XXXXXX")"
# Adds a certificate to the list of trusted ones. This includes a symlink
# in /etc/ssl/certs to the certificate file and its inclusion into the