diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/clientloop.c b/clientloop.c index eca87777f..5793a6e91 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.215 2009/11/17 05:31:44 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.216 2010/01/09 05:04:24 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 |
@@ -130,6 +130,9 @@ extern int muxserver_sock; | |||
130 | */ | 130 | */ |
131 | extern char *host; | 131 | extern char *host; |
132 | 132 | ||
133 | /* Force TTY allocation */ | ||
134 | extern int force_tty_flag; | ||
135 | |||
133 | /* | 136 | /* |
134 | * Flag to indicate that we have received a window change signal which has | 137 | * Flag to indicate that we have received a window change signal which has |
135 | * not yet been processed. This will cause a message indicating the new | 138 | * not yet been processed. This will cause a message indicating the new |
@@ -610,7 +613,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) | |||
610 | atomicio(vwrite, fileno(stderr), buffer_ptr(berr), | 613 | atomicio(vwrite, fileno(stderr), buffer_ptr(berr), |
611 | buffer_len(berr)); | 614 | buffer_len(berr)); |
612 | 615 | ||
613 | leave_raw_mode(); | 616 | leave_raw_mode(force_tty_flag); |
614 | 617 | ||
615 | /* | 618 | /* |
616 | * Free (and clear) the buffer to reduce the amount of data that gets | 619 | * Free (and clear) the buffer to reduce the amount of data that gets |
@@ -631,7 +634,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) | |||
631 | buffer_init(bout); | 634 | buffer_init(bout); |
632 | buffer_init(berr); | 635 | buffer_init(berr); |
633 | 636 | ||
634 | enter_raw_mode(); | 637 | enter_raw_mode(force_tty_flag); |
635 | } | 638 | } |
636 | 639 | ||
637 | static void | 640 | static void |
@@ -774,7 +777,7 @@ process_cmdline(void) | |||
774 | bzero(&fwd, sizeof(fwd)); | 777 | bzero(&fwd, sizeof(fwd)); |
775 | fwd.listen_host = fwd.connect_host = NULL; | 778 | fwd.listen_host = fwd.connect_host = NULL; |
776 | 779 | ||
777 | leave_raw_mode(); | 780 | leave_raw_mode(force_tty_flag); |
778 | handler = signal(SIGINT, SIG_IGN); | 781 | handler = signal(SIGINT, SIG_IGN); |
779 | cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); | 782 | cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); |
780 | if (s == NULL) | 783 | if (s == NULL) |
@@ -877,7 +880,7 @@ process_cmdline(void) | |||
877 | 880 | ||
878 | out: | 881 | out: |
879 | signal(SIGINT, handler); | 882 | signal(SIGINT, handler); |
880 | enter_raw_mode(); | 883 | enter_raw_mode(force_tty_flag); |
881 | if (cmd) | 884 | if (cmd) |
882 | xfree(cmd); | 885 | xfree(cmd); |
883 | if (fwd.listen_host != NULL) | 886 | if (fwd.listen_host != NULL) |
@@ -996,7 +999,7 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr, | |||
996 | * more new connections). | 999 | * more new connections). |
997 | */ | 1000 | */ |
998 | /* Restore tty modes. */ | 1001 | /* Restore tty modes. */ |
999 | leave_raw_mode(); | 1002 | leave_raw_mode(force_tty_flag); |
1000 | 1003 | ||
1001 | /* Stop listening for new connections. */ | 1004 | /* Stop listening for new connections. */ |
1002 | channel_stop_listening(); | 1005 | channel_stop_listening(); |
@@ -1291,7 +1294,7 @@ client_channel_closed(int id, void *arg) | |||
1291 | { | 1294 | { |
1292 | channel_cancel_cleanup(id); | 1295 | channel_cancel_cleanup(id); |
1293 | session_closed = 1; | 1296 | session_closed = 1; |
1294 | leave_raw_mode(); | 1297 | leave_raw_mode(force_tty_flag); |
1295 | } | 1298 | } |
1296 | 1299 | ||
1297 | /* | 1300 | /* |
@@ -1364,7 +1367,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1364 | signal(SIGWINCH, window_change_handler); | 1367 | signal(SIGWINCH, window_change_handler); |
1365 | 1368 | ||
1366 | if (have_pty) | 1369 | if (have_pty) |
1367 | enter_raw_mode(); | 1370 | enter_raw_mode(force_tty_flag); |
1368 | 1371 | ||
1369 | if (compat20) { | 1372 | if (compat20) { |
1370 | session_ident = ssh2_chan_id; | 1373 | session_ident = ssh2_chan_id; |
@@ -1498,7 +1501,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1498 | channel_free_all(); | 1501 | channel_free_all(); |
1499 | 1502 | ||
1500 | if (have_pty) | 1503 | if (have_pty) |
1501 | leave_raw_mode(); | 1504 | leave_raw_mode(force_tty_flag); |
1502 | 1505 | ||
1503 | /* restore blocking io */ | 1506 | /* restore blocking io */ |
1504 | if (!isatty(fileno(stdin))) | 1507 | if (!isatty(fileno(stdin))) |
@@ -2062,7 +2065,7 @@ client_init_dispatch(void) | |||
2062 | void | 2065 | void |
2063 | cleanup_exit(int i) | 2066 | cleanup_exit(int i) |
2064 | { | 2067 | { |
2065 | leave_raw_mode(); | 2068 | leave_raw_mode(force_tty_flag); |
2066 | leave_non_blocking(); | 2069 | leave_non_blocking(); |
2067 | if (options.control_path != NULL && muxserver_sock != -1) | 2070 | if (options.control_path != NULL && muxserver_sock != -1) |
2068 | unlink(options.control_path); | 2071 | unlink(options.control_path); |