added msmktempfile; got rid of /dev/stdin assumption in ssh_proxycommand for portability
[monkeysphere.git] / src / share / m / ssh_proxycommand
index 29040d856940fe2289b7d6511271f7a77e340706..e07b637d26ce79debc7c34131aba0d6a652cc598 100644 (file)
@@ -64,11 +64,11 @@ An OpenPGP key matching the ssh key offered by the host was found:
 
 EOF
 
-                   # do some crazy "Here Strings" redirection to get the key to
-                   # ssh-keygen, since it doesn't read from stdin cleanly
-                   sshFingerprint=$(ssh-keygen -l -f /dev/stdin \
-                       <<<$(echo "$sshKeyGPG") | \
+                   sshKeyGPGFile=$(msmktempfile)
+                   printf "%s" "$sshKeyGPG" >"$sshKeyGPGFile"
+                   sshFingerprint=$(ssh-keygen -l -f "$sshKeyGPGFile" \
                        awk '{ print $2 }')
+                   rm -f "$sshKeyGPGFile"
 
                    # get the sigs for the matching key
                    gpgSigOut=$(gpg --check-sigs \
@@ -200,7 +200,6 @@ fi
 CHECK_KEYSERVER=${MONKEYSPHERE_CHECK_KEYSERVER:=$CHECK_KEYSERVER}
 
 # update the known_hosts file for the host
-source "${MSHAREDIR}/update_known_hosts"
 update_known_hosts "$HOSTP"
 
 # output on depending on the return of the update-known_hosts