summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-03-07 08:33:12 +0100
committerDamien Miller <djm@mindrot.org>2008-03-07 08:33:12 +0100
commit7cb2b56b1c7e5d0824edc507b01cd78a01019590 (patch)
treead50ee74daf61a4bb7d4c583e667de5f139cb79a /session.c
parent - markus@cvs.openbsd.org 2008/02/20 15:25:26 (diff)
downloadopenssh-7cb2b56b1c7e5d0824edc507b01cd78a01019590.tar.xz
openssh-7cb2b56b1c7e5d0824edc507b01cd78a01019590.zip
- djm@cvs.openbsd.org 2008/02/22 05:58:56
[session.c] closefrom() call was too early, delay it until just before we execute the user's rc files (if any).
Diffstat (limited to 'session.c')
-rw-r--r--session.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/session.c b/session.c
index 7a97ae8d6..3eba513de 100644
--- a/session.c
+++ b/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
@@ -488,8 +488,6 @@ do_exec_no_pty(Session *s, const char *command)
cray_init_job(s->pw); /* set up cray jid and tmpdir */
#endif
- closefrom(STDERR_FILENO + 1);
-
/* Do processing for the child (exec command etc). */
do_child(s, command);
/* NOTREACHED */
@@ -610,8 +608,6 @@ do_exec_pty(Session *s, const char *command)
# endif
#endif
- closefrom(STDERR_FILENO + 1);
-
/* Do common processing for the child, such as execing the command. */
do_child(s, command);
/* NOTREACHED */
@@ -1345,6 +1341,8 @@ 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));