Bugzilla – Attachment 1528 Details for
Bug 1463
Running nohup sleep 70 & and then exiting shell, hangs ssh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Do not rely on isatty(ptymaster)
openssh-5.0p1-ptymaster.patch (text/plain), 4.07 KB, created by
Darren Tucker
on 2008-06-15 15:36:21 AEST
(
hide
)
Description:
Do not rely on isatty(ptymaster)
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2008-06-15 15:36:21 AEST
Size:
4.07 KB
patch
obsolete
>diff -ru ../openssh-5.0p1.orig/channels.c ./channels.c >--- ../openssh-5.0p1.orig/channels.c 2008-04-03 08:43:57.000000000 +1100 >+++ ./channels.c 2008-06-15 15:24:59.000000000 +1000 >@@ -216,7 +216,7 @@ > */ > static void > channel_register_fds(Channel *c, int rfd, int wfd, int efd, >- int extusage, int nonblock) >+ int extusage, int nonblock, int forcetty) > { > /* Update the maximum file descriptor value. */ > channel_max_fd = MAX(channel_max_fd, rfd); >@@ -233,10 +233,10 @@ > c->extended_usage = extusage; > > /* XXX ugly hack: nonblock is only set by the server */ >- if (nonblock && isatty(c->rfd)) { >+ if (forcetty || (nonblock && isatty(c->rfd))) { > debug2("channel %d: rfd %d isatty", c->self, c->rfd); > c->isatty = 1; >- if (!isatty(c->wfd)) { >+ if (!forcetty && !isatty(c->wfd)) { > error("channel %d: wfd %d is not a tty?", > c->self, c->wfd); > } >@@ -303,7 +303,7 @@ > c->ostate = CHAN_OUTPUT_OPEN; > c->istate = CHAN_INPUT_OPEN; > c->flags = 0; >- channel_register_fds(c, rfd, wfd, efd, extusage, nonblock); >+ channel_register_fds(c, rfd, wfd, efd, extusage, nonblock, 0); > c->self = found; > c->type = type; > c->ctype = ctype; >@@ -714,13 +714,13 @@ > > void > channel_set_fds(int id, int rfd, int wfd, int efd, >- int extusage, int nonblock, u_int window_max) >+ int extusage, int nonblock, int forcetty, u_int window_max) > { > Channel *c = channel_lookup(id); > > if (c == NULL || c->type != SSH_CHANNEL_LARVAL) > fatal("channel_activate for non-larval channel %d.", id); >- channel_register_fds(c, rfd, wfd, efd, extusage, nonblock); >+ channel_register_fds(c, rfd, wfd, efd, extusage, nonblock, forcetty); > c->type = SSH_CHANNEL_OPEN; > c->local_window = c->local_window_max = window_max; > packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); >diff -ru ../openssh-5.0p1.orig/channels.h ./channels.h >--- ../openssh-5.0p1.orig/channels.h 2007-06-12 23:38:54.000000000 +1000 >+++ ./channels.h 2008-06-15 15:24:59.000000000 +1000 >@@ -162,7 +162,7 @@ > Channel *channel_by_id(int); > Channel *channel_lookup(int); > Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int); >-void channel_set_fds(int, int, int, int, int, int, u_int); >+void channel_set_fds(int, int, int, int, int, int, int, u_int); > void channel_free(Channel *); > void channel_free_all(void); > void channel_stop_listening(void); >diff -ru ../openssh-5.0p1.orig/session.c ./session.c >--- ../openssh-5.0p1.orig/session.c 2008-03-27 11:03:05.000000000 +1100 >+++ ./session.c 2008-06-15 15:27:08.000000000 +1000 >@@ -97,7 +97,7 @@ > /* func */ > > Session *session_new(void); >-void session_set_fds(Session *, int, int, int); >+void session_set_fds(Session *, int, int, int, int); > void session_pty_cleanup(Session *); > void session_proctitle(Session *); > int session_setup_x11fwd(Session *); >@@ -510,7 +510,7 @@ > close(perr[0]); > perr[0] = -1; > } >- session_set_fds(s, pin[1], pout[0], perr[0]); >+ session_set_fds(s, pin[1], pout[0], perr[0], 0); > } else { > /* Enter the interactive session. */ > server_loop(pid, pin[1], pout[0], perr[0]); >@@ -533,7 +533,8 @@ > * handle the case that fdin and fdout are the same. > */ > if (compat20) { >- session_set_fds(s, inout[1], inout[1], s->is_subsystem ? -1 : err[1]); >+ session_set_fds(s, inout[1], inout[1], >+ s->is_subsystem ? -1 : err[1], 0); > } else { > server_loop(pid, inout[1], inout[1], err[1]); > /* server_loop has closed inout[1] and err[1]. */ >@@ -631,7 +632,7 @@ > /* Enter interactive session. */ > packet_set_interactive(1); > if (compat20) { >- session_set_fds(s, ptyfd, fdout, -1); >+ session_set_fds(s, ptyfd, fdout, -1, 1); > } else { > server_loop(pid, ptyfd, fdout, -1); > /* server_loop _has_ closed ptyfd and fdout. */ >@@ -2137,7 +2138,7 @@ > } > > void >-session_set_fds(Session *s, int fdin, int fdout, int fderr) >+session_set_fds(Session *s, int fdin, int fdout, int fderr, int forcetty) > { > if (!compat20) > fatal("session_set_fds: called for proto != 2.0"); >@@ -2150,7 +2151,7 @@ > channel_set_fds(s->chanid, > fdout, fdin, fderr, > fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ, >- 1, >+ 1, forcetty, > CHAN_SES_WINDOW_DEFAULT); > } >
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 1463
:
1501
| 1528