From cdf1a5acbfc09742c3d04de038722b273381f78d Mon Sep 17 00:00:00 2001
From: Jameson Rollins <jrollins@finestructure.net>
Date: Wed, 6 Oct 2010 17:37:54 -0400
Subject: Fix more calls to gpg_shere, finishing what was started in
 90166e0bb8e4ebc1c1174d9bc2021c604b7a1bd7

There were another calls to gpg_sphere that were packing everything
into a single argument.  Since we fixed the need to do that, we fix
all these other calls that were fixed in the first round.
---
 src/share/ma/add_certifier    | 12 ++++++------
 src/share/ma/list_certifiers  |  2 +-
 src/share/ma/remove_certifier |  4 ++--
 src/share/ma/setup            |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

(limited to 'src/share')

diff --git a/src/share/ma/add_certifier b/src/share/ma/add_certifier
index bd38190..3ce5000 100644
--- a/src/share/ma/add_certifier
+++ b/src/share/ma/add_certifier
@@ -108,18 +108,18 @@ if [ -f "$keyID" -o "$keyID" = '-' ] ; then
     fi
 
     # load the key
-    gpg_sphere "--import" <"$keyID" 2>/dev/null \
+    gpg_sphere --import <"$keyID" 2>/dev/null \
 	|| failure "could not read key from '$keyID'"
 
 # else, get the key from the keyserver
 else
     log verbose "searching keyserver $KEYSERVER for keyID $keyID..."
-    gpg_sphere "--keyserver $KEYSERVER --recv-key '0x${keyID}!'" \
+    gpg_sphere --keyserver "$KEYSERVER" --recv-key "0x${keyID}!" \
 	|| failure "Could not receive a key with this ID from the '$KEYSERVER' keyserver."
 
     # 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}!" \
+    fingerprint=$(gpg_sphere --list-key --with-colons --with-fingerprint "0x${keyID}!" \
 	| grep '^fpr:' | cut -d: -f10)
 
     # test that there is only a single fingerprint
@@ -133,7 +133,7 @@ EOF
     fi
 
     log info "key found:"
-    gpg_sphere "--fingerprint 0x${fingerprint}!"
+    gpg_sphere --fingerprint "0x${fingerprint}!"
 
     if [ "$PROMPT" != "false" ] ; then
 	printf "Are you sure you want to add the above key as a certifier\nof users on this system? (Y/n) " >&2
@@ -149,7 +149,7 @@ fi
 # export the key to the core keyring so that the core can sign the
 # new certifier key
 log debug "loading key into core keyring..."
-gpg_sphere "--export 0x${fingerprint}!" | gpg_core --import
+gpg_sphere --export "0x${fingerprint}!" | gpg_core --import
 
 # edit-key script to ltsign key
 # NOTE: *all* user IDs will be ltsigned
@@ -172,7 +172,7 @@ if echo "$ltsignCommand" | \
 
     # update the sphere trustdb
     log debug "updating sphere trustdb..."
-    gpg_sphere "--check-trustdb" 2>&1 | log debug
+    gpg_sphere --check-trustdb 2>&1 | log debug
 
     log info "Identity certifier added."
 else
diff --git a/src/share/ma/list_certifiers b/src/share/ma/list_certifiers
index 789eb9d..56d52da 100644
--- a/src/share/ma/list_certifiers
+++ b/src/share/ma/list_certifiers
@@ -38,7 +38,7 @@ authgrip=$(core_fingerprint | cut -b 25-40)
 # fingerprint, the trust depth, the trust level (60 == marginal, 120
 # == full), and the domain regex (if any):
 
-gpg_sphere "--fingerprint --with-colons --fixed-list-mode --check-sigs" | \
+gpg_sphere --fingerprint --with-colons --fixed-list-mode --check-sigs | \
     cut -f 1,2,5,8,9,10 -d: | \
     egrep '^(fpr:::::|uat:|uid:|sig:!:'"$authgrip"':[[:digit:]]+ [[:digit:]]+:)' | \
     while IFS=: read -r type validity grip trustparams trustdomain fpr ; do
diff --git a/src/share/ma/remove_certifier b/src/share/ma/remove_certifier
index 51c7ee7..9f5be25 100644
--- a/src/share/ma/remove_certifier
+++ b/src/share/ma/remove_certifier
@@ -37,12 +37,12 @@ else
 fi
 
 # delete the requested key from the sphere keyring
-if gpg_sphere "--delete-key --batch --yes 0x${keyID}!" ; then
+if gpg_sphere --delete-key --batch --yes "0x${keyID}!" ; then
     # delete key from core keyring as well
     gpg_core --delete-key --batch --yes "0x${keyID}!"
 
     # update the trustdb for the authentication keyring
-    gpg_sphere "--check-trustdb"
+    gpg_sphere --check-trustdb
 
     log info "Identity certifier removed."
 else
diff --git a/src/share/ma/setup b/src/share/ma/setup
index 3c82c45..5cc3aab 100644
--- a/src/share/ma/setup
+++ b/src/share/ma/setup
@@ -87,12 +87,12 @@ EOF
 
     # export the core key to the sphere keyring
     log debug "exporting core pub key to sphere keyring..."
-    gpg_core --export | gpg_sphere "--import"
+    gpg_core --export | gpg_sphere --import
 
     # ensure that the authentication sphere checker has absolute ownertrust on the expected key.
     log debug "setting ultimate owner trust on core key in gpg_sphere..."
-    printf "%s:6:\n" "$CORE_FPR" | gpg_sphere "--import-ownertrust" 2>&1 | log verbose
-    gpg_sphere "--export-ownertrust" 2>&1 | log debug
+    printf "%s:6:\n" "$CORE_FPR" | gpg_sphere --import-ownertrust 2>&1 | log verbose
+    gpg_sphere --export-ownertrust 2>&1 | log debug
 
     # check the owner trust
     log debug "checking gpg_sphere owner trust set properly..."
-- 
cgit v1.2.3