diff options
author | Kevin Steves <stevesk@pobox.com> | 2001-02-21 16:36:51 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@pobox.com> | 2001-02-21 16:36:51 +0000 |
commit | ff793a27b8615f500e59811fa1c43eda909c35e6 (patch) | |
tree | 9ac132a42de19b754321c34ea7ec2eac2edce274 /session.c | |
parent | 94bce40720e91d184ae22272a1537edffb65f945 (diff) |
- (stevesk) session.c: back out to where we were before:
- (djm) Move PAM session initialisation until after fork in sshd. Patch
from Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -481,6 +481,10 @@ do_exec_no_pty(Session *s, const char *command, struct passwd * pw) session_proctitle(s); +#ifdef USE_PAM + do_pam_setcred(); +#endif /* USE_PAM */ + /* Fork the child. */ if ((pid = fork()) == 0) { /* Child. Reinitialize the log since the pid has changed. */ @@ -593,6 +597,11 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw) ptyfd = s->ptyfd; ttyfd = s->ttyfd; +#ifdef USE_PAM + do_pam_session(pw->pw_name, s->tty); + do_pam_setcred(); +#endif /* USE_PAM */ + /* Fork the child. */ if ((pid = fork()) == 0) { /* Child. Reinitialize the log because the pid has changed. */ @@ -1143,11 +1152,6 @@ do_child(const char *command, struct passwd * pw, const char *term, shell = login_getcapstr(lc, "shell", (char *)shell, (char *)shell); #endif -#ifdef USE_PAM - do_pam_session(pw->pw_name, ttyname); - do_pam_setcred(); -#endif /* USE_PAM */ - #ifdef AFS /* Try to get AFS tokens for the local cell. */ if (k_hasafs()) { |