summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-02-22 05:58:57 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-02-22 05:58:57 +0000
commitc3f1d4f3cbf35fe3700fd6faf12323feb29c2383 (patch)
tree1db5a638e23b490499970b8a0182110346569d79 /usr.bin
parent1d0ea0d200214d21583af7d2258e4c6368ee0788 (diff)
closefrom() call was too early, delay it until just before we execute
the user's rc files (if any).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/session.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 31ad05578a0..4ebe10d3aca 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.229 2008/02/20 15:25:26 markus Exp $ */
+/* $OpenBSD: session.c,v 1.230 2008/02/22 05:58:56 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -435,8 +435,6 @@ do_exec_no_pty(Session *s, const char *command)
if (dup2(err[0], 2) < 0) /* stderr */
perror("dup2 stderr");
- closefrom(STDERR_FILENO + 1);
-
/* Do processing for the child (exec command etc). */
do_child(s, command);
/* NOTREACHED */
@@ -507,8 +505,6 @@ do_exec_pty(Session *s, const char *command)
if (!(options.use_login && command == NULL))
do_login(s, command);
- closefrom(STDERR_FILENO + 1);
-
/* Do common processing for the child, such as execing the command. */
do_child(s, command);
/* NOTREACHED */
@@ -1219,6 +1215,8 @@ do_child(Session *s, const char *command)
exit(1);
}
+ closefrom(STDERR_FILENO + 1);
+
if (!options.use_login)
do_rc_files(s, shell);