diff options
author | Jameson Graef Rollins <jrollins@finestructure.net> | 2009-07-24 08:23:45 -0400 |
---|---|---|
committer | Jameson Graef Rollins <jrollins@finestructure.net> | 2009-07-24 08:23:45 -0400 |
commit | 189781e00c89227612942ff7dc30eaa756cb78ae (patch) | |
tree | a2fa8baed23e50835ffe9688338dcab0ccdeb897 | |
parent | 1472a139953e68630cc0e409872fb4eaf69fff7f (diff) |
proposed fix for #1147 by checking for known_hosts file
-rwxr-xr-x | src/monkeysphere | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/monkeysphere b/src/monkeysphere index 341b9fd..94279f4 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -194,7 +194,18 @@ if [ -z "$KEYSERVER" ] ; then fi fi PROMPT=${MONKEYSPHERE_PROMPT:=$PROMPT} -KNOWN_HOSTS=${MONKEYSPHERE_KNOWN_HOSTS:=$KNOWN_HOSTS} +# check the known_hosts file +if [ "$MONKEYSPHERE_KNOWN_HOSTS" ] ; then + if [ -f "$MONKEYSPHERE_KNOWN_HOSTS" ] ; then + KNOWN_HOSTS="$MONKEYSPHERE_KNOWN_HOSTS" + else + failure "specified monkeysphere known_hosts file '$MONKEYSPHERE_KNOWN_HOSTS' does not exist." + fi +fi +[ -d $(dirname "$KNOWN_HOSTS") ] \ + || mkdir -m 0700 $(dirname "$KNOWN_HOSTS") +[ -f "$KNOWN_HOSTS" ] \ + || touch "$KNOWN_HOSTS" HASH_KNOWN_HOSTS=${MONKEYSPHERE_HASH_KNOWN_HOSTS:=$HASH_KNOWN_HOSTS} AUTHORIZED_KEYS=${MONKEYSPHERE_AUTHORIZED_KEYS:=$AUTHORIZED_KEYS} |