summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/session.c b/session.c
index d4b57bdfb..b4d74d984 100644
--- a/session.c
+++ b/session.c
@@ -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. */
1476void 1476void
1477do_setusercontext(struct passwd *pw) 1477do_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);