diff options
author | Matt Johnston <matt@ucc.asn.au> | 2005-01-11 16:17:03 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2005-01-11 16:17:03 +0000 |
commit | b7dbb29e686e9dfb1a766d427007e69d4db044c2 (patch) | |
tree | 00d27dea47c3c088bdf42b370e9f3cc27f80c206 /cli-kex.c | |
parent | 37da919b7d1ccec084a63a39a21b0b36b35325e1 (diff) |
Read "y/n" response for fingerprints from /dev/tty directly so that dbclient
will work with scp.
--HG--
extra : convert_revision : 1ec067604618a314ad36464920f08c7113d09aa3
Diffstat (limited to 'cli-kex.c')
-rw-r--r-- | cli-kex.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -115,13 +115,23 @@ void recv_msg_kexdh_reply() { 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; } |