From 139d4cd9087bb3eaf751406016bc2223d7d0d7b1 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 10 Oct 2001 15:07:44 +1000 Subject: - markus@cvs.openbsd.org 2001/10/09 10:12:08 [session.c] chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu --- session.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index b89143179..0e3e933f9 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.103 2001/10/06 00:36:42 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.104 2001/10/09 10:12:08 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1342,16 +1342,6 @@ do_child(Session *s, const char *command) for (i = 3; i < 64; i++) close(i); - /* Change current directory to the user\'s home directory. */ - if (chdir(pw->pw_dir) < 0) { - fprintf(stderr, "Could not chdir to home directory %s: %s\n", - pw->pw_dir, strerror(errno)); -#ifdef HAVE_LOGIN_CAP - if (login_getcapbool(lc, "requirehome", 0)) - exit(1); -#endif - } - /* * Must take new environment into use so that .ssh/rc, /etc/sshrc and * xauth are run in the proper environment. @@ -1370,6 +1360,16 @@ do_child(Session *s, const char *command) } #endif /* AFS */ + /* Change current directory to the user\'s home directory. */ + if (chdir(pw->pw_dir) < 0) { + fprintf(stderr, "Could not chdir to home directory %s: %s\n", + pw->pw_dir, strerror(errno)); +#ifdef HAVE_LOGIN_CAP + if (login_getcapbool(lc, "requirehome", 0)) + exit(1); +#endif + } + /* * Run $HOME/.ssh/rc, /etc/sshrc, or xauth (whichever is found first * in this order). -- cgit v1.2.3