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 4bccb62d1..d40afe4f7 100644
--- a/session.c
+++ b/session.c
@@ -1312,7 +1312,7 @@ safely_chroot(const char *path, uid_t uid)
1312 1312
1313/* Set login name, uid, gid, and groups. */ 1313/* Set login name, uid, gid, and groups. */
1314void 1314void
1315do_setusercontext(struct passwd *pw) 1315do_setusercontext(struct passwd *pw, const char *role)
1316{ 1316{
1317 char *chroot_path, *tmp; 1317 char *chroot_path, *tmp;
1318 1318
@@ -1340,7 +1340,7 @@ do_setusercontext(struct passwd *pw)
1340 endgrent(); 1340 endgrent();
1341#endif 1341#endif
1342 1342
1343 platform_setusercontext_post_groups(pw); 1343 platform_setusercontext_post_groups(pw, role);
1344 1344
1345 if (!in_chroot && options.chroot_directory != NULL && 1345 if (!in_chroot && options.chroot_directory != NULL &&
1346 strcasecmp(options.chroot_directory, "none") != 0) { 1346 strcasecmp(options.chroot_directory, "none") != 0) {
@@ -1477,7 +1477,7 @@ do_child(struct ssh *ssh, Session *s, const char *command)
1477 1477
1478 /* Force a password change */ 1478 /* Force a password change */
1479 if (s->authctxt->force_pwchange) { 1479 if (s->authctxt->force_pwchange) {
1480 do_setusercontext(pw); 1480 do_setusercontext(pw, s->authctxt->role);
1481 child_close_fds(ssh); 1481 child_close_fds(ssh);
1482 do_pwchange(s); 1482 do_pwchange(s);
1483 exit(1); 1483 exit(1);
@@ -1499,7 +1499,7 @@ do_child(struct ssh *ssh, Session *s, const char *command)
1499 /* When PAM is enabled we rely on it to do the nologin check */ 1499 /* When PAM is enabled we rely on it to do the nologin check */
1500 if (!options.use_pam) 1500 if (!options.use_pam)
1501 do_nologin(pw); 1501 do_nologin(pw);
1502 do_setusercontext(pw); 1502 do_setusercontext(pw, s->authctxt->role);
1503 /* 1503 /*
1504 * PAM session modules in do_setusercontext may have 1504 * PAM session modules in do_setusercontext may have
1505 * generated messages, so if this in an interactive 1505 * generated messages, so if this in an interactive
@@ -1891,7 +1891,7 @@ session_pty_req(struct ssh *ssh, Session *s)
1891 tty_parse_modes(s->ttyfd, &n_bytes); 1891 tty_parse_modes(s->ttyfd, &n_bytes);
1892 1892
1893 if (!use_privsep) 1893 if (!use_privsep)
1894 pty_setowner(s->pw, s->tty); 1894 pty_setowner(s->pw, s->tty, s->authctxt->role);
1895 1895
1896 /* Set window size from the packet. */ 1896 /* Set window size from the packet. */
1897 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); 1897 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);