From: Daniel Kahn Gillmor Date: Thu, 30 Oct 2008 19:54:03 +0000 (-0400) Subject: do more testing to make sure that mktemp calls do not fail. X-Git-Tag: monkeysphere_0.20-1~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=992e7de99fdacfe913338bc995efba36854ee6a2;p=monkeysphere.git do more testing to make sure that mktemp calls do not fail. --- diff --git a/debian/changelog b/debian/changelog index fa905d3..300175d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ monkeysphere (0.20-1) UNRELEASED; urgency=low [ Jameson Graef Rollins ] * clean up Makefile to generate more elegant source tarballs. + + [ Daniel Kahn Gillmor ] + * ensure that tempdirs are properly created, bail out otherwise instead + of stumbling ahead. -- Daniel Kahn Gillmor Thu, 30 Oct 2008 15:03:23 -0400 diff --git a/src/monkeysphere-server b/src/monkeysphere-server index 5f0cb73..e78903b 100755 --- a/src/monkeysphere-server +++ b/src/monkeysphere-server @@ -134,7 +134,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 ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) + tmpkey=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX) || failure "Could not create temporary directory!" gpg_authentication "--export $fingerprint" | openpgp2ssh "$fingerprint" 2>/dev/null > "$tmpkey/ " echo -n "ssh fingerprint: " (cd "$tmpkey" && ssh-keygen -l -f ' ' | awk '{ print $2 }') @@ -180,7 +180,7 @@ update_users() { log verbose "----- user: $uname -----" # make temporary directory - TMPLOC=$(mktemp -d ${MSTMPDIR}/tmp.XXXXXXXXXX) + TMPLOC=$(mktemp -d ${MSTMPDIR}/tmp.XXXXXXXXXX) || failure "Could not create temporary directory!" # trap to delete temporary directory on exit trap "rm -rf $TMPLOC" EXIT