|
Lines 1647-1652
do_child(Session *s, const char *command
Link Here
|
| 1647 |
char *argv[ARGV_MAX]; |
1647 |
char *argv[ARGV_MAX]; |
| 1648 |
const char *shell, *shell0, *hostname = NULL; |
1648 |
const char *shell, *shell0, *hostname = NULL; |
| 1649 |
struct passwd *pw = s->pw; |
1649 |
struct passwd *pw = s->pw; |
|
|
1650 |
int r = 0; |
| 1650 |
|
1651 |
|
| 1651 |
/* remove hostkey from the child's memory */ |
1652 |
/* remove hostkey from the child's memory */ |
| 1652 |
destroy_sensitive_data(); |
1653 |
destroy_sensitive_data(); |
|
Lines 1762-1773
do_child(Session *s, const char *command
Link Here
|
| 1762 |
|
1763 |
|
| 1763 |
/* Change current directory to the user's home directory. */ |
1764 |
/* Change current directory to the user's home directory. */ |
| 1764 |
if (chdir(pw->pw_dir) < 0) { |
1765 |
if (chdir(pw->pw_dir) < 0) { |
| 1765 |
fprintf(stderr, "Could not chdir to home directory %s: %s\n", |
|
|
| 1766 |
pw->pw_dir, strerror(errno)); |
| 1767 |
#ifdef HAVE_LOGIN_CAP |
1766 |
#ifdef HAVE_LOGIN_CAP |
| 1768 |
if (login_getcapbool(lc, "requirehome", 0)) |
1767 |
r = login_getcapbool(lc, "requirehome", 0); |
| 1769 |
exit(1); |
|
|
| 1770 |
#endif |
1768 |
#endif |
|
|
1769 |
if (r || options.chroot_directory == NULL) |
| 1770 |
fprintf(stderr, "Could not chdir to home " |
| 1771 |
"directory %s: %s\n", pw->pw_dir, |
| 1772 |
strerror(errno)); |
| 1773 |
if (r) |
| 1774 |
exit(1); |
| 1771 |
} |
1775 |
} |
| 1772 |
|
1776 |
|
| 1773 |
closefrom(STDERR_FILENO + 1); |
1777 |
closefrom(STDERR_FILENO + 1); |