make sure MHTMPDIR is defined and created
authorJameson Graef Rollins <jrollins@finestructure.net>
Mon, 16 Feb 2009 06:08:28 +0000 (01:08 -0500)
committerJameson Graef Rollins <jrollins@finestructure.net>
Mon, 16 Feb 2009 06:08:56 +0000 (01:08 -0500)
src/monkeysphere-host
src/share/mh/add_revoker
src/share/mh/gen_key
src/share/mh/import_key

index 32d843b134e606585a5a50064ff2f8598771b3a7..d6e4c686287a57c0782e33896c08d44200252247 100755 (executable)
@@ -32,6 +32,10 @@ MHSHAREDIR="${SYSSHAREDIR}/mh"
 # datadir for host functions
 MHDATADIR="${SYSDATADIR}/host"
 
+# temp directory for temp gnupghome directories for add_revoker
+MHTMPDIR="${MHDATADIR}/tmp"
+export MHTMPDIR
+
 # host pub key files
 HOST_KEY_PUB="${SYSDATADIR}/ssh_host_rsa_key.pub"
 HOST_KEY_PUB_GPG="${SYSDATADIR}/ssh_host_rsa_key.pub.gpg"
index 8d160a812f9845204ab1820d6caa5365f22f3c6c..5b637a5f14588a9b45df6f02b695281d8b86671f 100644 (file)
@@ -53,7 +53,7 @@ if [ -f "$keyID" ] ; then
     fi
 else
     # create a temporary directory for storing the downloaded key
-    TMPLOC=$(mktemp -d ${MHTMPDIR}/tmp.XXXXXXXXXX) || failure "Could not create temporary directory!"
+    TMPLOC=$(mktemp -d "${MHTMPDIR}"/tmp.XXXXXXXXXX) || failure "Could not create temporary directory!"
 
     # download the key from the keyserver as the monkeysphere user
     su_monkeysphere_user \
index 3b9a2697a60b3fb1786e12baa94b796ffd39d86b..96053bcd8677ff1802a98dea0628d2383509090c 100644 (file)
@@ -41,8 +41,10 @@ hostName=${1:-$(hostname -f)}
 userID="ssh://${hostName}"
 
 # create host home
-mkdir -p "$GNUPGHOME_HOST"
-chmod 700 "$GNUPGHOME_HOST"
+mkdir -p "${MHDATADIR}"
+mkdir -p "${MHTMPDIR}"
+mkdir -p "${GNUPGHOME_HOST}"
+chmod 700 "${GNUPGHOME_HOST}"
 
 log debug "generating host key..."
 gpg_host --batch --gen-key <<EOF
index cab2cf55e27df17573840e54e4fcab5882fa0537..e5982ca62a2f9bd0f418ae82bacdc918fe777575 100644 (file)
@@ -24,8 +24,10 @@ hostName=${2:-$(hostname -f)}
 userID="ssh://${hostName}"
 
 # create host home
-mkdir -p "$GNUPGHOME_HOST"
-chmod 700 "$GNUPGHOME_HOST"
+mkdir -p "${MHDATADIR}"
+mkdir -p "${MHTMPDIR}"
+mkdir -p "${GNUPGHOME_HOST}"
+chmod 700 "${GNUPGHOME_HOST}"
 
 log verbose "importing ssh key..."
 # translate ssh key to a private key