]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
call mktemp with `-t XXXXXX` for compatibility with older BSD versions
authorLukas Schauer <lukas@schauer.so>
Sat, 9 Jan 2016 00:38:44 +0000 (01:38 +0100)
committerLukas Schauer <lukas@schauer.so>
Sat, 9 Jan 2016 00:38:44 +0000 (01:38 +0100)
letsencrypt.sh

index 0c086688f972f77d9fe74f233467fd5d4779f0a8..af0597f96556096372b88914e818038960263e3d 100755 (executable)
@@ -14,7 +14,7 @@ check_dependencies() {
   openssl version > /dev/null 2>&1 || _exiterr "This script requres an openssl binary."
   sed "" < /dev/null > /dev/null 2>&1 || _exiterr "This script requres sed."
   grep -V > /dev/null 2>&1 || _exiterr "This script requres grep."
-  mktemp -u > /dev/null 2>&1 || _exiterr "This script requires mktemp."
+  mktemp -u -t XXXXXX > /dev/null 2>&1 || _exiterr "This script requires mktemp."
 }
 
 # Setup default config values, search for and load configuration files
@@ -171,7 +171,7 @@ _openssl() {
 
 # Send http(s) request with specified method
 http_request() {
-  tempcont="$(mktemp)"
+  tempcont="$(mktemp -t XXXXXX)"
 
   if [[ "${1}" = "head" ]]; then
     statuscode="$(curl -s -w "%{http_code}" -o "${tempcont}" "${2}" -I)"
@@ -261,7 +261,7 @@ sign_domain() {
   done
   SAN="${SAN%%, }"
   local tmp_openssl_cnf
-  tmp_openssl_cnf="$(mktemp)"
+  tmp_openssl_cnf="$(mktemp -t XXXXXX)"
   cat "${OPENSSL_CNF}" > "${tmp_openssl_cnf}"
   printf "[SAN]\nsubjectAltName=%s" "${SAN}" >> "${tmp_openssl_cnf}"
   openssl req -new -sha256 -key "${BASEDIR}/certs/${domain}/${privkey}" -out "${BASEDIR}/certs/${domain}/cert-${timestamp}.csr" -subj "/CN=${domain}/" -reqexts SAN -config "${tmp_openssl_cnf}"
@@ -368,7 +368,7 @@ command_sign_domains() {
   init_system
 
   if [[ -n "${PARAM_DOMAIN:-}" ]]; then
-    DOMAINS_TXT="$(mktemp)"
+    DOMAINS_TXT="$(mktemp -t XXXXXX)"
     printf -- "${PARAM_DOMAIN}" > "${DOMAINS_TXT}"
   elif [[ -e "${BASEDIR}/domains.txt" ]]; then
     DOMAINS_TXT="${BASEDIR}/domains.txt"