projects
/
monkeysphere.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4d9da8f
)
more replacement of read -p with printf; read (re #446)
author
mike castleman
<m@mlcastle.net>
Sat, 11 Jul 2009 20:19:31 +0000
(16:19 -0400)
committer
mike castleman
<m@mlcastle.net>
Sat, 11 Jul 2009 20:19:31 +0000
(16:19 -0400)
src/monkeysphere
patch
|
blob
|
history
src/share/common
patch
|
blob
|
history
src/share/ma/add_certifier
patch
|
blob
|
history
src/share/ma/remove_certifier
patch
|
blob
|
history
src/share/mh/add_hostname
patch
|
blob
|
history
src/share/mh/add_revoker
patch
|
blob
|
history
src/share/mh/publish_key
patch
|
blob
|
history
src/share/mh/revoke_hostname
patch
|
blob
|
history
src/share/mh/revoke_key
patch
|
blob
|
history
src/share/mh/set_expire
patch
|
blob
|
history
tests/common
patch
|
blob
|
history
diff --git
a/src/monkeysphere
b/src/monkeysphere
index c45a36f94d811d3a2ae5eaab382c557c0d0af1d3..341b9fdbd4fefa8366a5d38205e99559d19e84d0 100755
(executable)
--- a/
src/monkeysphere
+++ b/
src/monkeysphere
@@
-144,7
+144,7
@@
check_gpg_authentication_subkey() {
if [ "$validity" = 'u' ] ; then
echo "A valid authentication key already exists for primary key '$keyID'." 1>&2
if [ "$PROMPT" = "true" ] ; then
if [ "$validity" = 'u' ] ; then
echo "A valid authentication key already exists for primary key '$keyID'." 1>&2
if [ "$PROMPT" = "true" ] ; then
- printf "Are you sure you would like to generate another one? (y/N) "
+ printf "Are you sure you would like to generate another one? (y/N) "
>&2
read OK; OK=${OK:N}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "aborting."
read OK; OK=${OK:N}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "aborting."
diff --git
a/src/share/common
b/src/share/common
index bd887d39b410d333badc6048b08d5e777322ce4b..c88857e44adabca90d57bb02358bcce92d16f67d 100644
(file)
--- a/
src/share/common
+++ b/
src/share/common
@@
-291,7
+291,8
@@
Please specify how long the key should be valid.
<n>y = key expires in n years
EOF
while [ -z "$keyExpire" ] ; do
<n>y = key expires in n years
EOF
while [ -z "$keyExpire" ] ; do
- read -p "Key is valid for? (0) " keyExpire
+ printf "Key is valid for? (0) " >&2
+ read keyExpire
if ! test_gpg_expire ${keyExpire:=0} ; then
echo "invalid value" >&2
unset keyExpire
if ! test_gpg_expire ${keyExpire:=0} ; then
echo "invalid value" >&2
unset keyExpire
diff --git
a/src/share/ma/add_certifier
b/src/share/ma/add_certifier
index 402da08e552cdccdf48329f89df4af28aca0fc12..16019976c4a084e376bbd0caa35aacecb3a9e435 100644
(file)
--- a/
src/share/ma/add_certifier
+++ b/
src/share/ma/add_certifier
@@
-136,8
+136,8
@@
EOF
gpg_sphere "--fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
gpg_sphere "--fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
- 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}
+ printf "Are you sure you want to add the above key as a certifier\nof users on this system? (Y/n) " >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not added."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not added."
fi
diff --git
a/src/share/ma/remove_certifier
b/src/share/ma/remove_certifier
index 6c90358bc2c54c6552caa5a91fc0cfa74eaa593e..79f1cdac8b7ff866f9ab739467977039b2266859 100644
(file)
--- a/
src/share/ma/remove_certifier
+++ b/
src/share/ma/remove_certifier
@@
-27,7
+27,8
@@
fi
gpg_core --list-key --fingerprint "0x${keyID}!" || failure
if [ "$PROMPT" = "true" ] ; then
gpg_core --list-key --fingerprint "0x${keyID}!" || failure
if [ "$PROMPT" = "true" ] ; then
- read -p "Really remove the above listed identity certifier? (Y/n) " OK; OK=${OK:-Y}
+ printf "Really remove the above listed identity certifier? (Y/n) " >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not removed."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not removed."
fi
diff --git
a/src/share/mh/add_hostname
b/src/share/mh/add_hostname
index 36f174de9049f433b13e068aa12d11a22a036be8..9465d9635ac0bab68034c9ac29ef9356d7f80fd3 100644
(file)
--- a/
src/share/mh/add_hostname
+++ b/
src/share/mh/add_hostname
@@
-32,9
+32,8
@@
find_host_userid > /dev/null && \
failure "Host userID '$userID' already exists."
if [ "$PROMPT" = "true" ] ; then
failure "Host userID '$userID' already exists."
if [ "$PROMPT" = "true" ] ; then
- read -p "The following user ID will be added to the host key:
- $userID
-Are you sure you would like to add this user ID? (Y/n) " OK; OK=${OK:=Y}
+ printf "The following user ID will be added to the host key:\n %s\nAre you sure you would like to add this user ID? (Y/n) " "$userID" >&2
+ read OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not added."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not added."
fi
diff --git
a/src/share/mh/add_revoker
b/src/share/mh/add_revoker
index 077b0d06b4409732f1c31febcf38b9b5e0e48333..e58995b3cff28acbb35ef0341d1308d046db3e7c 100644
(file)
--- a/
src/share/mh/add_revoker
+++ b/
src/share/mh/add_revoker
@@
-90,8
+90,8
@@
EOF
su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
- read -p "Are you sure you want to add the above key as a revoker
-
of the host key? (Y/n) "
OK; OK=${OK:-Y}
+ printf "Are you sure you want to add the above key as a revoker\nof the host key? (Y/n) " >&2
+
read
OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "revoker not added."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "revoker not added."
fi
diff --git
a/src/share/mh/publish_key
b/src/share/mh/publish_key
index b0ffd93b96ae124f4717b85e2256e88c67d6187a..f6e1c0f9b322cfaf3f623767189691d053c6d4a8 100644
(file)
--- a/
src/share/mh/publish_key
+++ b/
src/share/mh/publish_key
@@
-18,7
+18,8
@@
publish_key() {
local GNUPGHOME
if [ "$PROMPT" = "true" ] ; then
local GNUPGHOME
if [ "$PROMPT" = "true" ] ; then
- read -p "Really publish host key to $KEYSERVER? (Y/n) " OK; OK=${OK:=Y}
+ printf "Really publish host key to $KEYSERVER? (Y/n) " >&2
+ read OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "key not published."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "key not published."
fi
diff --git
a/src/share/mh/revoke_hostname
b/src/share/mh/revoke_hostname
index 5dc327f02c8a65a97e1fa4dd4dae1289bb15bc85..44ba3122ad6b4c5543ecd913ebe7cb4816e5256f 100644
(file)
--- a/
src/share/mh/revoke_hostname
+++ b/
src/share/mh/revoke_hostname
@@
-27,11
+27,12
@@
if [ -z "$1" ] ; then
failure "You must specify a hostname to revoke."
fi
failure "You must specify a hostname to revoke."
fi
-echo "WARNING: There is a known bug in this function."
-echo "This function has been known to occasionally revoke the wrong hostname."
-echo "Please see the following bug report for more information:"
-echo "https://labs.riseup.net/code/issues/show/422"
-read -p "Are you sure you would like to proceed? (y/N) " OK; OK=${OK:=N}
+echo "WARNING: There is a known bug in this function.
+This function has been known to occasionally revoke the wrong hostname.
+Please see the following bug report for more information:
+https://labs.riseup.net/code/issues/show/422" >&2
+printf "Are you sure you would like to proceed? (y/N) " >&2
+read OK; OK=${OK:=N}
if [ ${OK/y/Y} != 'Y' ] ; then
failure "aborting."
fi
if [ ${OK/y/Y} != 'Y' ] ; then
failure "aborting."
fi
@@
-43,9
+44,8
@@
uidIndex=$(find_host_userid) || \
failure "No non-revoked user ID found matching '$userID'."
if [ "$PROMPT" = "true" ] ; then
failure "No non-revoked user ID found matching '$userID'."
if [ "$PROMPT" = "true" ] ; then
- read -p "The following host key user ID will be revoked:
- $userID
-Are you sure you would like to revoke this user ID? (Y/n) " OK; OK=${OK:=Y}
+ printf "The following host key user ID will be revoked:\n %s\nAre you sure you would like to revoke this user ID? (Y/n) " "$userID" >&2
+ read OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not revoked."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not revoked."
fi
diff --git
a/src/share/mh/revoke_key
b/src/share/mh/revoke_key
index ad68d5f27a4804312ed0a7620146c3c257e558d2..5460e51b182c05faaabd2180d4ef06814a678096 100644
(file)
--- a/
src/share/mh/revoke_key
+++ b/
src/share/mh/revoke_key
@@
-33,7
+33,8
@@
Publishing this certificate will IMMEDIATELY and PERMANENTLY revoke
your host key!
EOF
your host key!
EOF
- read -p "Publish the certificate after generation? (y/n/Q) " publish
+ printf "Publish the certificate after generation? (y/n/Q) " >&2
+ read publish
if ! [ "${publish/y/Y}" = 'Y' -o "${publish/n/N}" = 'N' ] ; then
failure "aborting at user request"
if ! [ "${publish/y/Y}" = 'Y' -o "${publish/n/N}" = 'N' ] ; then
failure "aborting at user request"
@@
-87,7
+88,8
@@
y
if [ "${publish/y/Y}" = 'Y' ] ; then
printf "\n" >&2
if [ "${publish/y/Y}" = 'Y' ] ; then
printf "\n" >&2
- read -p "Really publish this cert to $KEYSERVER ? (Y/n) " really
+ printf "Really publish this cert to $KEYSERVER ? (Y/n) " >&2
+ read really
if [ "${really/n/N}" = 'N' ] ; then
printf "Not publishing.\n" >&2
else
if [ "${really/n/N}" = 'N' ] ; then
printf "Not publishing.\n" >&2
else
diff --git
a/src/share/mh/set_expire
b/src/share/mh/set_expire
index a6bf1f13ae5e33f42fade4091350f7a62993dbc0..9889e76e62bb28391bd83d3de0c654f9a853550e 100644
(file)
--- a/
src/share/mh/set_expire
+++ b/
src/share/mh/set_expire
@@
-22,7
+22,8
@@
local extendTo
extendTo=$(get_gpg_expiration "$1")
if [ "$PROMPT" = "true" ] ; then
extendTo=$(get_gpg_expiration "$1")
if [ "$PROMPT" = "true" ] ; then
- read -p "Are you sure you want to change the expiration on the host key to '$extendTo'? (Y/n) " OK; OK=${OK:-Y}
+ printf "Are you sure you want to change the expiration on the host key to '%s'? (Y/n) " "$extendTo" >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "expiration not set."
fi
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "expiration not set."
fi
diff --git
a/tests/common
b/tests/common
index 6d732c82682ea73407bc8de16c4b9a0b5fcd36a0..727ad0f33cec5cad0502ad0b6089f5447811408b 100644
(file)
--- a/
tests/common
+++ b/
tests/common
@@
-4,7
+4,8
@@
failed_cleanup() {
# FIXME: can we be more verbose here?
echo 'FAILED!'
if [ -z "$MONKEYSPHERE_TEST_NO_EXAMINE" ] ; then
# FIXME: can we be more verbose here?
echo 'FAILED!'
if [ -z "$MONKEYSPHERE_TEST_NO_EXAMINE" ] ; then
- read -p "press enter to cleanup and remove tmp (or type 'bash' for a subshell to examine): " XX
+ printf "press enter to cleanup and remove tmp (or type 'bash' for a subshell to examine): " >&2
+ read XX
if [ "$XX" = bash ] ; then
echo "Entering subshell..."
cd "$TEMPDIR"
if [ "$XX" = bash ] ; then
echo "Entering subshell..."
cd "$TEMPDIR"