diff -uprk.orig SimplePAMApps-0.60.orig/configure.in SimplePAMApps-0.60/configure.in --- SimplePAMApps-0.60.orig/configure.in 1998-12-07 14:26:55 +0300 +++ SimplePAMApps-0.60/configure.in 2003-06-18 18:42:10 +0400 @@ -17,12 +17,13 @@ AC_ARG_WITH(pniam, [ TAGDIR=pamapps ]) ]) if test "${TAGDIR}" = "pamapps"; then - LIBS="${LIBS} -lpam -lpam_misc -ldl" + AC_CHECK_LIB(pam, pam_start) + AC_CHECK_LIB(pam_misc, misc_conv) AC_ARG_WITH(pwdb, [ --with-pwdb use PWDB library --without-pwdb use getpwXXX() calls ], [ case "${withval}" in - y*) AC_DEFINE(HAVE_PWDB) + y*) AC_DEFINE(HAVE_PWDB, 1, [Whether PWDB support is enabled]) LIBS="${LIBS} -lpwdb";; esac ]) else diff -uprk.orig SimplePAMApps-0.60.orig/pamapps/login/login.c SimplePAMApps-0.60/pamapps/login/login.c --- SimplePAMApps-0.60.orig/pamapps/login/login.c 2003-06-18 18:36:15 +0400 +++ SimplePAMApps-0.60/pamapps/login/login.c 2003-06-18 18:45:36 +0400 @@ -147,6 +147,9 @@ static void log(const char *format, ...) static void set_timeout(int set) { +#ifdef _OPENPAM + openpam_ttyconv_timeout = set ? LOGIN_ABORT_TIMEOUT : 0; +#else if (set) { time_t now; @@ -159,6 +162,7 @@ static void set_timeout(int set) pam_misc_conv_warn_time = 0; /* cancel timeout */ pam_misc_conv_die_time = 0; } +#endif } /* @@ -227,11 +231,16 @@ static int login_authenticate_user(void) } } + if (retval == PAM_CONV_ERR) + return retval; + +#ifndef _OPENPAM /* did the conversation time out? */ if (pam_misc_conv_died) { D(("conversation timed out")); return PAM_PERM_DENIED; } +#endif /* what should we do about the failure? */ (void) fprintf(stderr, LOGIN_ATTEMPT_FAILED); diff -uprk.orig SimplePAMApps-0.60.orig/pamapps/su/su.c SimplePAMApps-0.60/pamapps/su/su.c --- SimplePAMApps-0.60.orig/pamapps/su/su.c 2003-06-18 18:36:15 +0400 +++ SimplePAMApps-0.60/pamapps/su/su.c 2003-06-18 18:36:27 +0400 @@ -232,8 +232,7 @@ int main(int argc, char *argv[]) /* job control is off for login sessions */ prepare_for_job_control(!ctx.login && ctx.command); status = wait_for_child(child); - if (status != 0) - D(("shell returned %d", status)); + D(("shell returned %d", status)); }while (0); /* abuse loop to avoid using goto... */ @@ -360,6 +361,10 @@ static void do_pam_init(const char *user { int retval; +#if defined(_OPENPAM) && defined(DEBUG) + extern int _openpam_debug; + _openpam_debug = 1; +#endif retval = pam_start("su", user, &conv, &pamh); if (retval != PAM_SUCCESS) { /* @@ -367,7 +372,7 @@ static void do_pam_init(const char *user * pamh isn't a valid handler. Without a handler * we couldn't call pam_strerror :-( 1998/03/29 (SAW) */ - (void) fprintf(stderr, "su: pam_start failed with code %d\n", retval); + (void) fprintf(stderr, "su: pam_start failed: %s\n", pam_strerror(NULL,retval)); exit(1); } diff -uprk.orig SimplePAMApps-0.60.orig/Rules.make.in SimplePAMApps-0.60/Rules.make.in --- SimplePAMApps-0.60.orig/Rules.make.in 1999-11-10 16:04:40 +0300 +++ SimplePAMApps-0.60/Rules.make.in 2003-06-18 18:36:27 +0400 @@ -1,5 +1,5 @@ CC = @CC@ -WARNINGS = -D_GNU_SOURCE -Wall -W +WARNINGS = -D_GNU_SOURCE -Wall -W -Werror CFLAGS = CFLAGS += $(WARNINGS) CFLAGS += @CFLAGS@