diff options
author | 2008-05-09 16:17:51 +0000 | |
---|---|---|
committer | 2008-05-09 16:17:51 +0000 | |
commit | 3b44b2198578c7987baca663b1c046b17bcc004b (patch) | |
tree | 58331d459ca166e99baf9d63afcd2e119652ebfe | |
parent | re-add the USE_PIPES code and enable it. (diff) | |
download | wireguard-openbsd-3b44b2198578c7987baca663b1c046b17bcc004b.tar.xz wireguard-openbsd-3b44b2198578c7987baca663b1c046b17bcc004b.zip |
error-fd race: don't enable the error fd in the select bitmask
for channels with both in- and output closed, since the channel
will go away before we call select();
report, lots of debugging help and ok djm@
-rw-r--r-- | usr.bin/ssh/channels.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index d8a4404b849..8326b634d27 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.276 2008/05/09 04:55:56 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.277 2008/05/09 16:17:51 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -814,7 +814,8 @@ channel_pre_open(Channel *c, fd_set *readset, fd_set *writeset) } } /** XXX check close conditions, too */ - if (compat20 && c->efd != -1) { + if (compat20 && c->efd != -1 && + !(c->istate == CHAN_INPUT_CLOSED && c->ostate == CHAN_OUTPUT_CLOSED)) { if (c->extended_usage == CHAN_EXTENDED_WRITE && buffer_len(&c->extended) > 0) FD_SET(c->efd, writeset); |