- djm@cvs.openbsd.org 2004/10/29 21:47:15
[channels.c channels.h clientloop.c] fix some window size change bugs for multiplexed connections: windows sizes were not being updated if they had changed after ~^Z suspends and SIGWINCH was not being processed unless the first connection had requested a tty; ok markus
This commit is contained in:
parent
b2694f0e8a
commit
5d78de6283
|
@ -45,6 +45,12 @@
|
|||
- markus@cvs.openbsd.org 2004/10/20 11:48:53
|
||||
[packet.c ssh1.h]
|
||||
disconnect for invalid (out of range) message types.
|
||||
- djm@cvs.openbsd.org 2004/10/29 21:47:15
|
||||
[channels.c channels.h clientloop.c]
|
||||
fix some window size change bugs for multiplexed connections: windows sizes
|
||||
were not being updated if they had changed after ~^Z suspends and SIGWINCH
|
||||
was not being processed unless the first connection had requested a tty;
|
||||
ok markus
|
||||
|
||||
20041102
|
||||
- (dtucker) [configure.ac includes.h] Bug #947: Fix compile error on HP-UX
|
||||
|
@ -1824,4 +1830,4 @@
|
|||
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
|
||||
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
|
||||
|
||||
$Id: ChangeLog,v 1.3574 2004/11/05 09:27:54 dtucker Exp $
|
||||
$Id: ChangeLog,v 1.3575 2004/11/05 09:35:44 dtucker Exp $
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: channels.c,v 1.210 2004/08/23 11:48:47 djm Exp $");
|
||||
RCSID("$OpenBSD: channels.c,v 1.211 2004/10/29 21:47:15 djm Exp $");
|
||||
|
||||
#include "ssh.h"
|
||||
#include "ssh1.h"
|
||||
|
@ -2577,7 +2577,7 @@ channel_send_window_changes(void)
|
|||
struct winsize ws;
|
||||
|
||||
for (i = 0; i < channels_alloc; i++) {
|
||||
if (channels[i] == NULL ||
|
||||
if (channels[i] == NULL || !channels[i]->client_tty ||
|
||||
channels[i]->type != SSH_CHANNEL_OPEN)
|
||||
continue;
|
||||
if (ioctl(channels[i]->rfd, TIOCGWINSZ, &ws) < 0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: channels.h,v 1.74 2004/08/11 21:43:04 avsm Exp $ */
|
||||
/* $OpenBSD: channels.h,v 1.75 2004/10/29 21:47:15 djm Exp $ */
|
||||
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
|
@ -79,6 +79,7 @@ struct Channel {
|
|||
int ctl_fd; /* control fd (client sharing) */
|
||||
int isatty; /* rfd is a tty */
|
||||
int wfd_isatty; /* wfd is a tty */
|
||||
int client_tty; /* (client) TTY has been requested */
|
||||
int force_drain; /* force close on iEOF */
|
||||
int delayed; /* fdset hack */
|
||||
Buffer input; /* data read from socket, to be sent over
|
||||
|
|
27
clientloop.c
27
clientloop.c
|
@ -59,7 +59,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: clientloop.c,v 1.131 2004/09/07 23:41:30 djm Exp $");
|
||||
RCSID("$OpenBSD: clientloop.c,v 1.132 2004/10/29 21:47:15 djm Exp $");
|
||||
|
||||
#include "ssh.h"
|
||||
#include "ssh1.h"
|
||||
|
@ -432,8 +432,6 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
|
|||
static void
|
||||
client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
|
||||
{
|
||||
struct winsize oldws, newws;
|
||||
|
||||
/* Flush stdout and stderr buffers. */
|
||||
if (buffer_len(bout) > 0)
|
||||
atomicio(vwrite, fileno(stdout), buffer_ptr(bout), buffer_len(bout));
|
||||
|
@ -450,19 +448,11 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
|
|||
buffer_free(bout);
|
||||
buffer_free(berr);
|
||||
|
||||
/* Save old window size. */
|
||||
ioctl(fileno(stdin), TIOCGWINSZ, &oldws);
|
||||
|
||||
/* Send the suspend signal to the program itself. */
|
||||
kill(getpid(), SIGTSTP);
|
||||
|
||||
/* Check if the window size has changed. */
|
||||
if (ioctl(fileno(stdin), TIOCGWINSZ, &newws) >= 0 &&
|
||||
(oldws.ws_row != newws.ws_row ||
|
||||
oldws.ws_col != newws.ws_col ||
|
||||
oldws.ws_xpixel != newws.ws_xpixel ||
|
||||
oldws.ws_ypixel != newws.ws_ypixel))
|
||||
received_window_change_signal = 1;
|
||||
/* Reset window sizes in case they have changed */
|
||||
received_window_change_signal = 1;
|
||||
|
||||
/* OK, we have been continued by the user. Reinitialize buffers. */
|
||||
buffer_init(bin);
|
||||
|
@ -1204,8 +1194,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
|
|||
signal(SIGQUIT, signal_handler);
|
||||
if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
|
||||
signal(SIGTERM, signal_handler);
|
||||
if (have_pty)
|
||||
signal(SIGWINCH, window_change_handler);
|
||||
signal(SIGWINCH, window_change_handler);
|
||||
|
||||
if (have_pty)
|
||||
enter_raw_mode();
|
||||
|
@ -1313,8 +1302,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
|
|||
/* Terminate the session. */
|
||||
|
||||
/* Stop watching for window change. */
|
||||
if (have_pty)
|
||||
signal(SIGWINCH, SIG_DFL);
|
||||
signal(SIGWINCH, SIG_DFL);
|
||||
|
||||
channel_free_all();
|
||||
|
||||
|
@ -1681,9 +1669,13 @@ client_session2_setup(int id, int want_tty, int want_subsystem,
|
|||
dispatch_fn *subsys_repl)
|
||||
{
|
||||
int len;
|
||||
Channel *c = NULL;
|
||||
|
||||
debug2("%s: id %d", __func__, id);
|
||||
|
||||
if ((c = channel_lookup(id)) == NULL)
|
||||
fatal("client_session2_setup: channel %d: unknown channel", id);
|
||||
|
||||
if (want_tty) {
|
||||
struct winsize ws;
|
||||
struct termios tio;
|
||||
|
@ -1702,6 +1694,7 @@ client_session2_setup(int id, int want_tty, int want_subsystem,
|
|||
tty_make_modes(-1, tiop != NULL ? tiop : &tio);
|
||||
packet_send();
|
||||
/* XXX wait for reply */
|
||||
c->client_tty = 1;
|
||||
}
|
||||
|
||||
/* Transfer any environment variables from client to server */
|
||||
|
|
Loading…
Reference in New Issue