From 6cad3bcedeb83997413e082969dda5427a0bc7f8 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sun, 1 Feb 2009 14:01:32 -0500 Subject: small tweak to ssh-proxycommand comments. --- src/share/m/ssh_proxycommand | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/share/m') diff --git a/src/share/m/ssh_proxycommand b/src/share/m/ssh_proxycommand index 7239c7a..b3a5a6e 100644 --- a/src/share/m/ssh_proxycommand +++ b/src/share/m/ssh_proxycommand @@ -1,7 +1,7 @@ # -*-shell-script-*- # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant) -# monkeysphere-ssh-proxycommand: MonkeySphere ssh ProxyCommand hook +# Monkeysphere ssh-proxycommand subcommand # # The monkeysphere scripts are written by: # Jameson Rollins @@ -13,7 +13,7 @@ # This is meant to be run as an ssh ProxyCommand to initiate a # monkeysphere known_hosts update before an ssh connection to host is # established. Can be added to ~/.ssh/config as follows: -# ProxyCommand monkeysphere-ssh-proxycommand %h %p +# ProxyCommand monkeysphere ssh-proxycommand %h %p ssh_proxycommand() { -- cgit v1.2.3 From 7548a859412f10e68f90ee68f330593d85b090fc Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sun, 1 Feb 2009 15:47:25 -0500 Subject: fix the log output for the ssh-proxycommand --- man/man1/monkeysphere.1 | 8 +++----- src/share/common | 11 ++++++++--- src/share/m/ssh_proxycommand | 44 +++++++++++++++++++++++++++++--------------- 3 files changed, 40 insertions(+), 23 deletions(-) (limited to 'src/share/m') diff --git a/man/man1/monkeysphere.1 b/man/man1/monkeysphere.1 index 03116b2..0e80047 100644 --- a/man/man1/monkeysphere.1 +++ b/man/man1/monkeysphere.1 @@ -168,14 +168,12 @@ addition to the authorized_keys file. .SH AUTHOR -Written by Jameson Rollins , Daniel -Kahn Gillmor +Written by: +Jameson Rollins , +Daniel Kahn Gillmor .SH SEE ALSO -\" DELETEME -\".BR monkeysphere-ssh-proxycommand (1), -\".BR monkeysphere-server (8), .BR monkeysphere-host (8), .BR monkeysphere-authentication (8), .BR monkeysphere (7), diff --git a/src/share/common b/src/share/common index 9adae05..00a1008 100644 --- a/src/share/common +++ b/src/share/common @@ -34,7 +34,8 @@ failure() { # write output to stderr based on specified LOG_LEVEL the first # parameter is the priority of the output, and everything else is what -# is echoed to stderr +# is echoed to stderr. If there is nothing else, then output comes +# from stdin, and is not prefaced by log prefix. log() { local priority local level @@ -79,8 +80,12 @@ log() { output=true fi if [ "$priority" = "$level" -a "$output" = 'true' ] ; then - echo -n "ms: " >&2 - echo "$@" >&2 + if [ "$1" ] ; then + echo -n "ms: " >&2 + echo "$@" >&2 + else + cat >&2 + fi fi done } diff --git a/src/share/m/ssh_proxycommand b/src/share/m/ssh_proxycommand index b3a5a6e..cd0a1fb 100644 --- a/src/share/m/ssh_proxycommand +++ b/src/share/m/ssh_proxycommand @@ -34,8 +34,10 @@ output_no_valid_key() { userID="ssh://${HOSTP}" - log "-------------------- Monkeysphere warning -------------------" - log "Monkeysphere found OpenPGP keys for this hostname, but none had full validity." + cat </dev/null | awk '{ print $2, $3 }') @@ -59,8 +61,10 @@ output_no_valid_key() { # if one of keys found matches the one offered by the # host, then output info if [ "$sshKeyGPG" = "$sshKeyOffered" ] ; then - log "An OpenPGP key matching the ssh key offered by the host was found:" - log + cat <&2 - log +' | log info + echo | log info # output the other user IDs for reference if (echo "$gpgSigOut" | grep "^uid" | grep -v -q "$userID") ; then - log "Other user IDs on this key:" - echo "$gpgSigOut" | grep "^uid" | grep -v "$userID" >&2 - log + cat <