Merge commit 'dkg/master'
authorJameson Graef Rollins <jrollins@finestructure.net>
Sat, 21 Feb 2009 21:30:50 +0000 (16:30 -0500)
committerJameson Graef Rollins <jrollins@finestructure.net>
Sat, 21 Feb 2009 21:30:50 +0000 (16:30 -0500)
src/monkeysphere
src/share/ma/add_certifier
src/share/mh/add_revoker
tests/basic

index 0d8f4ff8011adb8882ee6f6a4b6b47212b02723d..fd96f45e746d78ce09f8f76d3f14932152e47a25 100755 (executable)
@@ -87,9 +87,7 @@ check_gpg_sec_key_id() {
            ;;
        *)
            echo "Multiple primary secret keys found:"
-           for key in $(echo "$gpgSecOut" | cut -d: -f5) ; do
-               echo "  $key"
-           done
+           echo "$gpgSecOut" | cut -d: -f5
            echo "Please specify which primary key to use."
            failure
            ;;
index a48db6481909a070d7e73c9defc9bbe25538c63b..6f85ecfb904321906409af414b6c7503ce611e1c 100644 (file)
@@ -120,7 +120,17 @@ else
     # get the full fingerprint of new certifier key
     log debug "getting fingerprint of certifier key..."
     fingerprint=$(gpg_sphere "--list-key --with-colons --with-fingerprint 0x${keyID}!" \
-       | grep '^fpr:' | grep "$keyID" | cut -d: -f10)
+       | grep '^fpr:' | cut -d: -f10)
+
+    # test that there is only a single fingerprint
+    if (( $(echo "$fingerprint" | wc -l) != 1 )) ; then
+       cat <<EOF
+More than one fingerprint found:
+$fingerprint
+Please use a more specific key ID.
+EOF
+       failure
+    fi
 
     log info "key found:"
     gpg_sphere "--fingerprint 0x${fingerprint}!"
index 18ad2b7a8f8a76b117fa2ff208063f8be65cdd32..2ae531e82c15f08fb98af01e2cecb92982a18b0b 100644 (file)
@@ -74,7 +74,17 @@ else
     # get the full fingerprint of new revoker key
     log debug "getting fingerprint of revoker key..."
     fingerprint=$(su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --list-key --with-colons --with-fingerprint 0x${keyID}!" \
-       | grep '^fpr:' | grep "$keyID" | cut -d: -f10)
+       | grep '^fpr:' | cut -d: -f10)
+
+    # test that there is only a single fingerprint
+    if (( $(echo "$fingerprint" | wc -l) != 1 )) ; then
+       cat <<EOF
+More than one fingerprint found:
+$fingerprint
+Please use a more specific key ID.
+EOF
+       failure
+    fi
 
     log info "key found:"
     su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --fingerprint 0x${fingerprint}!"
index c7c4b07fe8b79cdd95220a7f81238221dba45935..9c5b280a7134b22a32c4e0336db84ced3ddf5f5c 100755 (executable)
@@ -65,20 +65,16 @@ ssh_test() {
        sleep 1
     done
 
-    set +e
-
     # make a client connection to the socket
     echo "##### starting ssh client..."
     ssh-agent bash -c \
-       "monkeysphere subkey-to-ssh-agent && ssh -F $TEMPDIR/testuser/.ssh/config testhost true"
-    RETURN="$?"
+       "monkeysphere subkey-to-ssh-agent && ssh -F $TEMPDIR/testuser/.ssh/config testhost true" \
+       || RETURN="$?"
 
     # kill the sshd process if it's still running
     kill "$SSHD_PID"
     SSHD_PID=
 
-    set -e
-
     echo "##### return $RETURN"
     if [ "$RETURN" = "$CODE" ] ; then
        echo "##### ssh connection test returned as desired"