summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-09 22:26:23 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-09 22:26:23 +1100
commit37c1b3d6fc9043123f33e64051ea56656a5e7ef4 (patch)
tree644c0ffdcb779ac87c50a223f39ded86570f48a3 /clientloop.c
parent838891fe85308399c4f350f8174013987b6a2f85 (diff)
- djm@cvs.openbsd.org 2010/01/09 05:04:24
[mux.c sshpty.h clientloop.c sshtty.c] quell tc[gs]etattr warnings when forcing a tty (ssh -tt), since we usually don't actually have a tty to read/set; bz#1686 ok dtucker@
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c23
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 */
131extern char *host; 131extern char *host;
132 132
133/* Force TTY allocation */
134extern 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
637static void 640static 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
878out: 881out:
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)
2062void 2065void
2063cleanup_exit(int i) 2066cleanup_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);