1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-30 00:04:49 -05:00

Make sure a locally entered login name still comes up in the pw prompt

[originally from svn r653]
This commit is contained in:
Simon Tatham 2000-09-29 12:04:42 +00:00
parent 138b090f3e
commit 0a1fe7a9af

6
ssh.c
View File

@ -1089,6 +1089,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
static int tried_publickey; static int tried_publickey;
static unsigned char session_id[16]; static unsigned char session_id[16];
int cipher_type; int cipher_type;
static char username[100];
crBegin; crBegin;
@ -1212,7 +1213,6 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
fflush(stdout); fflush(stdout);
{ {
static char username[100];
static int pos = 0; static int pos = 0;
static char c; static char c;
if ((flags & FLAG_INTERACTIVE) && !*cfg.username) { if ((flags & FLAG_INTERACTIVE) && !*cfg.username) {
@ -1440,7 +1440,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
} }
if (pwpkt_type == SSH1_CMSG_AUTH_PASSWORD) { if (pwpkt_type == SSH1_CMSG_AUTH_PASSWORD) {
sprintf(prompt, "%.90s@%.90s's password: ", sprintf(prompt, "%.90s@%.90s's password: ",
cfg.username, savedhost); username, savedhost);
} }
if (pwpkt_type == SSH1_CMSG_AUTH_RSA) { if (pwpkt_type == SSH1_CMSG_AUTH_RSA) {
char *comment = NULL; char *comment = NULL;
@ -2195,7 +2195,7 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
if (ssh_get_password) { if (ssh_get_password) {
char prompt[200]; char prompt[200];
sprintf(prompt, "%.90s@%.90s's password: ", cfg.username, savedhost); sprintf(prompt, "%.90s@%.90s's password: ", username, savedhost);
if (!ssh_get_password(prompt, password, sizeof(password))) { if (!ssh_get_password(prompt, password, sizeof(password))) {
/* /*
* get_password failed to get a password (for * get_password failed to get a password (for