summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-03-15 17:27:58 +1100
committerDamien Miller <djm@mindrot.org>2008-03-15 17:27:58 +1100
commita19390067474ab3a8ad806dbf551fd84164e78a4 (patch)
tree3ea30715afb71566bc38b3ba3d0b53ec21e21454
parent8f8b156acc3028532cfe19052772eb80ac22eb62 (diff)
- (djm) [session.c] Relocate incorrectly-placed closefrom() that was causing
crashes when used with ChrootDirectory
-rw-r--r--ChangeLog4
-rw-r--r--session.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ad61c093..e943a830 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
empty; report and patch from Peter Stuge
- (djm) [regress/test-exec.sh] Silence noise from detection of putty
commands; report from Peter Stuge
+ - (djm) [session.c] Relocate incorrectly-placed closefrom() that was causing
+ crashes when used with ChrootDirectory
20080314
- (tim) [regress/sftp-cmds.sh] s/cd/lcd/ in lls test. Reported by
@@ -3763,4 +3765,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
-$Id: ChangeLog,v 1.4878 2008/03/14 22:25:54 djm Exp $
+$Id: ChangeLog,v 1.4879 2008/03/15 06:27:58 djm Exp $
diff --git a/session.c b/session.c
index f5eaa815..92282f92 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);