From 5c3ec72ee2c2f5a0d6d942b0998ba8cc3369f608 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 12 Sep 2008 02:19:28 -0400 Subject: [PATCH] making invocations of mktemp portable (FreeBSD does not have a default value for the [template] arg --- packaging/freebsd/distinfo | 6 +++--- src/common | 2 +- src/monkeysphere | 4 ++-- src/monkeysphere-server | 4 ++-- utils/build-releasenote | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packaging/freebsd/distinfo b/packaging/freebsd/distinfo index 9a5c490..9716554 100644 --- a/packaging/freebsd/distinfo +++ b/packaging/freebsd/distinfo @@ -1,3 +1,3 @@ -MD5 (monkeysphere_0.16~pre.orig.tar.gz) = 3f996607a31f8e94a20982ae9424abe3 -SHA256 (monkeysphere_0.16~pre.orig.tar.gz) = a601f531ba48013e7ec09d27507c909243f908b1bac224653681bb0d2be03b72 -SIZE (monkeysphere_0.16~pre.orig.tar.gz) = 58130 +MD5 (monkeysphere_0.16~pre.orig.tar.gz) = cc02c34932b781bb2436f54d99fde2cc +SHA256 (monkeysphere_0.16~pre.orig.tar.gz) = b54f66a2aed82864d22348800752e3881633af0aa4692beb367c88c8a4c4bc31 +SIZE (monkeysphere_0.16~pre.orig.tar.gz) = 58172 diff --git a/src/common b/src/common index 556dd5a..c8a7db6 100644 --- a/src/common +++ b/src/common @@ -726,7 +726,7 @@ process_host_known_hosts() { if [ "$HASH_KNOWN_HOSTS" = 'true' ] ; then # FIXME: this is really hackish cause ssh-keygen won't # hash from stdin to stdout - tmpfile=$(mktemp) + tmpfile=$(mktemp ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) ssh2known_hosts "$host" "$sshKey" > "$tmpfile" ssh-keygen -H -f "$tmpfile" 2> /dev/null cat "$tmpfile" >> "$KNOWN_HOSTS" diff --git a/src/monkeysphere b/src/monkeysphere index 512d608..36b44dd 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -147,7 +147,7 @@ EOF ) log verbose "generating subkey..." - fifoDir=$(mktemp -d) + fifoDir=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) (umask 077 && mkfifo "$fifoDir/pass") echo "$editCommands" | gpg --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --edit-key "$keyID" & @@ -210,7 +210,7 @@ You might want to run 'gpg --gen-key'." You might want to 'monkeysphere gen-subkey'" fi - workingdir=$(mktemp -d) + workingdir=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) umask 077 mkfifo "$workingdir/passphrase" keysuccess=1 diff --git a/src/monkeysphere-server b/src/monkeysphere-server index 4cda008..e590f3c 100755 --- a/src/monkeysphere-server +++ b/src/monkeysphere-server @@ -120,7 +120,7 @@ show_server_key() { # dumping to a file named ' ' so that the ssh-keygen output # doesn't claim any potentially bogus hostname(s): - tmpkey=$(mktemp -d) + tmpkey=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) gpg_authentication "--export $fingerprint" | openpgp2ssh "$fingerprint" 2>/dev/null > "$tmpkey/ " echo -n "ssh fingerprint: " (cd "$tmpkey" && ssh-keygen -l -f ' ' | awk '{ print $2 }') @@ -188,7 +188,7 @@ update_users() { fi # make temporary directory - TMPDIR=$(mktemp -d) + TMPDIR=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) # trap to delete temporary directory on exit trap "rm -rf $TMPDIR" EXIT diff --git a/utils/build-releasenote b/utils/build-releasenote index af7ceb3..1b832a4 100755 --- a/utils/build-releasenote +++ b/utils/build-releasenote @@ -25,7 +25,7 @@ checksums() { checksums -temprelease=$(mktemp) +temprelease=$(mktemp ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) trap "rm -f $temprelease" EXIT set -e head -n$(( $(grep -n '^-----BEGIN PGP SIGNED MESSAGE-----$' website/download.mdwn | head -n1 | cut -f1 -d:) - 1 )) website/download.mdwn >$temprelease -- 2.26.2