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 7a02500ab..99ec6f363 100644
--- a/session.c
+++ b/session.c
@@ -1489,7 +1489,7 @@ safely_chroot(const char *path, uid_t uid)
1489 1489
1490/* Set login name, uid, gid, and groups. */ 1490/* Set login name, uid, gid, and groups. */
1491void 1491void
1492do_setusercontext(struct passwd *pw) 1492do_setusercontext(struct passwd *pw, const char *role)
1493{ 1493{
1494 char *chroot_path, *tmp; 1494 char *chroot_path, *tmp;
1495 1495
@@ -1517,7 +1517,7 @@ do_setusercontext(struct passwd *pw)
1517 endgrent(); 1517 endgrent();
1518#endif 1518#endif
1519 1519
1520 platform_setusercontext_post_groups(pw); 1520 platform_setusercontext_post_groups(pw, role);
1521 1521
1522 if (!in_chroot && options.chroot_directory != NULL && 1522 if (!in_chroot && options.chroot_directory != NULL &&
1523 strcasecmp(options.chroot_directory, "none") != 0) { 1523 strcasecmp(options.chroot_directory, "none") != 0) {
@@ -1674,7 +1674,7 @@ do_child(Session *s, const char *command)
1674 1674
1675 /* Force a password change */ 1675 /* Force a password change */
1676 if (s->authctxt->force_pwchange) { 1676 if (s->authctxt->force_pwchange) {
1677 do_setusercontext(pw); 1677 do_setusercontext(pw, s->authctxt->role);
1678 child_close_fds(); 1678 child_close_fds();
1679 do_pwchange(s); 1679 do_pwchange(s);
1680 exit(1); 1680 exit(1);
@@ -1701,7 +1701,7 @@ do_child(Session *s, const char *command)
1701 /* When PAM is enabled we rely on it to do the nologin check */ 1701 /* When PAM is enabled we rely on it to do the nologin check */
1702 if (!options.use_pam) 1702 if (!options.use_pam)
1703 do_nologin(pw); 1703 do_nologin(pw);
1704 do_setusercontext(pw); 1704 do_setusercontext(pw, s->authctxt->role);
1705 /* 1705 /*
1706 * PAM session modules in do_setusercontext may have 1706 * PAM session modules in do_setusercontext may have
1707 * generated messages, so if this in an interactive 1707 * generated messages, so if this in an interactive
@@ -2112,7 +2112,7 @@ session_pty_req(Session *s)
2112 tty_parse_modes(s->ttyfd, &n_bytes); 2112 tty_parse_modes(s->ttyfd, &n_bytes);
2113 2113
2114 if (!use_privsep) 2114 if (!use_privsep)
2115 pty_setowner(s->pw, s->tty); 2115 pty_setowner(s->pw, s->tty, s->authctxt->role);
2116 2116
2117 /* Set window size from the packet. */ 2117 /* Set window size from the packet. */
2118 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); 2118 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);