summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-02-27 09:28:23 +1100
committerDamien Miller <djm@mindrot.org>2001-02-27 09:28:23 +1100
commit5a7613186bb74394912b179689190f439bfbba27 (patch)
tree5c0c96bba4f16640f980fdea26b5043b319770ca
parent767c7fc27cac2ecbb2d8248369c0b93d8901f30f (diff)
- (djm) Move PAM init to after fork for non-Solaris derived PAMs
-rw-r--r--ChangeLog3
-rw-r--r--session.c13
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d09f9b70..6f743c781 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
11 <markm@swoon.net> 11 <markm@swoon.net>
12 - (djm) Search for -lcrypt on FreeBSD too 12 - (djm) Search for -lcrypt on FreeBSD too
13 - (djm) fatal() on OpenSSL version mismatch 13 - (djm) fatal() on OpenSSL version mismatch
14 - (djm) Move PAM init to after fork for non-Solaris derived PAMs
14 15
1520010226 1620010226
16 - (bal) Fixed bsd-snprinf.c so it now honors 'BROKEN_SNPRINTF' again. 17 - (bal) Fixed bsd-snprinf.c so it now honors 'BROKEN_SNPRINTF' again.
@@ -4145,4 +4146,4 @@
4145 - Wrote replacements for strlcpy and mkdtemp 4146 - Wrote replacements for strlcpy and mkdtemp
4146 - Released 1.0pre1 4147 - Released 1.0pre1
4147 4148
4148$Id: ChangeLog,v 1.830 2001/02/26 22:20:57 djm Exp $ 4149$Id: ChangeLog,v 1.831 2001/02/26 22:28:23 djm Exp $
diff --git a/session.c b/session.c
index ee14afa68..d4053b4c9 100644
--- a/session.c
+++ b/session.c
@@ -487,7 +487,8 @@ do_exec_no_pty(Session *s, const char *command, struct passwd * pw)
487 487
488 session_proctitle(s); 488 session_proctitle(s);
489 489
490#ifdef USE_PAM 490#if defined(USE_PAM) && defined(PAM_SUN_CODEBASE)
491 /* Solaris-derived PAMs don't like doing this after the fork() */
491 do_pam_setcred(); 492 do_pam_setcred();
492#endif /* USE_PAM */ 493#endif /* USE_PAM */
493 494
@@ -603,10 +604,11 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw)
603 ptyfd = s->ptyfd; 604 ptyfd = s->ptyfd;
604 ttyfd = s->ttyfd; 605 ttyfd = s->ttyfd;
605 606
606#ifdef USE_PAM 607#if defined(USE_PAM) && defined(PAM_SUN_CODEBASE)
608 /* Solaris-derived PAMs don't like doing this after the fork() */
607 do_pam_session(pw->pw_name, s->tty); 609 do_pam_session(pw->pw_name, s->tty);
608 do_pam_setcred(); 610 do_pam_setcred();
609#endif /* USE_PAM */ 611#endif
610 612
611 /* Fork the child. */ 613 /* Fork the child. */
612 if ((pid = fork()) == 0) { 614 if ((pid = fork()) == 0) {
@@ -1032,6 +1034,11 @@ do_child(const char *command, struct passwd * pw, const char *term,
1032#endif /* WITH_IRIX_ARRAY */ 1034#endif /* WITH_IRIX_ARRAY */
1033#endif /* WITH_IRIX_JOBS */ 1035#endif /* WITH_IRIX_JOBS */
1034 1036
1037#if defined(USE_PAM) && !defined(PAM_SUN_CODEBASE)
1038 /* Solaris-derived PAMs don't like doing this after the fork() */
1039 do_pam_session(pw->pw_name, s->tty);
1040 do_pam_setcred();
1041#endif
1035 1042
1036 /* login(1) is only called if we execute the login shell */ 1043 /* login(1) is only called if we execute the login shell */
1037 if (options.use_login && command != NULL) 1044 if (options.use_login && command != NULL)