From: Daniel Kahn Gillmor Date: Fri, 27 Mar 2009 22:02:49 +0000 (-0400) Subject: trying to make m gen-subkey more responsive in the face of errors, and clearer to... X-Git-Tag: monkeysphere_0.25~31^2~27 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=0fded72147e60d7193c393e6de68493258501e7a;p=monkeysphere.git trying to make m gen-subkey more responsive in the face of errors, and clearer to the user about what is going on. --- diff --git a/src/share/common b/src/share/common index d6e4949..c8d44f6 100644 --- a/src/share/common +++ b/src/share/common @@ -304,6 +304,8 @@ passphrase_prompt() { local PASS if [ "$DISPLAY" ] && which "${SSH_ASKPASS:-ssh-askpass}" >/dev/null; then + printf 'Launching "%s"\n' "${SSH_ASKPASS:-ssh-askpass}" | log info + printf '(with prompt "%s")\n' "$prompt" | log debug "${SSH_ASKPASS:-ssh-askpass}" "$prompt" > "$fifo" else read -s -p "$prompt" PASS 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"