|
Lines 1276-1281
do_child(Session *s, const char *command
Link Here
|
| 1276 |
char *argv[ARGV_MAX]; |
1276 |
char *argv[ARGV_MAX]; |
| 1277 |
const char *shell, *shell0, *hostname = NULL; |
1277 |
const char *shell, *shell0, *hostname = NULL; |
| 1278 |
struct passwd *pw = s->pw; |
1278 |
struct passwd *pw = s->pw; |
|
|
1279 |
int r = 0; |
| 1279 |
|
1280 |
|
| 1280 |
/* remove hostkey from the child's memory */ |
1281 |
/* remove hostkey from the child's memory */ |
| 1281 |
destroy_sensitive_data(); |
1282 |
destroy_sensitive_data(); |
|
Lines 1362-1370
do_child(Session *s, const char *command
Link Here
|
| 1362 |
|
1363 |
|
| 1363 |
/* Change current directory to the user's home directory. */ |
1364 |
/* Change current directory to the user's home directory. */ |
| 1364 |
if (chdir(pw->pw_dir) < 0) { |
1365 |
if (chdir(pw->pw_dir) < 0) { |
| 1365 |
fprintf(stderr, "Could not chdir to home directory %s: %s\n", |
1366 |
/* Suppress missing homdir warning for chroot case */ |
| 1366 |
pw->pw_dir, strerror(errno)); |
1367 |
r = login_getcapbool(lc, "requirehome", 0); |
| 1367 |
if (login_getcapbool(lc, "requirehome", 0)) |
1368 |
if (r || options.chroot_directory == NULL) |
|
|
1369 |
fprintf(stderr, "Could not chdir to home " |
| 1370 |
"directory %s: %s\n", pw->pw_dir, |
| 1371 |
strerror(errno)); |
| 1372 |
if (r) |
| 1368 |
exit(1); |
1373 |
exit(1); |
| 1369 |
} |
1374 |
} |
| 1370 |
|
1375 |
|