]> andersk Git - openssh.git/commitdiff
- (djm) [session.c] Relocate incorrectly-placed closefrom() that was causing
authordjm <djm>
Sat, 15 Mar 2008 06:27:58 +0000 (06:27 +0000)
committerdjm <djm>
Sat, 15 Mar 2008 06:27:58 +0000 (06:27 +0000)
   crashes when used with ChrootDirectory

ChangeLog
session.c

index f63a25db0c0351042eca7fcb263b164f6af1a95c..ea5d59a45195f10391f02a26fc5f5584caacf543 100644 (file)
--- 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
index f5eaa815caa980c8442f4e74f142198ee890acb6..92282f92a8b70f98cb4253d1d015a2e486572ea9 100644 (file)
--- 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);
 
This page took 1.436228 seconds and 5 git commands to generate.