Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 232586 | Differences between
and this patch

Collapse All | Expand All

(-)shadow-4.1.2.1/configure.in (-6 / +35 lines)
Lines 339-351 if test "$with_libpam" != "no"; then Link Here
339
		AC_MSG_ERROR(libpam not found)
339
		AC_MSG_ERROR(libpam not found)
340
	fi
340
	fi
341
341
342
	AC_CHECK_LIB(pam_misc, main,
342
	LIBPAM="-lpam"
343
	             [pam_misc_lib="yes"], [pam_misc_lib="no"])
343
	pam_conv_function="no"
344
	if test "$pam_misc_lib$with_libpam" = "noyes" ; then
344
345
		AC_MSG_ERROR(libpam_misc not found)
345
	AC_CHECK_LIB(pam, openpam_ttyconv,
346
		[pam_conv_function="openpam_ttyconv"],
347
		AC_CHECK_LIB(pam_misc, misc_conv,
348
			[pam_conv_function="misc_conv"; LIBPAM="$LIBPAM -lpam_misc"])
349
		)
350
351
	if test "$pam_conv_function$with_libpam" = "noyes" ; then
352
		AC_MSG_ERROR(PAM conversation function not found)
346
	fi
353
	fi
347
354
348
	if test "$pam_lib$pam_misc_lib" = "yesyes" ; then
355
	pam_headers_found=no
356
	AC_CHECK_HEADERS( [security/openpam.h security/pam_misc.h],
357
			 [ pam_headers_found=yes ; break ], [],
358
			 [ #include <security/pam_appl.h> ] )
359
        if test "$pam_headers_found$with_libpam" = "noyes" ; then
360
	                AC_MSG_ERROR(PAM headers not found)
361
        fi
362
363
364
	if test "$pam_lib$pam_headers_found" = "yesyes" -a "$pam_conv_function" != "no" ; then
349
		with_libpam="yes"
365
		with_libpam="yes"
350
	else
366
	else
351
		with_libpam="no"
367
		with_libpam="no"
Lines 353-361 if test "$with_libpam" != "no"; then Link Here
353
fi
369
fi
354
dnl Now with_libpam is either yes or no
370
dnl Now with_libpam is either yes or no
355
if test "$with_libpam" = "yes"; then
371
if test "$with_libpam" = "yes"; then
372
	AC_CHECK_DECLS([PAM_ESTABLISH_CRED,
373
		PAM_DELETE_CRED,
374
		PAM_NEW_AUTHTOK_REQD,
375
		PAM_DATA_SILENT],
376
		[], [], [#include <security/pam_appl.h>])
377
378
379
	save_libs=$LIBS
380
        LIBS="$LIBS $LIBPAM"
381
	AC_CHECK_FUNCS([pam_fail_delay])
382
	LIBS=$save_libs
383
356
	AC_DEFINE(USE_PAM, 1, [Define to support Pluggable Authentication Modules])
384
	AC_DEFINE(USE_PAM, 1, [Define to support Pluggable Authentication Modules])
385
	AC_DEFINE_UNQUOTED(SHADOW_PAM_CONVERSATION, [$pam_conv_function],[PAM converstation to use])
357
	AM_CONDITIONAL(USE_PAM, [true])
386
	AM_CONDITIONAL(USE_PAM, [true])
358
	LIBPAM="-lpam -lpam_misc"
387
359
	AC_MSG_CHECKING(use login and su access checking if PAM not used)
388
	AC_MSG_CHECKING(use login and su access checking if PAM not used)
360
	AC_MSG_RESULT(no)
389
	AC_MSG_RESULT(no)
361
else
390
else
(-)shadow-4.1.2.1/lib/pam_defs.h (-6 / +13 lines)
Lines 28-51 Link Here
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
29
 */
30
30
31
#include <config.h>
31
#include <security/pam_appl.h>
32
#include <security/pam_appl.h>
32
#include <security/pam_misc.h>
33
#ifdef HAVE_SECURITY_PAM_MISC_H
34
# include <security/pam_misc.h>
35
#endif
36
#ifdef HAVE_SECURITY_OPENPAM_H
37
# include <security/openpam.h>
38
#endif
39
33
40
34
static struct pam_conv conv = {
41
static struct pam_conv conv = {
35
	misc_conv,
42
	SHADOW_PAM_CONVERSATION,
36
	NULL
43
	NULL
37
};
44
};
38
45
39
/* compatibility with different versions of Linux-PAM */
46
/* compatibility with different versions of Linux-PAM */
40
#ifndef PAM_ESTABLISH_CRED
47
#if !HAVE_DECL_PAM_ESTABLISH_CRED
41
#define PAM_ESTABLISH_CRED PAM_CRED_ESTABLISH
48
#define PAM_ESTABLISH_CRED PAM_CRED_ESTABLISH
42
#endif
49
#endif
43
#ifndef PAM_DELETE_CRED
50
#if !HAVE_DECL_PAM_DELETE_CRED
44
#define PAM_DELETE_CRED PAM_CRED_DELETE
51
#define PAM_DELETE_CRED PAM_CRED_DELETE
45
#endif
52
#endif
46
#ifndef PAM_NEW_AUTHTOK_REQD
53
#if !HAVE_DECL_PAM_NEW_AUTHTOK_REQD
47
#define PAM_NEW_AUTHTOK_REQD PAM_AUTHTOKEN_REQD
54
#define PAM_NEW_AUTHTOK_REQD PAM_AUTHTOKEN_REQD
48
#endif
55
#endif
49
#ifndef PAM_DATA_SILENT
56
#if !HAVE_DECL_PAM_DATA_SILENT
50
#define PAM_DATA_SILENT 0
57
#define PAM_DATA_SILENT 0
51
#endif
58
#endif
(-)shadow-4.1.2.1/src/login.c (-1 / +2 lines)
Lines 644-652 int main (int argc, char **argv) Link Here
644
			  failed = 0;
644
			  failed = 0;
645
645
646
			  failcount++;
646
			  failcount++;
647
#ifdef HAVE_PAM_FAIL_DELAY
647
			  if (delay > 0)
648
			  if (delay > 0)
648
			    retcode = pam_fail_delay(pamh, 1000000*delay);
649
			    retcode = pam_fail_delay(pamh, 1000000*delay);
649
650
#endif
650
			  retcode = pam_authenticate (pamh, 0);
651
			  retcode = pam_authenticate (pamh, 0);
651
652
652
			  pam_get_item (pamh, PAM_USER,
653
			  pam_get_item (pamh, PAM_USER,

Return to bug 232586