mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-14 09:38:07 -05:00
Remove login name prompt from PSFTP.
ssh.c will prompt for a login name as required, and doing so in psftp.c before we've even made a connection is incorrect wrt `bypass-ssh2-userauth'. [originally from svn r6634]
This commit is contained in:
parent
de3e873b12
commit
1d6f8ae824
18
psftp.c
18
psftp.c
@ -2724,24 +2724,6 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
|
||||
strncpy(cfg.username, user, sizeof(cfg.username) - 1);
|
||||
cfg.username[sizeof(cfg.username) - 1] = '\0';
|
||||
}
|
||||
if (!cfg.username[0]) {
|
||||
/* FIXME: leave this to ssh.c? */
|
||||
int ret;
|
||||
prompts_t *p = new_prompts(NULL);
|
||||
p->to_server = TRUE;
|
||||
p->name = dupstr("SSH login name");
|
||||
add_prompt(p, dupstr("login as: "), TRUE, lenof(cfg.username));
|
||||
ret = get_userpass_input(p, NULL, 0);
|
||||
assert(ret >= 0);
|
||||
if (!ret) {
|
||||
free_prompts(p);
|
||||
fprintf(stderr, "psftp: no username, aborting\n");
|
||||
cleanup_exit(1);
|
||||
} else {
|
||||
memcpy(cfg.username, p->prompts[0]->result, lenof(cfg.username));
|
||||
free_prompts(p);
|
||||
}
|
||||
}
|
||||
|
||||
if (portnumber)
|
||||
cfg.port = portnumber;
|
||||
|
Loading…
x
Reference in New Issue
Block a user