2 dnl PAM stuff for CUPS.
4 dnl Copyright 2007-2017 by Apple Inc.
5 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7 dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
10 AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
11 AC_ARG_WITH(pam_module, [ --with-pam-module set the PAM module to use])
16 PAMMOD="pam_unknown.so"
17 PAMMODAUTH="pam_unknown.so"
19 if test x$enable_pam != xno; then
22 AC_CHECK_LIB(dl,dlopen)
23 AC_CHECK_LIB(pam,pam_start)
24 AC_CHECK_LIB(pam,pam_set_item,AC_DEFINE(HAVE_PAM_SET_ITEM))
25 AC_CHECK_LIB(pam,pam_setcred,AC_DEFINE(HAVE_PAM_SETCRED))
26 AC_CHECK_HEADER(security/pam_appl.h)
27 if test x$ac_cv_header_security_pam_appl_h != xyes; then
28 AC_CHECK_HEADER(pam/pam_appl.h,
29 AC_DEFINE(HAVE_PAM_PAM_APPL_H))
32 if test x$ac_cv_lib_pam_pam_start != xno; then
33 # Set the necessary libraries for PAM...
34 if test x$ac_cv_lib_dl_dlopen != xno; then
40 # Find the PAM configuration directory, if any...
41 for dir in /private/etc/pam.d /etc/pam.d; do
51 case "$host_os_name" in
54 if test "x$with_pam_module" != x; then
55 PAMFILE="pam.$with_pam_module"
56 elif test -f /usr/lib/pam/pam_opendirectory.so.2; then
57 PAMFILE="pam.opendirectory"
59 PAMFILE="pam.securityserver"
64 # All others; this test might need to be updated
65 # as Linux distributors move things around...
66 if test "x$with_pam_module" != x; then
67 PAMMOD="pam_${with_pam_module}.so"
68 elif test -f /etc/pam.d/common-auth; then
72 for dir in /lib/security /lib64/security /lib/x86_64-linux-gnu/security /var/lib/pam; do
79 if test -f $moddir/pam_unix2.so; then
81 elif test -f $moddir/pam_unix.so; then
86 if test "x$PAMMOD" = xpam_unix.so; then
87 PAMMODAUTH="$PAMMOD shadow nodelay"
89 PAMMODAUTH="$PAMMOD nodelay"