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 3e96557b8..6f389ac66 100644
--- a/session.c
+++ b/session.c
@@ -1486,7 +1486,7 @@ safely_chroot(const char *path, uid_t uid)
1486 1486
1487/* Set login name, uid, gid, and groups. */ 1487/* Set login name, uid, gid, and groups. */
1488void 1488void
1489do_setusercontext(struct passwd *pw) 1489do_setusercontext(struct passwd *pw, const char *role)
1490{ 1490{
1491 char *chroot_path, *tmp; 1491 char *chroot_path, *tmp;
1492#ifdef USE_LIBIAF 1492#ifdef USE_LIBIAF
@@ -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 (options.chroot_directory != NULL && 1522 if (options.chroot_directory != NULL &&
1523 strcasecmp(options.chroot_directory, "none") != 0) { 1523 strcasecmp(options.chroot_directory, "none") != 0) {
@@ -1676,7 +1676,7 @@ do_child(Session *s, const char *command)
1676 1676
1677 /* Force a password change */ 1677 /* Force a password change */
1678 if (s->authctxt->force_pwchange) { 1678 if (s->authctxt->force_pwchange) {
1679 do_setusercontext(pw); 1679 do_setusercontext(pw, s->authctxt->role);
1680 child_close_fds(); 1680 child_close_fds();
1681 do_pwchange(s); 1681 do_pwchange(s);
1682 exit(1); 1682 exit(1);
@@ -1703,7 +1703,7 @@ do_child(Session *s, const char *command)
1703 /* When PAM is enabled we rely on it to do the nologin check */ 1703 /* When PAM is enabled we rely on it to do the nologin check */
1704 if (!options.use_pam) 1704 if (!options.use_pam)
1705 do_nologin(pw); 1705 do_nologin(pw);
1706 do_setusercontext(pw); 1706 do_setusercontext(pw, s->authctxt->role);
1707 /* 1707 /*
1708 * PAM session modules in do_setusercontext may have 1708 * PAM session modules in do_setusercontext may have
1709 * generated messages, so if this in an interactive 1709 * generated messages, so if this in an interactive
@@ -2114,7 +2114,7 @@ session_pty_req(Session *s)
2114 tty_parse_modes(s->ttyfd, &n_bytes); 2114 tty_parse_modes(s->ttyfd, &n_bytes);
2115 2115
2116 if (!use_privsep) 2116 if (!use_privsep)
2117 pty_setowner(s->pw, s->tty); 2117 pty_setowner(s->pw, s->tty, s->authctxt->role);
2118 2118
2119 /* Set window size from the packet. */ 2119 /* Set window size from the packet. */
2120 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); 2120 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);