summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-03-15 07:27:58 +0100
committerDamien Miller <djm@mindrot.org>2008-03-15 07:27:58 +0100
commita19390067474ab3a8ad806dbf551fd84164e78a4 (patch)
tree3ea30715afb71566bc38b3ba3d0b53ec21e21454 /session.c
parent - (djm) [regress/test-exec.sh] Quote putty-related variables in case they are (diff)
downloadopenssh-a19390067474ab3a8ad806dbf551fd84164e78a4.tar.xz
openssh-a19390067474ab3a8ad806dbf551fd84164e78a4.zip
- (djm) [session.c] Relocate incorrectly-placed closefrom() that was causing
crashes when used with ChrootDirectory
Diffstat (limited to '')
-rw-r--r--session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/session.c b/session.c
index f5eaa815c..92282f92a 100644
--- a/session.c
+++ b/session.c
@@ -1328,8 +1328,6 @@ safely_chroot(const char *path, uid_t uid)
}
- closefrom(STDERR_FILENO + 1);
-
if (chdir(path) == -1)
fatal("Unable to chdir to chroot path \"%s\": "
"%s", path, strerror(errno));
@@ -1659,6 +1657,8 @@ do_child(Session *s, const char *command)
#endif
}
+ closefrom(STDERR_FILENO + 1);
+
if (!options.use_login)
do_rc_files(s, shell);