diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | clientloop.c | 14 |
2 files changed, 13 insertions, 7 deletions
@@ -1,6 +1,12 @@ | |||
1 | 20110116 | 1 | 20110116 |
2 | - (dtucker) [Makefile.in configure.ac regress/kextype.sh] Skip sha256-based | 2 | - (dtucker) [Makefile.in configure.ac regress/kextype.sh] Skip sha256-based |
3 | on configurations that don't have it. | 3 | on configurations that don't have it. |
4 | - OpenBSD CVS Sync | ||
5 | - djm@cvs.openbsd.org 2011/01/16 11:50:05 | ||
6 | [clientloop.c] | ||
7 | Use atomicio when flushing protocol 1 std{out,err} buffers at | ||
8 | session close. This was a latent bug exposed by setting a SIGCHLD | ||
9 | handler and spotted by kevin.brott AT gmail.com; ok dtucker@ | ||
4 | 10 | ||
5 | 20110114 | 11 | 20110114 |
6 | - OpenBSD CVS Sync | 12 | - OpenBSD CVS Sync |
diff --git a/clientloop.c b/clientloop.c index c60b758c7..325657ba2 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.229 2011/01/11 06:13:10 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.230 2011/01/16 11:50:05 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 |
@@ -1591,9 +1591,9 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1591 | 1591 | ||
1592 | /* Output any buffered data for stdout. */ | 1592 | /* Output any buffered data for stdout. */ |
1593 | while (buffer_len(&stdout_buffer) > 0) { | 1593 | while (buffer_len(&stdout_buffer) > 0) { |
1594 | len = write(fileno(stdout), buffer_ptr(&stdout_buffer), | 1594 | len = atomicio(vwrite, fileno(stdout), |
1595 | buffer_len(&stdout_buffer)); | 1595 | buffer_ptr(&stdout_buffer), buffer_len(&stdout_buffer)); |
1596 | if (len <= 0) { | 1596 | if (len != buffer_len(&stdout_buffer)) { |
1597 | error("Write failed flushing stdout buffer."); | 1597 | error("Write failed flushing stdout buffer."); |
1598 | break; | 1598 | break; |
1599 | } | 1599 | } |
@@ -1602,9 +1602,9 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1602 | 1602 | ||
1603 | /* Output any buffered data for stderr. */ | 1603 | /* Output any buffered data for stderr. */ |
1604 | while (buffer_len(&stderr_buffer) > 0) { | 1604 | while (buffer_len(&stderr_buffer) > 0) { |
1605 | len = write(fileno(stderr), buffer_ptr(&stderr_buffer), | 1605 | len = atomicio(vwrite, fileno(stderr), |
1606 | buffer_len(&stderr_buffer)); | 1606 | buffer_ptr(&stderr_buffer), buffer_len(&stderr_buffer)); |
1607 | if (len <= 0) { | 1607 | if (len != buffer_len(&stderr_buffer)) { |
1608 | error("Write failed flushing stderr buffer."); | 1608 | error("Write failed flushing stderr buffer."); |
1609 | break; | 1609 | break; |
1610 | } | 1610 | } |