=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/clientloop.c,v retrieving revision 1.270 retrieving revision 1.271 diff -u -r1.270 -r1.271 --- src/usr.bin/ssh/clientloop.c 2015/02/20 22:17:21 1.270 +++ src/usr.bin/ssh/clientloop.c 2015/02/23 16:33:25 1.271 @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.270 2015/02/20 22:17:21 djm Exp $ */ +/* $OpenBSD: clientloop.c,v 1.271 2015/02/23 16:33:25 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2152,7 +2152,8 @@ static void update_known_hosts(struct hostkeys_update_ctx *ctx) { - int r, loglevel = options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK ? + int r, was_raw = 0; + int loglevel = options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK ? SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_VERBOSE; char *fp, *response; size_t i; @@ -2176,7 +2177,10 @@ free(fp); } if (options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) { - leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); + if (get_saved_tio() != NULL) { + leave_raw_mode(1); + was_raw = 1; + } response = NULL; for (i = 0; !quit_pending && i < 3; i++) { free(response); @@ -2196,7 +2200,8 @@ if (quit_pending || i >= 3 || response == NULL) options.update_hostkeys = 0; free(response); - enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE); + if (was_raw) + enter_raw_mode(1); } /*