- djm@cvs.openbsd.org 2004/06/21 17:53:03

[session.c]
     fix fd leak for multiple subsystem connections; with markus@
This commit is contained in:
Darren Tucker 2004-06-22 12:57:08 +10:00
parent 3f9fdc7121
commit 723e945b55
2 changed files with 10 additions and 3 deletions

View File

@ -18,6 +18,9 @@
sshpty.c] sshpty.c]
make ssh -Wshadow clean, no functional changes make ssh -Wshadow clean, no functional changes
markus@ ok markus@ ok
- djm@cvs.openbsd.org 2004/06/21 17:53:03
[session.c]
fix fd leak for multiple subsystem connections; with markus@
20040620 20040620
- (tim) [configure.ac Makefile.in] Only change TEST_SHELL on broken platforms. - (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) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu - (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 $

View File

@ -33,7 +33,7 @@
*/ */
#include "includes.h" #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 "ssh.h"
#include "ssh1.h" #include "ssh1.h"
@ -481,7 +481,11 @@ do_exec_no_pty(Session *s, const char *command)
close(perr[1]); close(perr[1]);
if (compat20) { 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 { } else {
/* Enter the interactive session. */ /* Enter the interactive session. */
server_loop(pid, pin[1], pout[0], perr[0]); server_loop(pid, pin[1], pout[0], perr[0]);