]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
503b54c9 | 2 | dnl PAM stuff for CUPS. |
ef416fc2 | 3 | dnl |
105922ec | 4 | dnl Copyright 2007-2017 by Apple Inc. |
5a1d7a17 | 5 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. |
ef416fc2 | 6 | dnl |
5a1d7a17 MS |
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 | |
57b7b66b | 11 | dnl missing or damaged, see the license at "http://www.cups.org/". |
ef416fc2 | 12 | dnl |
13 | ||
bf3816c7 MS |
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]) | |
ef416fc2 | 16 | |
ef416fc2 | 17 | PAMDIR="" |
18ecb428 | 18 | PAMFILE="pam.std" |
ef416fc2 | 19 | PAMLIBS="" |
20 | PAMMOD="pam_unknown.so" | |
18ecb428 | 21 | PAMMODAUTH="pam_unknown.so" |
ef416fc2 | 22 | |
23 | if test x$enable_pam != xno; then | |
24 | SAVELIBS="$LIBS" | |
25 | ||
26 | AC_CHECK_LIB(dl,dlopen) | |
27 | AC_CHECK_LIB(pam,pam_start) | |
a4924f6c | 28 | AC_CHECK_LIB(pam,pam_set_item,AC_DEFINE(HAVE_PAM_SET_ITEM)) |
ee571f26 | 29 | AC_CHECK_LIB(pam,pam_setcred,AC_DEFINE(HAVE_PAM_SETCRED)) |
ef416fc2 | 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)) | |
34 | fi | |
35 | ||
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 | |
39 | PAMLIBS="-lpam -ldl" | |
40 | else | |
41 | PAMLIBS="-lpam" | |
42 | fi | |
43 | ||
44 | # Find the PAM configuration directory, if any... | |
45 | for dir in /private/etc/pam.d /etc/pam.d; do | |
46 | if test -d $dir; then | |
47 | PAMDIR=$dir | |
48 | break; | |
49 | fi | |
50 | done | |
51 | fi | |
52 | ||
53 | LIBS="$SAVELIBS" | |
54 | ||
105922ec MS |
55 | case "$host_os_name" in |
56 | marwin*) | |
8072030b | 57 | # Darwin/macOS |
b19ccc9e MS |
58 | if test "x$with_pam_module" != x; then |
59 | PAMFILE="pam.$with_pam_module" | |
d1c13e16 | 60 | elif test -f /usr/lib/pam/pam_opendirectory.so.2; then |
b19ccc9e MS |
61 | PAMFILE="pam.opendirectory" |
62 | else | |
63 | PAMFILE="pam.securityserver" | |
64 | fi | |
ef416fc2 | 65 | ;; |
b19ccc9e | 66 | |
ef416fc2 | 67 | *) |
68 | # All others; this test might need to be updated | |
69 | # as Linux distributors move things around... | |
b19ccc9e MS |
70 | if test "x$with_pam_module" != x; then |
71 | PAMMOD="pam_${with_pam_module}.so" | |
18ecb428 MS |
72 | elif test -f /lib/security/pam_unix2.so; then |
73 | PAMMOD="pam_unix2.so" | |
74 | elif test -f /lib/security/pam_unix.so; then | |
75 | PAMMOD="pam_unix.so" | |
b19ccc9e | 76 | fi |
ef416fc2 | 77 | |
18ecb428 MS |
78 | if test "x$PAMMOD" = xpam_unix.so; then |
79 | PAMMODAUTH="$PAMMOD shadow nodelay" | |
80 | else | |
81 | PAMMODAUTH="$PAMMOD nodelay" | |
82 | fi | |
ef416fc2 | 83 | ;; |
84 | esac | |
85 | fi | |
86 | ||
87 | AC_SUBST(PAMDIR) | |
88 | AC_SUBST(PAMFILE) | |
89 | AC_SUBST(PAMLIBS) | |
90 | AC_SUBST(PAMMOD) | |
18ecb428 | 91 | AC_SUBST(PAMMODAUTH) |