trying to make m gen-subkey more responsive in the face of errors, and clearer to...
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 27 Mar 2009 22:02:49 +0000 (18:02 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 27 Mar 2009 22:02:49 +0000 (18:02 -0400)
src/share/common
src/share/m/gen_subkey

index d6e494953d078e1178c1dda7addc3cf985196f1e..c8d44f656c58136be011a0bd80c5af077adeaedb 100644 (file)
@@ -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
index a0fa3ce77228b5f6b7efc876ccf3a22098a2d38c..05004f66ee07a1e065b05d1d2765283552d87459 100644 (file)
@@ -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"