diff options
author | Matt Goins <mjgoins@openflows.com> | 2009-04-08 00:43:05 -0400 |
---|---|---|
committer | Matt Goins <mjgoins@openflows.com> | 2009-04-08 00:43:05 -0400 |
commit | dfd67a14003fbfb4b1ba2269e7d47f4d0c44fcf8 (patch) | |
tree | 3372902f39b0995a39b62851671fe33e4ceeb56e /src/share/m | |
parent | f77a5d79b4a9b4b44cb3786237931458265e49ed (diff) | |
parent | ee3872232ffc40ab0ae7ea823059806f839f2700 (diff) |
Merge commit 'dkg/master'
Diffstat (limited to 'src/share/m')
-rw-r--r-- | src/share/m/gen_subkey | 6 | ||||
-rw-r--r-- | src/share/m/ssh_proxycommand | 6 | ||||
-rw-r--r-- | src/share/m/subkey_to_ssh_agent | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/share/m/gen_subkey b/src/share/m/gen_subkey index a0fa3ce..05004f6 100644 --- a/src/share/m/gen_subkey +++ b/src/share/m/gen_subkey @@ -57,14 +57,16 @@ save" # setup the temp fifo dir for retrieving the key password log debug "creating password fifo..." fifoDir=$(msmktempdir) - trap "rm -rf $fifoDir" EXIT (umask 077 && mkfifo "$fifoDir/pass") - log verbose "generating subkey..." + # FIXME: are we adequately cleaning up any trailing gpg process here? + trap "rm -rf $fifoDir; kill %% || true" EXIT echo "$editCommands" | gpg_user --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --edit-key "$keyID" & + log debug "Prompting for passphrase" # FIXME: this needs to fail more gracefully if the passphrase is incorrect passphrase_prompt "Please enter your passphrase for $keyID: " "$fifoDir/pass" + log info "Generating subkey. This may take a long time..." trap - EXIT rm -rf "$fifoDir" diff --git a/src/share/m/ssh_proxycommand b/src/share/m/ssh_proxycommand index 77f9d24..74b0f85 100644 --- a/src/share/m/ssh_proxycommand +++ b/src/share/m/ssh_proxycommand @@ -186,7 +186,7 @@ URI="ssh://${HOSTP}" # CHECK_KEYSERVER variable in the monkeysphere.conf file. # if the host is in the gpg keyring... -if gpg_user --list-key ="${URI}" 2>&1 >/dev/null ; then +if gpg_user --list-key ="${URI}" &>/dev/null ; then # do not check the keyserver CHECK_KEYSERVER=${CHECK_KEYSERVER:="false"} @@ -253,9 +253,9 @@ esac # exec a netcat passthrough to host for the ssh connection if [ -z "$NO_CONNECT" ] ; then - if (which nc 2>/dev/null >/dev/null); then + if (type nc &>/dev/null); then exec nc "$HOST" "$PORT" - elif (which socat 2>/dev/null >/dev/null); then + elif (type socat &>/dev/null); then exec socat STDIO "TCP:$HOST:$PORT" else echo "Neither netcat nor socat found -- could not complete monkeysphere-ssh-proxycommand connection to $HOST:$PORT" >&2 diff --git a/src/share/m/subkey_to_ssh_agent b/src/share/m/subkey_to_ssh_agent index aa647a6..edc177b 100644 --- a/src/share/m/subkey_to_ssh_agent +++ b/src/share/m/subkey_to_ssh_agent @@ -27,7 +27,7 @@ subkey_to_ssh_agent() { local kname # if there's no agent running, don't bother: - if [ -z "$SSH_AUTH_SOCK" ] || ! which ssh-add >/dev/null ; then + if [ -z "$SSH_AUTH_SOCK" ] || ! type ssh-add >/dev/null ; then failure "No ssh-agent available." fi |