mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Add some fflushes to make it easier for piped programs to talk to
plink and pscp [originally from svn r1078]
This commit is contained in:
parent
62e5e4c2e1
commit
b7844a20af
8
plink.c
8
plink.c
@ -88,10 +88,14 @@ void verify_ssh_host_key(char *host, int port, char *keytype,
|
||||
if (ret == 0) /* success - key matched OK */
|
||||
return;
|
||||
|
||||
if (ret == 2) /* key was different */
|
||||
if (ret == 2) { /* key was different */
|
||||
fprintf(stderr, wrongmsg, fingerprint);
|
||||
if (ret == 1) /* key was absent */
|
||||
fflush(stderr);
|
||||
}
|
||||
if (ret == 1) { /* key was absent */
|
||||
fprintf(stderr, absentmsg, fingerprint);
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
hin = GetStdHandle(STD_INPUT_HANDLE);
|
||||
GetConsoleMode(hin, &savemode);
|
||||
|
2
scp.c
2
scp.c
@ -134,12 +134,14 @@ void verify_ssh_host_key(char *host, int port, char *keytype,
|
||||
return;
|
||||
if (ret == 2) { /* key was different */
|
||||
fprintf(stderr, wrongmsg, fingerprint);
|
||||
fflush(stderr);
|
||||
if (fgets(line, sizeof(line), stdin) &&
|
||||
line[0] != '\0' && line[0] != '\n') {
|
||||
if (line[0] == 'y' || line[0] == 'Y')
|
||||
store_host_key(host, port, keytype, keystr);
|
||||
} else {
|
||||
fprintf(stderr, abandoned);
|
||||
fflush(stderr);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user