The unified diff between revisions [79bdca55..] and [1ec06760..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'cli-kex.c'
#
#
# patch "cli-kex.c"
# from [fd05390561e39a89c8f9ac40475318733c9c07e2]
# to [169de9a3243a2425d61988177ce5fb0360861928]
#
============================================================
--- cli-kex.c fd05390561e39a89c8f9ac40475318733c9c07e2
+++ cli-kex.c 169de9a3243a2425d61988177ce5fb0360861928
@@ -115,13 +115,23 @@ static void ask_to_confirm(unsigned char
static void ask_to_confirm(unsigned char* keyblob, unsigned int keybloblen) {
char* fp = NULL;
+ FILE *tty = NULL;
+ char response = 'z';
fp = sign_key_fingerprint(keyblob, keybloblen);
fprintf(stderr, "\nHost '%s' is not in the trusted hosts file.\n(fingerprint %s)\nDo you want to continue connecting? (y/n)\n",
cli_opts.remotehost,
fp);
- if (getc(stdin) == 'y') {
+ tty = fopen(_PATH_TTY, "r");
+ if (tty) {
+ response = getc(tty);
+ fclose(tty);
+ } else {
+ response = getc(stdin);
+ }
+
+ if (response == 'y') {
m_free(fp);
return;
}