summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@finestructure.net>2009-02-16 01:08:28 -0500
committerJameson Graef Rollins <jrollins@finestructure.net>2009-02-16 01:08:56 -0500
commitb55981fb8aa689aede58ed7ab4d8692c52b5c472 (patch)
tree9f7ebb266dad6657b9c2ab455398258d33fbb8a6 /src
parent3a421784e75e8e720290b3cb3eef8a83746b0855 (diff)
make sure MHTMPDIR is defined and created
Diffstat (limited to 'src')
-rwxr-xr-xsrc/monkeysphere-host4
-rw-r--r--src/share/mh/add_revoker2
-rw-r--r--src/share/mh/gen_key6
-rw-r--r--src/share/mh/import_key6
4 files changed, 13 insertions, 5 deletions
diff --git a/src/monkeysphere-host b/src/monkeysphere-host
index 32d843b..d6e4c68 100755
--- a/src/monkeysphere-host
+++ b/src/monkeysphere-host
@@ -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"
diff --git a/src/share/mh/add_revoker b/src/share/mh/add_revoker
index 8d160a8..5b637a5 100644
--- a/src/share/mh/add_revoker
+++ b/src/share/mh/add_revoker
@@ -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 \
diff --git a/src/share/mh/gen_key b/src/share/mh/gen_key
index 3b9a269..96053bc 100644
--- a/src/share/mh/gen_key
+++ b/src/share/mh/gen_key
@@ -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
diff --git a/src/share/mh/import_key b/src/share/mh/import_key
index cab2cf5..e5982ca 100644
--- a/src/share/mh/import_key
+++ b/src/share/mh/import_key
@@ -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