diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1474,7 +1474,7 @@ safely_chroot(const char *path, uid_t uid) | |||
1474 | 1474 | ||
1475 | /* Set login name, uid, gid, and groups. */ | 1475 | /* Set login name, uid, gid, and groups. */ |
1476 | void | 1476 | void |
1477 | do_setusercontext(struct passwd *pw) | 1477 | do_setusercontext(struct passwd *pw, const char *role) |
1478 | { | 1478 | { |
1479 | char *chroot_path, *tmp; | 1479 | char *chroot_path, *tmp; |
1480 | 1480 | ||
@@ -1502,7 +1502,7 @@ do_setusercontext(struct passwd *pw) | |||
1502 | endgrent(); | 1502 | endgrent(); |
1503 | #endif | 1503 | #endif |
1504 | 1504 | ||
1505 | platform_setusercontext_post_groups(pw); | 1505 | platform_setusercontext_post_groups(pw, role); |
1506 | 1506 | ||
1507 | if (options.chroot_directory != NULL && | 1507 | if (options.chroot_directory != NULL && |
1508 | strcasecmp(options.chroot_directory, "none") != 0) { | 1508 | strcasecmp(options.chroot_directory, "none") != 0) { |
@@ -1646,7 +1646,7 @@ do_child(Session *s, const char *command) | |||
1646 | 1646 | ||
1647 | /* Force a password change */ | 1647 | /* Force a password change */ |
1648 | if (s->authctxt->force_pwchange) { | 1648 | if (s->authctxt->force_pwchange) { |
1649 | do_setusercontext(pw); | 1649 | do_setusercontext(pw, s->authctxt->role); |
1650 | child_close_fds(); | 1650 | child_close_fds(); |
1651 | do_pwchange(s); | 1651 | do_pwchange(s); |
1652 | exit(1); | 1652 | exit(1); |
@@ -1673,7 +1673,7 @@ do_child(Session *s, const char *command) | |||
1673 | /* When PAM is enabled we rely on it to do the nologin check */ | 1673 | /* When PAM is enabled we rely on it to do the nologin check */ |
1674 | if (!options.use_pam) | 1674 | if (!options.use_pam) |
1675 | do_nologin(pw); | 1675 | do_nologin(pw); |
1676 | do_setusercontext(pw); | 1676 | do_setusercontext(pw, s->authctxt->role); |
1677 | /* | 1677 | /* |
1678 | * PAM session modules in do_setusercontext may have | 1678 | * PAM session modules in do_setusercontext may have |
1679 | * generated messages, so if this in an interactive | 1679 | * generated messages, so if this in an interactive |
@@ -2084,7 +2084,7 @@ session_pty_req(Session *s) | |||
2084 | tty_parse_modes(s->ttyfd, &n_bytes); | 2084 | tty_parse_modes(s->ttyfd, &n_bytes); |
2085 | 2085 | ||
2086 | if (!use_privsep) | 2086 | if (!use_privsep) |
2087 | pty_setowner(s->pw, s->tty); | 2087 | pty_setowner(s->pw, s->tty, s->authctxt->role); |
2088 | 2088 | ||
2089 | /* Set window size from the packet. */ | 2089 | /* Set window size from the packet. */ |
2090 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); | 2090 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |