--- sudo-1.6.8p12/configure.in.login 2006-07-16 15:25:33.000000000 +0200 +++ sudo-1.6.8p12/configure.in 2006-07-16 15:49:08.000000000 +0200 @@ -357,6 +357,17 @@ ;; esac]) +AC_ARG_WITH(pam-login, [ --with-pam-login enable specific PAM session for sudo -i], +[case $with_pam_login in + yes) AC_DEFINE(HAVE_PAM_LOGIN) + AC_MSG_CHECKING(whether to use PAM login) + AC_MSG_RESULT(yes) + ;; + no) ;; + *) AC_MSG_ERROR(["--with-pam-login does not take an argument."]) + ;; +esac]) + AC_ARG_WITH(AFS, [ --with-AFS enable AFS support], [case $with_AFS in yes) AC_DEFINE(HAVE_AFS) --- sudo-1.6.9p3/sudo.c.orig 2007-08-04 22:30:23.307231082 +0200 +++ sudo-1.6.9p3/sudo.c 2007-08-04 22:31:28.238931329 +0200 @@ -164,6 +164,7 @@ char *login_style; #endif /* HAVE_BSD_AUTH_H */ sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp, saved_sa_chld; +int sudo_mode; #ifdef WITH_SELINUX security_context_t setup_tty_context(int fd, char *ttyn, security_context_t new_context) { @@ -319,7 +320,6 @@ int validated; int fd; int cmnd_status; - int sudo_mode; int pwflag; sigaction_t sa; extern int printmatches; --- sudo-1.6.8p12/auth/pam.c.login 2006-07-16 15:41:59.000000000 +0200 +++ sudo-1.6.8p12/auth/pam.c 2006-07-16 15:45:15.000000000 +0200 @@ -89,7 +89,12 @@ if (auth != NULL) auth->data = (VOID *) &pam_status; pam_conv.conv = sudo_conv; - pam_status = pam_start("sudo", pw->pw_name, &pam_conv, &pamh); +#ifdef HAVE_PAM_LOGIN + if (ISSET(sudo_mode, MODE_LOGIN_SHELL)) + pam_status = pam_start("sudo-i", pw->pw_name, &pam_conv, &pamh); + else +#endif + pam_status = pam_start("sudo", pw->pw_name, &pam_conv, &pamh); if (pam_status != PAM_SUCCESS) { log_error(USE_ERRNO|NO_EXIT|NO_MAIL, "unable to initialize PAM"); return(AUTH_FATAL); --- sudo-1.6.9p3/sudo.h.orig 2007-07-06 16:14:34.000000000 +0200 +++ sudo-1.6.9p3/sudo.h 2007-08-04 22:32:18.353787210 +0200 @@ -268,6 +268,7 @@ extern FILE *sudoers_fp; extern int tgetpass_flags; extern uid_t timestamp_uid; +extern int sudo_mode; #endif #ifndef errno extern int errno; --- sudo-1.6.8p12/config.h.in.login 2006-07-16 15:32:09.000000000 +0200 +++ sudo-1.6.8p12/config.h.in 2006-07-16 15:32:56.000000000 +0200 @@ -230,6 +230,9 @@ /* Define to 1 if you use PAM authentication. */ #undef HAVE_PAM +/* Define to 1 if you use specific PAM session for sodo -i. */ +#undef HAVE_PAM_LOGIN + /* Define to 1 if you have the header file. */ #undef HAVE_PAM_PAM_APPL_H