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) | |||
481 | 481 | ||
482 | session_proctitle(s); | 482 | session_proctitle(s); |
483 | 483 | ||
484 | #ifdef USE_PAM | ||
485 | do_pam_setcred(); | ||
486 | #endif /* USE_PAM */ | ||
487 | |||
484 | /* Fork the child. */ | 488 | /* Fork the child. */ |
485 | if ((pid = fork()) == 0) { | 489 | if ((pid = fork()) == 0) { |
486 | /* Child. Reinitialize the log since the pid has changed. */ | 490 | /* Child. Reinitialize the log since the pid has changed. */ |
@@ -593,6 +597,11 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw) | |||
593 | ptyfd = s->ptyfd; | 597 | ptyfd = s->ptyfd; |
594 | ttyfd = s->ttyfd; | 598 | ttyfd = s->ttyfd; |
595 | 599 | ||
600 | #ifdef USE_PAM | ||
601 | do_pam_session(pw->pw_name, s->tty); | ||
602 | do_pam_setcred(); | ||
603 | #endif /* USE_PAM */ | ||
604 | |||
596 | /* Fork the child. */ | 605 | /* Fork the child. */ |
597 | if ((pid = fork()) == 0) { | 606 | if ((pid = fork()) == 0) { |
598 | /* Child. Reinitialize the log because the pid has changed. */ | 607 | /* Child. Reinitialize the log because the pid has changed. */ |
@@ -1143,11 +1152,6 @@ do_child(const char *command, struct passwd * pw, const char *term, | |||
1143 | shell = login_getcapstr(lc, "shell", (char *)shell, (char *)shell); | 1152 | shell = login_getcapstr(lc, "shell", (char *)shell, (char *)shell); |
1144 | #endif | 1153 | #endif |
1145 | 1154 | ||
1146 | #ifdef USE_PAM | ||
1147 | do_pam_session(pw->pw_name, ttyname); | ||
1148 | do_pam_setcred(); | ||
1149 | #endif /* USE_PAM */ | ||
1150 | |||
1151 | #ifdef AFS | 1155 | #ifdef AFS |
1152 | /* Try to get AFS tokens for the local cell. */ | 1156 | /* Try to get AFS tokens for the local cell. */ |
1153 | if (k_hasafs()) { | 1157 | if (k_hasafs()) { |