- (djm) Fix ssh2 hang on background processes at logout.

This commit is contained in:
Damien Miller 2000-10-15 12:21:32 +11:00
parent b4df15d1e1
commit 5993935f76
4 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,6 @@
20001015
- (djm) Fix ssh2 hang on background processes at logout.
20001014 20001014
- (bal) Add support for realpath and getcwd for platforms with broken - (bal) Add support for realpath and getcwd for platforms with broken
or missing realpath implementations for sftp-server. or missing realpath implementations for sftp-server.

View File

@ -1,6 +1,8 @@
#ifndef _RIJNDAEL_H_ #ifndef _RIJNDAEL_H_
#define _RIJNDAEL_H_ #define _RIJNDAEL_H_
#include "config.h"
/* 1. Standard types for AES cryptography source code */ /* 1. Standard types for AES cryptography source code */
typedef u_int8_t u1byte; /* an 8 bit unsigned character type */ typedef u_int8_t u1byte; /* an 8 bit unsigned character type */

View File

@ -671,7 +671,8 @@ server_loop2(void)
if (packet_not_very_much_data_to_write()) if (packet_not_very_much_data_to_write())
channel_output_poll(); channel_output_poll();
wait_until_can_do_something(&readset, &writeset, 0); wait_until_can_do_something(&readset, &writeset, 0);
if (child_terminated) { if (child_terminated && child_has_selected) {
/* XXX: race - assumes only one child has terminated */
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
session_close_by_pid(pid, status); session_close_by_pid(pid, status);
child_terminated = 0; child_terminated = 0;

View File

@ -1846,9 +1846,13 @@ session_exit_message(Session *s, int status)
* interested in data we write. * interested in data we write.
* Note that we must not call 'chan_read_failed', since there could * Note that we must not call 'chan_read_failed', since there could
* be some more data waiting in the pipe. * be some more data waiting in the pipe.
* djm - This is no longer true as we have allowed one pass through
* the select loop before killing the connection
*/ */
if (c->ostate != CHAN_OUTPUT_CLOSED) if (c->ostate != CHAN_OUTPUT_CLOSED)
chan_write_failed(c); chan_write_failed(c);
if (c->istate != CHAN_INPUT_CLOSED)
chan_read_failed(c);
s->chanid = -1; s->chanid = -1;
} }