diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1380,7 +1380,7 @@ safely_chroot(const char *path, uid_t uid) | |||
1380 | 1380 | ||
1381 | /* Set login name, uid, gid, and groups. */ | 1381 | /* Set login name, uid, gid, and groups. */ |
1382 | void | 1382 | void |
1383 | do_setusercontext(struct passwd *pw) | 1383 | do_setusercontext(struct passwd *pw, const char *role) |
1384 | { | 1384 | { |
1385 | char uidstr[32], *chroot_path, *tmp; | 1385 | char uidstr[32], *chroot_path, *tmp; |
1386 | 1386 | ||
@@ -1408,7 +1408,7 @@ do_setusercontext(struct passwd *pw) | |||
1408 | endgrent(); | 1408 | endgrent(); |
1409 | #endif | 1409 | #endif |
1410 | 1410 | ||
1411 | platform_setusercontext_post_groups(pw); | 1411 | platform_setusercontext_post_groups(pw, role); |
1412 | 1412 | ||
1413 | if (!in_chroot && options.chroot_directory != NULL && | 1413 | if (!in_chroot && options.chroot_directory != NULL && |
1414 | strcasecmp(options.chroot_directory, "none") != 0) { | 1414 | strcasecmp(options.chroot_directory, "none") != 0) { |
@@ -1547,7 +1547,7 @@ do_child(struct ssh *ssh, Session *s, const char *command) | |||
1547 | 1547 | ||
1548 | /* Force a password change */ | 1548 | /* Force a password change */ |
1549 | if (s->authctxt->force_pwchange) { | 1549 | if (s->authctxt->force_pwchange) { |
1550 | do_setusercontext(pw); | 1550 | do_setusercontext(pw, s->authctxt->role); |
1551 | child_close_fds(ssh); | 1551 | child_close_fds(ssh); |
1552 | do_pwchange(s); | 1552 | do_pwchange(s); |
1553 | exit(1); | 1553 | exit(1); |
@@ -1565,7 +1565,7 @@ do_child(struct ssh *ssh, Session *s, const char *command) | |||
1565 | /* When PAM is enabled we rely on it to do the nologin check */ | 1565 | /* When PAM is enabled we rely on it to do the nologin check */ |
1566 | if (!options.use_pam) | 1566 | if (!options.use_pam) |
1567 | do_nologin(pw); | 1567 | do_nologin(pw); |
1568 | do_setusercontext(pw); | 1568 | do_setusercontext(pw, s->authctxt->role); |
1569 | /* | 1569 | /* |
1570 | * PAM session modules in do_setusercontext may have | 1570 | * PAM session modules in do_setusercontext may have |
1571 | * generated messages, so if this in an interactive | 1571 | * generated messages, so if this in an interactive |
@@ -1955,7 +1955,7 @@ session_pty_req(struct ssh *ssh, Session *s) | |||
1955 | ssh_tty_parse_modes(ssh, s->ttyfd); | 1955 | ssh_tty_parse_modes(ssh, s->ttyfd); |
1956 | 1956 | ||
1957 | if (!use_privsep) | 1957 | if (!use_privsep) |
1958 | pty_setowner(s->pw, s->tty); | 1958 | pty_setowner(s->pw, s->tty, s->authctxt->role); |
1959 | 1959 | ||
1960 | /* Set window size from the packet. */ | 1960 | /* Set window size from the packet. */ |
1961 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); | 1961 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |