--- 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 @@ -394,6 +394,18 @@ ;; esac]) +AC_ARG_WITH(pam-login, [AS_HELP_STRING([--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, [AS_HELP_STRING([--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 @@ -157,6 +157,7 @@ static char *runas_user; static char *runas_group; static struct sudo_nss_list *snl; +int sudo_mode; /* For getopt(3) */ extern char *optarg; @@ -169,7 +170,7 @@ char **envp; { int sources = 0, validated; - int fd, cmnd_status, sudo_mode, pwflag, rc = 0; + int fd, cmnd_status, pwflag, rc = 0; sigaction_t sa; struct sudo_nss *nss; #if defined(SUDO_DEVEL) && defined(__OpenBSD__) --- 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