Merge commit 'jrollins/master'
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 19 Feb 2009 09:31:25 +0000 (04:31 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 19 Feb 2009 09:31:25 +0000 (04:31 -0500)
src/share/common
src/share/m/ssh_proxycommand
src/transitions/0.23

index 1c16ac6218ba1a7a85bc2984477b75d122ac7366..bfe73a37bc6961dc0ac9d2a9eb445460743c63bf 100644 (file)
@@ -149,9 +149,14 @@ cutline() {
     head --line="$1" "$2" | tail -1
 }
 
-# make a temporary directly
+# make a temporary directory
 msmktempdir() {
-    mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX
+    mktemp -d ${TMPDIR:-/tmp}/monkeysphere.XXXXXXXXXX
+}
+
+# make a temporary file
+msmktempfile() {
+    mktemp ${TMPDIR:-/tmp}/monkeysphere.XXXXXXXXXX
 }
 
 # this is a wrapper for doing lock functions.
index d7e801ec46711ada104019a5d00628b76b8eb516..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 \
index 6cbf99522317856677682730517559ea02c8d82c..f09dfff4489af8a4d5162e43e73552ffa4864e75 100755 (executable)
@@ -121,7 +121,7 @@ if [ -d "$SYSDATADIR"/gnupg-host ] ; then
 
                            CERTKEY=$(mktemp ${TMPDIR:-/tmp}/mstransition.XXXXXXXX)
                            log "Adding identity certifier with fingerprint %s\n" "$keyfpr"
-                           GNUPGHOME="$SYSDATADIR"/gnupg-host gpg --no-permission-warning --export "0x$keyfpr" --export-clean >"$CERTKEY"
+                           GNUPGHOME="$SYSDATADIR"/gnupg-host gpg --no-permission-warning --export "0x$keyfpr" --export-options export-clean >"$CERTKEY"
                            MONKEYSPHERE_PROMPT=false monkeysphere-authentication add-identity-certifier $finaldomain --trust "$truststring" --depth "$trustdepth" "$CERTKEY"
                            rm -f "$CERTKEY"
                            # clear the fingerprint so that we don't
@@ -149,7 +149,7 @@ if [ -d "$SYSDATADIR"/gnupg-host ] ; then
            
            log "importing host key from old monkeysphere installation\n"
            GNUPGHOME="$SYSDATADIR"/gnupg-host gpg --no-permission-warning --export-secret-keys | \
-               GNUPGHOME="$MHDATADIR" gpg --import
+               GNUPGHOME="$MHDATADIR" gpg --quiet --no-tty --import
            
            monkeysphere-host update-gpg-pub-file
        else
@@ -171,7 +171,7 @@ fi
 # the new authentication keyring.
 if [ -d "${SYSDATADIR}/gnupg-authentication" ] ; then
 
-    GNUPGHOME="${SYSDATADIR}/gnupg-authentication" gpg --export | \
+    GNUPGHOME="${SYSDATADIR}/gnupg-authentication" gpg --no-permission-warning --export | \
        monkeysphere-authentication gpg-cmd --import
 
     mkdir -p "$STASHDIR"