Bug 522 - terse message prompt when ssh-add fails
Summary: terse message prompt when ssh-add fails
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-add (show other bugs)
Version: -current
Hardware: All All
: P2 enhancement
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-27 15:49 AEDT by Federico Grau
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
a simple fix (493 bytes, patch)
2003-03-27 15:52 AEDT, Federico Grau
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Grau 2003-03-27 15:49:25 AEDT
I (and surely others) have multiple keys which I add to my ssh-agent
upon starting X.  I use ssh-askpass to display a pretty password prompt,
and it normally works very well.  Unfortunately, the "error" or "retry"
message prompted when a passphrase is incorrectly entered, does not
RE-display the key to which the passphrase is being entered.  It can be
difficult to tell which key the passphrase prompt was for.

Below is a simple patch to solve this problem.  The solution lies with ssh-add,
since ssh-askpass is simply passing the text to the user.

thanks,
donfede

####################


donfede@xwing:~/projects/hack_ssh-agent/openssh$ cvs diff -u ssh-add.c 
Index: ssh-add.c
===================================================================
RCS file: /cvs/openssh/ssh-add.c,v
retrieving revision 1.71
diff -u -r1.71 ssh-add.c
--- ssh-add.c   10 Mar 2003 00:21:18 -0000      1.71
+++ ssh-add.c   27 Mar 2003 04:36:59 -0000
@@ -164,7 +164,8 @@
                        if (private != NULL)
                                break;
                        clear_pass();
-                       strlcpy(msg, "Bad passphrase, try again: ", sizeof msg);
+                       snprintf(msg, sizeof msg, "Bad passphrase, try again for
%.200s: ",
+                          comment);
                }
        }
Comment 1 Federico Grau 2003-03-27 15:52:40 AEDT
Created attachment 262 [details]
a simple fix

Here is the same patch, but in an attachment (the web form munged of the
lines).
Comment 2 Colin Watson 2003-04-02 11:19:27 AEST
I suggest "Bad passphrase for %.200s, try again" instead of "Bad passphrase, try
again for %.200s".
Comment 3 Damien Miller 2003-07-03 18:18:07 AEST
fixed in -current
Comment 4 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED