summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/clientloop.c b/clientloop.c
index 502dd982c..5bd757dfb 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.232 2011/04/17 22:42:41 djm Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.233 2011/05/06 21:34:32 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,9 +130,6 @@ extern int muxserver_sock; /* XXX use mux_client_cleanup() instead */
130 */ 130 */
131extern char *host; 131extern char *host;
132 132
133/* Force TTY allocation */
134extern int force_tty_flag;
135
136/* 133/*
137 * Flag to indicate that we have received a window change signal which has 134 * Flag to indicate that we have received a window change signal which has
138 * not yet been processed. This will cause a message indicating the new 135 * not yet been processed. This will cause a message indicating the new
@@ -662,7 +659,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
662 atomicio(vwrite, fileno(stderr), buffer_ptr(berr), 659 atomicio(vwrite, fileno(stderr), buffer_ptr(berr),
663 buffer_len(berr)); 660 buffer_len(berr));
664 661
665 leave_raw_mode(force_tty_flag); 662 leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
666 663
667 /* 664 /*
668 * Free (and clear) the buffer to reduce the amount of data that gets 665 * Free (and clear) the buffer to reduce the amount of data that gets
@@ -683,7 +680,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
683 buffer_init(bout); 680 buffer_init(bout);
684 buffer_init(berr); 681 buffer_init(berr);
685 682
686 enter_raw_mode(force_tty_flag); 683 enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
687} 684}
688 685
689static void 686static void
@@ -826,7 +823,7 @@ process_cmdline(void)
826 bzero(&fwd, sizeof(fwd)); 823 bzero(&fwd, sizeof(fwd));
827 fwd.listen_host = fwd.connect_host = NULL; 824 fwd.listen_host = fwd.connect_host = NULL;
828 825
829 leave_raw_mode(force_tty_flag); 826 leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
830 handler = signal(SIGINT, SIG_IGN); 827 handler = signal(SIGINT, SIG_IGN);
831 cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); 828 cmd = s = read_passphrase("\r\nssh> ", RP_ECHO);
832 if (s == NULL) 829 if (s == NULL)
@@ -930,7 +927,7 @@ process_cmdline(void)
930 927
931out: 928out:
932 signal(SIGINT, handler); 929 signal(SIGINT, handler);
933 enter_raw_mode(force_tty_flag); 930 enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
934 if (cmd) 931 if (cmd)
935 xfree(cmd); 932 xfree(cmd);
936 if (fwd.listen_host != NULL) 933 if (fwd.listen_host != NULL)
@@ -1049,7 +1046,8 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr,
1049 * more new connections). 1046 * more new connections).
1050 */ 1047 */
1051 /* Restore tty modes. */ 1048 /* Restore tty modes. */
1052 leave_raw_mode(force_tty_flag); 1049 leave_raw_mode(
1050 options.request_tty == REQUEST_TTY_FORCE);
1053 1051
1054 /* Stop listening for new connections. */ 1052 /* Stop listening for new connections. */
1055 channel_stop_listening(); 1053 channel_stop_listening();
@@ -1344,7 +1342,7 @@ client_channel_closed(int id, void *arg)
1344{ 1342{
1345 channel_cancel_cleanup(id); 1343 channel_cancel_cleanup(id);
1346 session_closed = 1; 1344 session_closed = 1;
1347 leave_raw_mode(force_tty_flag); 1345 leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
1348} 1346}
1349 1347
1350/* 1348/*
@@ -1415,7 +1413,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1415 signal(SIGWINCH, window_change_handler); 1413 signal(SIGWINCH, window_change_handler);
1416 1414
1417 if (have_pty) 1415 if (have_pty)
1418 enter_raw_mode(force_tty_flag); 1416 enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
1419 1417
1420 if (compat20) { 1418 if (compat20) {
1421 session_ident = ssh2_chan_id; 1419 session_ident = ssh2_chan_id;
@@ -1559,7 +1557,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1559 channel_free_all(); 1557 channel_free_all();
1560 1558
1561 if (have_pty) 1559 if (have_pty)
1562 leave_raw_mode(force_tty_flag); 1560 leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
1563 1561
1564 /* restore blocking io */ 1562 /* restore blocking io */
1565 if (!isatty(fileno(stdin))) 1563 if (!isatty(fileno(stdin)))
@@ -2142,7 +2140,7 @@ client_stop_mux(void)
2142void 2140void
2143cleanup_exit(int i) 2141cleanup_exit(int i)
2144{ 2142{
2145 leave_raw_mode(force_tty_flag); 2143 leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
2146 leave_non_blocking(); 2144 leave_non_blocking();
2147 if (options.control_path != NULL && muxserver_sock != -1) 2145 if (options.control_path != NULL && muxserver_sock != -1)
2148 unlink(options.control_path); 2146 unlink(options.control_path);