Bugzilla – Attachment 3185 Details for
Bug 2863
sshd with ControlMaster does not close child STDERR on client exit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
close read-mode efd when channel close received
bz2863.diff (text/plain), 1.81 KB, created by
Damien Miller
on 2018-10-04 11:21:06 AEST
(
hide
)
Description:
close read-mode efd when channel close received
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2018-10-04 11:21:06 AEST
Size:
1.81 KB
patch
obsolete
>commit 8ccc71bdf7cadaaa8e9b7a35f66c2b33672253a7 >Author: Damien Miller <djm@mindrot.org> >Date: Thu Oct 4 10:11:09 2018 +1000 > > close extended-read fd when channel close received > >diff --git a/nchan.c b/nchan.c >index 7cd5edf..e781af0 100644 >--- a/nchan.c >+++ b/nchan.c >@@ -78,6 +78,7 @@ static void chan_send_eow2(struct ssh *, Channel *); > /* helper */ > static void chan_shutdown_write(struct ssh *, Channel *); > static void chan_shutdown_read(struct ssh *, Channel *); >+static void chan_shutdown_extended_read(struct ssh *, Channel *); > > static const char *ostates[] = { "open", "drain", "wait_ieof", "closed" }; > static const char *istates[] = { "open", "drain", "wait_oclose", "closed" }; >@@ -287,11 +288,13 @@ chan_rcvd_oclose(struct ssh *ssh, Channel *c) > switch (c->istate) { > case CHAN_INPUT_OPEN: > chan_shutdown_read(ssh, c); >+ chan_shutdown_extended_read(ssh, c); > chan_set_istate(c, CHAN_INPUT_CLOSED); > break; > case CHAN_INPUT_WAIT_DRAIN: > if (!(c->flags & CHAN_LOCAL)) > chan_send_eof2(ssh, c); >+ chan_shutdown_extended_read(ssh, c); > chan_set_istate(c, CHAN_INPUT_CLOSED); > break; > } >@@ -415,3 +418,22 @@ chan_shutdown_read(struct ssh *ssh, Channel *c) > } > } > } >+ >+static void >+chan_shutdown_extended_read(struct ssh *ssh, Channel *c) >+{ >+ if (c->type == SSH_CHANNEL_LARVAL || c->efd == -1) >+ return; >+ if (c->extended_usage != CHAN_EXTENDED_READ && >+ c->extended_usage != CHAN_EXTENDED_IGNORE) >+ return; >+ debug2("channel %d: %s (i%d o%d sock %d wfd %d efd %d [%s])", >+ c->self, __func__, c->istate, c->ostate, c->sock, c->rfd, c->efd, >+ channel_format_extended_usage(c)); >+ if (channel_close_fd(ssh, &c->efd) < 0) { >+ logit("channel %d: %s: close() failed for " >+ "extended fd %d [i%d o%d]: %.100s", >+ c->self, __func__, c->efd, c->istate, c->ostate, >+ strerror(errno)); >+ } >+}
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 2863
:
3182
| 3185