View | Details | Raw Unified | Return to bug 6385
Collapse All | Expand All

(-)openssh-3.6.1p2.orig/auth-pam.c (-6 / +9 lines)
Lines 319-331 void do_pam_session(char *username, cons Link Here
319
			    pam_retval, PAM_STRERROR(__pamh, pam_retval));
319
			    pam_retval, PAM_STRERROR(__pamh, pam_retval));
320
	}
320
	}
321
321
322
	pam_retval = pam_open_session(__pamh, 0);
322
 	if(username != NULL)
323
	log_reinit();
323
 	{
324
	if (pam_retval != PAM_SUCCESS)
324
		pam_retval = pam_open_session(__pamh, 0);
325
		fatal("PAM session setup failed[%d]: %.200s",
325
		log_reinit();
326
		    pam_retval, PAM_STRERROR(__pamh, pam_retval));
326
		if (pam_retval != PAM_SUCCESS)
327
			fatal("PAM session setup failed[%d]: %.200s",
328
					pam_retval, PAM_STRERROR(__pamh, pam_retval));
327
329
328
	session_opened = getpid();
330
		session_opened = getpid();
331
 	}
329
}
332
}
330
333
331
/* Set PAM credentials */
334
/* Set PAM credentials */
(-)openssh-3.6.1p2.orig/session.c (-2 / +4 lines)
Lines 456-462 do_exec_no_pty(Session *s, const char *c Link Here
456
	session_proctitle(s);
456
	session_proctitle(s);
457
457
458
#if defined(USE_PAM)
458
#if defined(USE_PAM)
459
	do_pam_session(s->pw->pw_name, NULL);
459
	do_pam_session(NULL, NULL);
460
	do_pam_setcred(1);
460
	do_pam_setcred(1);
461
	if (is_pam_password_change_required())
461
	if (is_pam_password_change_required())
462
		packet_disconnect("Password change required but no "
462
		packet_disconnect("Password change required but no "
Lines 583-589 do_exec_pty(Session *s, const char *comm Link Here
583
	ttyfd = s->ttyfd;
583
	ttyfd = s->ttyfd;
584
584
585
#if defined(USE_PAM)
585
#if defined(USE_PAM)
586
	do_pam_session(s->pw->pw_name, s->tty);
586
	do_pam_session(NULL, s->tty);
587
	do_pam_setcred(1);
587
	do_pam_setcred(1);
588
#endif
588
#endif
589
589
Lines 1250-1255 do_setusercontext(struct passwd *pw) Link Here
1250
		 * These will have been wiped by the above initgroups() call.
1250
		 * These will have been wiped by the above initgroups() call.
1251
		 * Reestablish them here.
1251
		 * Reestablish them here.
1252
		 */
1252
		 */
1253
		/* We should get working pam_mkhomedir */
1254
		do_pam_session(s->pw->pw_name, NULL);
1253
		do_pam_setcred(0);
1255
		do_pam_setcred(0);
1254
# endif /* USE_PAM */
1256
# endif /* USE_PAM */
1255
# if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
1257
# if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)

Return to bug 6385