diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | sshpty.h | 4 | ||||
-rw-r--r-- | sshtty.c | 6 | ||||
-rw-r--r-- | ttymodes.c | 10 |
4 files changed, 17 insertions, 11 deletions
@@ -5,6 +5,12 @@ | |||
5 | - (dtucker) OpenBSD CVS Sync | 5 | - (dtucker) OpenBSD CVS Sync |
6 | - djm@cvs.openbsd.org 2008/05/19 06:14:02 | 6 | - djm@cvs.openbsd.org 2008/05/19 06:14:02 |
7 | [packet.c] unbreak protocol keepalive timeouts bz#1465; ok dtucker@ | 7 | [packet.c] unbreak protocol keepalive timeouts bz#1465; ok dtucker@ |
8 | - djm@cvs.openbsd.org 2008/05/19 15:45:07 | ||
9 | [sshtty.c ttymodes.c sshpty.h] | ||
10 | Fix sending tty modes when stdin is not a tty (bz#1199). Previously | ||
11 | we would send the modes corresponding to a zeroed struct termios, | ||
12 | whereas we should have been sending an empty list of modes. | ||
13 | Based on patch from daniel.ritz AT alcatel.ch; ok dtucker@ markus@ | ||
8 | 14 | ||
9 | 20080604 | 15 | 20080604 |
10 | - (djm) [openbsd-compat/bsd-arc4random.c] Fix math bug that caused bias | 16 | - (djm) [openbsd-compat/bsd-arc4random.c] Fix math bug that caused bias |
@@ -4036,4 +4042,4 @@ | |||
4036 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4042 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4037 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4043 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4038 | 4044 | ||
4039 | $Id: ChangeLog,v 1.4939 2008/06/08 02:49:30 dtucker Exp $ | 4045 | $Id: ChangeLog,v 1.4940 2008/06/08 02:53:20 dtucker Exp $ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshpty.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: sshpty.h,v 1.11 2008/05/19 15:45:07 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include <termios.h> | 17 | #include <termios.h> |
18 | 18 | ||
19 | struct termios get_saved_tio(void); | 19 | struct termios *get_saved_tio(void); |
20 | void leave_raw_mode(void); | 20 | void leave_raw_mode(void); |
21 | void enter_raw_mode(void); | 21 | void enter_raw_mode(void); |
22 | 22 | ||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshtty.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: sshtty.c,v 1.13 2008/05/19 15:45:07 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 |
@@ -47,10 +47,10 @@ | |||
47 | static struct termios _saved_tio; | 47 | static struct termios _saved_tio; |
48 | static int _in_raw_mode = 0; | 48 | static int _in_raw_mode = 0; |
49 | 49 | ||
50 | struct termios | 50 | struct termios * |
51 | get_saved_tio(void) | 51 | get_saved_tio(void) |
52 | { | 52 | { |
53 | return _saved_tio; | 53 | return _in_raw_mode ? &_saved_tio : NULL; |
54 | } | 54 | } |
55 | 55 | ||
56 | void | 56 | void |
diff --git a/ttymodes.c b/ttymodes.c index d8e2c553a..d11d00c28 100644 --- a/ttymodes.c +++ b/ttymodes.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ttymodes.c,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: ttymodes.c,v 1.27 2008/05/19 15:45:07 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 |
@@ -298,6 +298,10 @@ tty_make_modes(int fd, struct termios *tiop) | |||
298 | } | 298 | } |
299 | 299 | ||
300 | if (tiop == NULL) { | 300 | if (tiop == NULL) { |
301 | if (fd == -1) { | ||
302 | debug("tty_make_modes: no fd or tio"); | ||
303 | goto end; | ||
304 | } | ||
301 | if (tcgetattr(fd, &tio) == -1) { | 305 | if (tcgetattr(fd, &tio) == -1) { |
302 | logit("tcgetattr: %.100s", strerror(errno)); | 306 | logit("tcgetattr: %.100s", strerror(errno)); |
303 | goto end; | 307 | goto end; |
@@ -317,12 +321,10 @@ tty_make_modes(int fd, struct termios *tiop) | |||
317 | 321 | ||
318 | /* Store values of mode flags. */ | 322 | /* Store values of mode flags. */ |
319 | #define TTYCHAR(NAME, OP) \ | 323 | #define TTYCHAR(NAME, OP) \ |
320 | debug3("tty_make_modes: %d %d", OP, tio.c_cc[NAME]); \ | ||
321 | buffer_put_char(&buf, OP); \ | 324 | buffer_put_char(&buf, OP); \ |
322 | put_arg(&buf, special_char_encode(tio.c_cc[NAME])); | 325 | put_arg(&buf, special_char_encode(tio.c_cc[NAME])); |
323 | 326 | ||
324 | #define TTYMODE(NAME, FIELD, OP) \ | 327 | #define TTYMODE(NAME, FIELD, OP) \ |
325 | debug3("tty_make_modes: %d %d", OP, ((tio.FIELD & NAME) != 0)); \ | ||
326 | buffer_put_char(&buf, OP); \ | 328 | buffer_put_char(&buf, OP); \ |
327 | put_arg(&buf, ((tio.FIELD & NAME) != 0)); | 329 | put_arg(&buf, ((tio.FIELD & NAME) != 0)); |
328 | 330 | ||
@@ -410,7 +412,6 @@ tty_parse_modes(int fd, int *n_bytes_ptr) | |||
410 | case OP: \ | 412 | case OP: \ |
411 | n_bytes += arg_size; \ | 413 | n_bytes += arg_size; \ |
412 | tio.c_cc[NAME] = special_char_decode(get_arg()); \ | 414 | tio.c_cc[NAME] = special_char_decode(get_arg()); \ |
413 | debug3("tty_parse_modes: %d %d", OP, tio.c_cc[NAME]); \ | ||
414 | break; | 415 | break; |
415 | #define TTYMODE(NAME, FIELD, OP) \ | 416 | #define TTYMODE(NAME, FIELD, OP) \ |
416 | case OP: \ | 417 | case OP: \ |
@@ -419,7 +420,6 @@ tty_parse_modes(int fd, int *n_bytes_ptr) | |||
419 | tio.FIELD |= NAME; \ | 420 | tio.FIELD |= NAME; \ |
420 | else \ | 421 | else \ |
421 | tio.FIELD &= ~NAME; \ | 422 | tio.FIELD &= ~NAME; \ |
422 | debug3("tty_parse_modes: %d %d", OP, arg); \ | ||
423 | break; | 423 | break; |
424 | 424 | ||
425 | #include "ttymodes.h" | 425 | #include "ttymodes.h" |