summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/session.c b/session.c
index 2fe511612..8720ae7be 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.175 2004/05/11 19:01:43 deraadt Exp $"); 36RCSID("$OpenBSD: session.c,v 1.176 2004/06/21 17:53:03 djm Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -481,7 +481,11 @@ do_exec_no_pty(Session *s, const char *command)
481 close(perr[1]); 481 close(perr[1]);
482 482
483 if (compat20) { 483 if (compat20) {
484 session_set_fds(s, pin[1], pout[0], s->is_subsystem ? -1 : perr[0]); 484 if (s->is_subsystem) {
485 close(perr[0]);
486 perr[0] = -1;
487 }
488 session_set_fds(s, pin[1], pout[0], perr[0]);
485 } else { 489 } else {
486 /* Enter the interactive session. */ 490 /* Enter the interactive session. */
487 server_loop(pid, pin[1], pout[0], perr[0]); 491 server_loop(pid, pin[1], pout[0], perr[0]);