do more testing to make sure that mktemp calls do not fail.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 30 Oct 2008 19:54:03 +0000 (15:54 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 30 Oct 2008 19:54:03 +0000 (15:54 -0400)
debian/changelog
src/monkeysphere-server

index fa905d3efd88f6c2c45e47083f65a2e768bf20ce..300175d1026bc80c4e27d2a8cc67eab6de5c1f70 100644 (file)
@@ -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 <dkg@fifthhorseman.net>  Thu, 30 Oct 2008 15:03:23 -0400
 
index 5f0cb733be2c550c77b84a58889dc6a9b33e7f3c..e78903b8e1d6cce2725e7c04a881cff3ae027a79 100755 (executable)
@@ -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