Bugzilla – Attachment 1146 Details for
Bug 1199
ssh sends invalid ttymodes when stdin is not a tty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Daniel's patch
ttymodes.diff (text/plain), 1.92 KB, created by
Damien Miller
on 2006-06-23 18:17:43 AEST
(
hide
)
Description:
Daniel's patch
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2006-06-23 18:17:43 AEST
Size:
1.92 KB
patch
obsolete
>--- openssh-4.3p2/ttymodes.c~ 2006-06-19 17:39:52.000000000 +0200 >+++ openssh-4.3p2/ttymodes.c 2006-06-19 17:41:30.000000000 +0200 >@@ -292,6 +292,9 @@ > } > > if (tiop == NULL) { >+ if (fd == -1) >+ goto end; >+ > if (tcgetattr(fd, &tio) == -1) { > logit("tcgetattr: %.100s", strerror(errno)); > goto end; >--- openssh-4.3p2/clientloop.c~ 2006-06-19 17:27:58.000000000 +0200 >+++ openssh-4.3p2/clientloop.c 2006-06-19 17:38:22.000000000 +0200 >@@ -1862,6 +1862,7 @@ > if (want_tty) { > struct winsize ws; > struct termios tio; >+ struct termios *tmptiop = NULL; > > /* Store window size in the packet. */ > if (ioctl(in_fd, TIOCGWINSZ, &ws) < 0) >@@ -1873,8 +1874,14 @@ > packet_put_int(ws.ws_row); > packet_put_int(ws.ws_xpixel); > packet_put_int(ws.ws_ypixel); >- tio = get_saved_tio(); >- tty_make_modes(-1, tiop != NULL ? tiop : &tio); >+ >+ tmptiop = tiop; >+ if ((tmptiop == NULL) && get_saved_tio_valid()) { >+ tio = get_saved_tio(); >+ tmptiop = &tio; >+ } >+ >+ tty_make_modes(-1, tmptiop); > packet_send(); > /* XXX wait for reply */ > c->client_tty = 1; >--- openssh-4.3p2/sshpty.h~ 2006-06-19 17:32:21.000000000 +0200 >+++ openssh-4.3p2/sshpty.h 2006-06-19 17:32:43.000000000 +0200 >@@ -17,6 +17,7 @@ > #ifndef SSHPTY_H > #define SSHPTY_H > >+int get_saved_tio_valid(void); > struct termios get_saved_tio(void); > void leave_raw_mode(void); > void enter_raw_mode(void); >--- openssh-4.3p2/sshtty.c~ 2006-06-19 17:29:53.000000000 +0200 >+++ openssh-4.3p2/sshtty.c 2006-06-19 17:31:29.000000000 +0200 >@@ -40,9 +40,16 @@ > #include "sshpty.h" > #include "log.h" > >+static int _saved_tio_valid; > static struct termios _saved_tio; > static int _in_raw_mode = 0; > >+ >+int get_saved_tio_valid(void) >+{ >+ return _saved_tio_valid; >+} >+ > struct termios > get_saved_tio(void) > { >@@ -70,6 +77,7 @@ > return; > } > _saved_tio = tio; >+ _saved_tio_valid = 1; > tio.c_iflag |= IGNPAR; > tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); > #ifdef IUCLC >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1199
:
1146
|
1502