summaryrefslogtreecommitdiff
path: root/src/share/ma/add_certifier
diff options
context:
space:
mode:
authorMatt Goins <mjgoins@openflows.com>2009-02-21 16:54:39 -0500
committerMatt Goins <mjgoins@openflows.com>2009-02-21 16:54:39 -0500
commit4e0502a242b89c73535b00cc1b199dfea38ce4d4 (patch)
tree6bed970da1f85171b1c0b13095b702825a90754b /src/share/ma/add_certifier
parentd41fe28eb49e42d7773a223a43fd108913410c99 (diff)
parenteb88374be90344d1808fe49a5bc69a547a09280d (diff)
Merge branch 'master' of git://lair.fifthhorseman.net/~dkg/monkeysphere
Diffstat (limited to 'src/share/ma/add_certifier')
-rw-r--r--src/share/ma/add_certifier16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/share/ma/add_certifier b/src/share/ma/add_certifier
index f2cadf2..6f85ecf 100644
--- a/src/share/ma/add_certifier
+++ b/src/share/ma/add_certifier
@@ -120,14 +120,24 @@ 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}!"
if [ "$PROMPT" = "true" ] ; then
- echo "Are you sure you want to add the above key as a"
- read -p "certifier of users on this system? (Y/n) " OK; OK=${OK:-Y}
+ echo "Are you sure you want to add the above key as a certifier"
+ read -p "of users on this system? (Y/n) " OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not added."
fi