mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
- djm@cvs.openbsd.org 2011/01/16 11:50:05
[clientloop.c] Use atomicio when flushing protocol 1 std{out,err} buffers at session close. This was a latent bug exposed by setting a SIGCHLD handler and spotted by kevin.brott AT gmail.com; ok dtucker@
This commit is contained in:
parent
50c61f88ab
commit
4791f9dcec
@ -1,6 +1,12 @@
|
|||||||
20110116
|
20110116
|
||||||
- (dtucker) [Makefile.in configure.ac regress/kextype.sh] Skip sha256-based
|
- (dtucker) [Makefile.in configure.ac regress/kextype.sh] Skip sha256-based
|
||||||
on configurations that don't have it.
|
on configurations that don't have it.
|
||||||
|
- OpenBSD CVS Sync
|
||||||
|
- djm@cvs.openbsd.org 2011/01/16 11:50:05
|
||||||
|
[clientloop.c]
|
||||||
|
Use atomicio when flushing protocol 1 std{out,err} buffers at
|
||||||
|
session close. This was a latent bug exposed by setting a SIGCHLD
|
||||||
|
handler and spotted by kevin.brott AT gmail.com; ok dtucker@
|
||||||
|
|
||||||
20110114
|
20110114
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
|
14
clientloop.c
14
clientloop.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: clientloop.c,v 1.229 2011/01/11 06:13:10 djm Exp $ */
|
/* $OpenBSD: clientloop.c,v 1.230 2011/01/16 11:50:05 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* 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)
|
|||||||
|
|
||||||
/* Output any buffered data for stdout. */
|
/* Output any buffered data for stdout. */
|
||||||
while (buffer_len(&stdout_buffer) > 0) {
|
while (buffer_len(&stdout_buffer) > 0) {
|
||||||
len = write(fileno(stdout), buffer_ptr(&stdout_buffer),
|
len = atomicio(vwrite, fileno(stdout),
|
||||||
buffer_len(&stdout_buffer));
|
buffer_ptr(&stdout_buffer), buffer_len(&stdout_buffer));
|
||||||
if (len <= 0) {
|
if (len != buffer_len(&stdout_buffer)) {
|
||||||
error("Write failed flushing stdout buffer.");
|
error("Write failed flushing stdout buffer.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1602,9 +1602,9 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
|
|||||||
|
|
||||||
/* Output any buffered data for stderr. */
|
/* Output any buffered data for stderr. */
|
||||||
while (buffer_len(&stderr_buffer) > 0) {
|
while (buffer_len(&stderr_buffer) > 0) {
|
||||||
len = write(fileno(stderr), buffer_ptr(&stderr_buffer),
|
len = atomicio(vwrite, fileno(stderr),
|
||||||
buffer_len(&stderr_buffer));
|
buffer_ptr(&stderr_buffer), buffer_len(&stderr_buffer));
|
||||||
if (len <= 0) {
|
if (len != buffer_len(&stderr_buffer)) {
|
||||||
error("Write failed flushing stderr buffer.");
|
error("Write failed flushing stderr buffer.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user