summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/clientloop.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-01-09 05:04:24 +0000
committerdjm <djm@openbsd.org>2010-01-09 05:04:24 +0000
commit046f3ef4ba6097f092278f848784e6130a497dfa (patch)
tree6cee7dfc354ac8a24dced79f9d026295e66c0d61 /usr.bin/ssh/clientloop.c
parentbad place to forget a comma... (diff)
downloadwireguard-openbsd-046f3ef4ba6097f092278f848784e6130a497dfa.tar.xz
wireguard-openbsd-046f3ef4ba6097f092278f848784e6130a497dfa.zip
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 'usr.bin/ssh/clientloop.c')
-rw-r--r--usr.bin/ssh/clientloop.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index a6b8cc1c162..cb643e86e2c 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.215 2009/11/17 05:31:44 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.216 2010/01/09 05:04:24 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -122,6 +122,9 @@ extern int muxserver_sock;
*/
extern char *host;
+/* Force TTY allocation */
+extern int force_tty_flag;
+
/*
* Flag to indicate that we have received a window change signal which has
* not yet been processed. This will cause a message indicating the new
@@ -602,7 +605,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
atomicio(vwrite, fileno(stderr), buffer_ptr(berr),
buffer_len(berr));
- leave_raw_mode();
+ leave_raw_mode(force_tty_flag);
/*
* Free (and clear) the buffer to reduce the amount of data that gets
@@ -623,7 +626,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
buffer_init(bout);
buffer_init(berr);
- enter_raw_mode();
+ enter_raw_mode(force_tty_flag);
}
static void
@@ -765,7 +768,7 @@ process_cmdline(void)
bzero(&fwd, sizeof(fwd));
fwd.listen_host = fwd.connect_host = NULL;
- leave_raw_mode();
+ leave_raw_mode(force_tty_flag);
handler = signal(SIGINT, SIG_IGN);
cmd = s = read_passphrase("\r\nssh> ", RP_ECHO);
if (s == NULL)
@@ -868,7 +871,7 @@ process_cmdline(void)
out:
signal(SIGINT, handler);
- enter_raw_mode();
+ enter_raw_mode(force_tty_flag);
if (cmd)
xfree(cmd);
if (fwd.listen_host != NULL)
@@ -987,7 +990,7 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr,
* more new connections).
*/
/* Restore tty modes. */
- leave_raw_mode();
+ leave_raw_mode(force_tty_flag);
/* Stop listening for new connections. */
channel_stop_listening();
@@ -1279,7 +1282,7 @@ client_channel_closed(int id, void *arg)
{
channel_cancel_cleanup(id);
session_closed = 1;
- leave_raw_mode();
+ leave_raw_mode(force_tty_flag);
}
/*
@@ -1352,7 +1355,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
signal(SIGWINCH, window_change_handler);
if (have_pty)
- enter_raw_mode();
+ enter_raw_mode(force_tty_flag);
if (compat20) {
session_ident = ssh2_chan_id;
@@ -1486,7 +1489,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
channel_free_all();
if (have_pty)
- leave_raw_mode();
+ leave_raw_mode(force_tty_flag);
/* restore blocking io */
if (!isatty(fileno(stdin)))
@@ -2044,7 +2047,7 @@ client_init_dispatch(void)
void
cleanup_exit(int i)
{
- leave_raw_mode();
+ leave_raw_mode(force_tty_flag);
leave_non_blocking();
if (options.control_path != NULL && muxserver_sock != -1)
unlink(options.control_path);