2 dnl PAM stuff for CUPS.
4 dnl Copyright 2007-2013 by Apple Inc.
5 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7 dnl These coded instructions, statements, and computer programs are the
8 dnl property of Apple Inc. and are protected by Federal copyright
9 dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 dnl which should have been included with this file. If this file is
11 dnl file is missing or damaged, see the license at "http://www.cups.org/".
14 AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
15 AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use])
20 PAMMOD="pam_unknown.so"
21 PAMMODAUTH="pam_unknown.so"
23 if test x$enable_pam != xno; then
26 AC_CHECK_LIB(dl,dlopen)
27 AC_CHECK_LIB(pam,pam_start)
28 AC_CHECK_LIB(pam,pam_set_item,AC_DEFINE(HAVE_PAM_SET_ITEM))
29 AC_CHECK_LIB(pam,pam_setcred,AC_DEFINE(HAVE_PAM_SETCRED))
30 AC_CHECK_HEADER(security/pam_appl.h)
31 if test x$ac_cv_header_security_pam_appl_h != xyes; then
32 AC_CHECK_HEADER(pam/pam_appl.h,
33 AC_DEFINE(HAVE_PAM_PAM_APPL_H))
36 if test x$ac_cv_lib_pam_pam_start != xno; then
37 # Set the necessary libraries for PAM...
38 if test x$ac_cv_lib_dl_dlopen != xno; then
44 # Find the PAM configuration directory, if any...
45 for dir in /private/etc/pam.d /etc/pam.d; do
58 if test "x$with_pam_module" != x; then
59 PAMFILE="pam.$with_pam_module"
60 elif test -f /usr/lib/pam/pam_opendirectory.so.2; then
61 PAMFILE="pam.opendirectory"
63 PAMFILE="pam.securityserver"
68 # All others; this test might need to be updated
69 # as Linux distributors move things around...
70 if test "x$with_pam_module" != x; then
71 PAMMOD="pam_${with_pam_module}.so"
72 elif test -f /lib/security/pam_unix2.so; then
74 elif test -f /lib/security/pam_unix.so; then
78 if test "x$PAMMOD" = xpam_unix.so; then
79 PAMMODAUTH="$PAMMOD shadow nodelay"
81 PAMMODAUTH="$PAMMOD nodelay"