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 2bcf8185c..6848df42f 100644
--- a/session.c
+++ b/session.c
@@ -1502,7 +1502,7 @@ safely_chroot(const char *path, uid_t uid)
1502 1502
1503/* Set login name, uid, gid, and groups. */ 1503/* Set login name, uid, gid, and groups. */
1504void 1504void
1505do_setusercontext(struct passwd *pw) 1505do_setusercontext(struct passwd *pw, const char *role)
1506{ 1506{
1507 char *chroot_path, *tmp; 1507 char *chroot_path, *tmp;
1508 1508
@@ -1530,7 +1530,7 @@ do_setusercontext(struct passwd *pw)
1530 endgrent(); 1530 endgrent();
1531#endif 1531#endif
1532 1532
1533 platform_setusercontext_post_groups(pw); 1533 platform_setusercontext_post_groups(pw, role);
1534 1534
1535 if (options.chroot_directory != NULL && 1535 if (options.chroot_directory != NULL &&
1536 strcasecmp(options.chroot_directory, "none") != 0) { 1536 strcasecmp(options.chroot_directory, "none") != 0) {
@@ -1679,7 +1679,7 @@ do_child(Session *s, const char *command)
1679 1679
1680 /* Force a password change */ 1680 /* Force a password change */
1681 if (s->authctxt->force_pwchange) { 1681 if (s->authctxt->force_pwchange) {
1682 do_setusercontext(pw); 1682 do_setusercontext(pw, s->authctxt->role);
1683 child_close_fds(); 1683 child_close_fds();
1684 do_pwchange(s); 1684 do_pwchange(s);
1685 exit(1); 1685 exit(1);
@@ -1706,7 +1706,7 @@ do_child(Session *s, const char *command)
1706 /* When PAM is enabled we rely on it to do the nologin check */ 1706 /* When PAM is enabled we rely on it to do the nologin check */
1707 if (!options.use_pam) 1707 if (!options.use_pam)
1708 do_nologin(pw); 1708 do_nologin(pw);
1709 do_setusercontext(pw); 1709 do_setusercontext(pw, s->authctxt->role);
1710 /* 1710 /*
1711 * PAM session modules in do_setusercontext may have 1711 * PAM session modules in do_setusercontext may have
1712 * generated messages, so if this in an interactive 1712 * generated messages, so if this in an interactive
@@ -2117,7 +2117,7 @@ session_pty_req(Session *s)
2117 tty_parse_modes(s->ttyfd, &n_bytes); 2117 tty_parse_modes(s->ttyfd, &n_bytes);
2118 2118
2119 if (!use_privsep) 2119 if (!use_privsep)
2120 pty_setowner(s->pw, s->tty); 2120 pty_setowner(s->pw, s->tty, s->authctxt->role);
2121 2121
2122 /* Set window size from the packet. */ 2122 /* Set window size from the packet. */
2123 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); 2123 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);