summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clientloop.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/clientloop.c b/clientloop.c
index ca3a4595b..8969869b6 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.270 2015/02/20 22:17:21 djm Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.271 2015/02/23 16:33:25 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2170,7 +2170,8 @@ hostkeys_find(struct hostkey_foreach_line *l, void *_ctx)
2170static void 2170static void
2171update_known_hosts(struct hostkeys_update_ctx *ctx) 2171update_known_hosts(struct hostkeys_update_ctx *ctx)
2172{ 2172{
2173 int r, loglevel = options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK ? 2173 int r, was_raw = 0;
2174 int loglevel = options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK ?
2174 SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_VERBOSE; 2175 SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_VERBOSE;
2175 char *fp, *response; 2176 char *fp, *response;
2176 size_t i; 2177 size_t i;
@@ -2194,7 +2195,10 @@ update_known_hosts(struct hostkeys_update_ctx *ctx)
2194 free(fp); 2195 free(fp);
2195 } 2196 }
2196 if (options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) { 2197 if (options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) {
2197 leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); 2198 if (get_saved_tio() != NULL) {
2199 leave_raw_mode(1);
2200 was_raw = 1;
2201 }
2198 response = NULL; 2202 response = NULL;
2199 for (i = 0; !quit_pending && i < 3; i++) { 2203 for (i = 0; !quit_pending && i < 3; i++) {
2200 free(response); 2204 free(response);
@@ -2214,7 +2218,8 @@ update_known_hosts(struct hostkeys_update_ctx *ctx)
2214 if (quit_pending || i >= 3 || response == NULL) 2218 if (quit_pending || i >= 3 || response == NULL)
2215 options.update_hostkeys = 0; 2219 options.update_hostkeys = 0;
2216 free(response); 2220 free(response);
2217 enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE); 2221 if (was_raw)
2222 enter_raw_mode(1);
2218 } 2223 }
2219 2224
2220 /* 2225 /*