summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-10-09 10:12:09 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-10-09 10:12:09 +0000
commitcfd7b16081bce684d545aeda39fb0b123b98b93e (patch)
tree806707e0d887440221362cf75a8b5ffa7896835a /usr.bin
parentd963d47a2b48a473532d2093b6f5b9963ef5f11f (diff)
chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/session.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index f678c1634f3..9957dc11800 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/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"
@@ -967,16 +967,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.
@@ -995,6 +985,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).