diff options
author | Damien Miller <djm@mindrot.org> | 2001-10-10 15:07:44 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-10-10 15:07:44 +1000 |
commit | 139d4cd9087bb3eaf751406016bc2223d7d0d7b1 (patch) | |
tree | 618f354b6eaa84a7a39d4a407f129adfb1711e7a /session.c | |
parent | 7ea6f204b67039e09c79dfb3049a88806e5d1ea3 (diff) |
- markus@cvs.openbsd.org 2001/10/09 10:12:08
[session.c]
chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.103 2001/10/06 00:36:42 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.104 2001/10/09 10:12:08 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1342,16 +1342,6 @@ do_child(Session *s, const char *command) | |||
1342 | for (i = 3; i < 64; i++) | 1342 | for (i = 3; i < 64; i++) |
1343 | close(i); | 1343 | close(i); |
1344 | 1344 | ||
1345 | /* Change current directory to the user\'s home directory. */ | ||
1346 | if (chdir(pw->pw_dir) < 0) { | ||
1347 | fprintf(stderr, "Could not chdir to home directory %s: %s\n", | ||
1348 | pw->pw_dir, strerror(errno)); | ||
1349 | #ifdef HAVE_LOGIN_CAP | ||
1350 | if (login_getcapbool(lc, "requirehome", 0)) | ||
1351 | exit(1); | ||
1352 | #endif | ||
1353 | } | ||
1354 | |||
1355 | /* | 1345 | /* |
1356 | * Must take new environment into use so that .ssh/rc, /etc/sshrc and | 1346 | * Must take new environment into use so that .ssh/rc, /etc/sshrc and |
1357 | * xauth are run in the proper environment. | 1347 | * xauth are run in the proper environment. |
@@ -1370,6 +1360,16 @@ do_child(Session *s, const char *command) | |||
1370 | } | 1360 | } |
1371 | #endif /* AFS */ | 1361 | #endif /* AFS */ |
1372 | 1362 | ||
1363 | /* Change current directory to the user\'s home directory. */ | ||
1364 | if (chdir(pw->pw_dir) < 0) { | ||
1365 | fprintf(stderr, "Could not chdir to home directory %s: %s\n", | ||
1366 | pw->pw_dir, strerror(errno)); | ||
1367 | #ifdef HAVE_LOGIN_CAP | ||
1368 | if (login_getcapbool(lc, "requirehome", 0)) | ||
1369 | exit(1); | ||
1370 | #endif | ||
1371 | } | ||
1372 | |||
1373 | /* | 1373 | /* |
1374 | * Run $HOME/.ssh/rc, /etc/sshrc, or xauth (whichever is found first | 1374 | * Run $HOME/.ssh/rc, /etc/sshrc, or xauth (whichever is found first |
1375 | * in this order). | 1375 | * in this order). |