diff --git a/ChangeLog b/ChangeLog index fae8d6c6d..c4cf8c35e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ sshpty.c] make ssh -Wshadow clean, no functional changes markus@ ok + - djm@cvs.openbsd.org 2004/06/21 17:53:03 + [session.c] + fix fd leak for multiple subsystem connections; with markus@ 20040620 - (tim) [configure.ac Makefile.in] Only change TEST_SHELL on broken platforms. @@ -1340,4 +1343,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3421 2004/06/22 02:56:01 dtucker Exp $ +$Id: ChangeLog,v 1.3422 2004/06/22 02:57:08 dtucker Exp $ diff --git a/session.c b/session.c index 2fe511612..8720ae7be 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.175 2004/05/11 19:01:43 deraadt Exp $"); +RCSID("$OpenBSD: session.c,v 1.176 2004/06/21 17:53:03 djm Exp $"); #include "ssh.h" #include "ssh1.h" @@ -481,7 +481,11 @@ do_exec_no_pty(Session *s, const char *command) close(perr[1]); if (compat20) { - session_set_fds(s, pin[1], pout[0], s->is_subsystem ? -1 : perr[0]); + if (s->is_subsystem) { + close(perr[0]); + perr[0] = -1; + } + session_set_fds(s, pin[1], pout[0], perr[0]); } else { /* Enter the interactive session. */ server_loop(pid, pin[1], pout[0], perr[0]);