]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
5ec1fd3d | 2 | dnl "$Id$" |
ef416fc2 | 3 | dnl |
321d8d57 | 4 | dnl PAM stuff for CUPS. |
ef416fc2 | 5 | dnl |
5a1d7a17 MS |
6 | dnl Copyright 2007-2013 by Apple Inc. |
7 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. | |
ef416fc2 | 8 | dnl |
5a1d7a17 MS |
9 | dnl These coded instructions, statements, and computer programs are the |
10 | dnl property of Apple Inc. and are protected by Federal copyright | |
11 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | dnl which should have been included with this file. If this file is | |
13 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | dnl |
15 | ||
bf3816c7 MS |
16 | AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support]) |
17 | AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use]) | |
ef416fc2 | 18 | |
ef416fc2 | 19 | PAMDIR="" |
18ecb428 | 20 | PAMFILE="pam.std" |
ef416fc2 | 21 | PAMLIBS="" |
22 | PAMMOD="pam_unknown.so" | |
18ecb428 | 23 | PAMMODAUTH="pam_unknown.so" |
ef416fc2 | 24 | |
25 | if test x$enable_pam != xno; then | |
26 | SAVELIBS="$LIBS" | |
27 | ||
28 | AC_CHECK_LIB(dl,dlopen) | |
29 | AC_CHECK_LIB(pam,pam_start) | |
a4924f6c | 30 | AC_CHECK_LIB(pam,pam_set_item,AC_DEFINE(HAVE_PAM_SET_ITEM)) |
ee571f26 | 31 | AC_CHECK_LIB(pam,pam_setcred,AC_DEFINE(HAVE_PAM_SETCRED)) |
ef416fc2 | 32 | AC_CHECK_HEADER(security/pam_appl.h) |
33 | if test x$ac_cv_header_security_pam_appl_h != xyes; then | |
34 | AC_CHECK_HEADER(pam/pam_appl.h, | |
35 | AC_DEFINE(HAVE_PAM_PAM_APPL_H)) | |
36 | fi | |
37 | ||
38 | if test x$ac_cv_lib_pam_pam_start != xno; then | |
39 | # Set the necessary libraries for PAM... | |
40 | if test x$ac_cv_lib_dl_dlopen != xno; then | |
41 | PAMLIBS="-lpam -ldl" | |
42 | else | |
43 | PAMLIBS="-lpam" | |
44 | fi | |
45 | ||
46 | # Find the PAM configuration directory, if any... | |
47 | for dir in /private/etc/pam.d /etc/pam.d; do | |
48 | if test -d $dir; then | |
49 | PAMDIR=$dir | |
50 | break; | |
51 | fi | |
52 | done | |
53 | fi | |
54 | ||
55 | LIBS="$SAVELIBS" | |
56 | ||
57 | case "$uname" in | |
58 | Darwin*) | |
f3c17241 | 59 | # Darwin/OS X |
b19ccc9e MS |
60 | if test "x$with_pam_module" != x; then |
61 | PAMFILE="pam.$with_pam_module" | |
d1c13e16 | 62 | elif test -f /usr/lib/pam/pam_opendirectory.so.2; then |
b19ccc9e MS |
63 | PAMFILE="pam.opendirectory" |
64 | else | |
65 | PAMFILE="pam.securityserver" | |
66 | fi | |
ef416fc2 | 67 | ;; |
b19ccc9e | 68 | |
ef416fc2 | 69 | *) |
70 | # All others; this test might need to be updated | |
71 | # as Linux distributors move things around... | |
b19ccc9e MS |
72 | if test "x$with_pam_module" != x; then |
73 | PAMMOD="pam_${with_pam_module}.so" | |
18ecb428 MS |
74 | elif test -f /lib/security/pam_unix2.so; then |
75 | PAMMOD="pam_unix2.so" | |
76 | elif test -f /lib/security/pam_unix.so; then | |
77 | PAMMOD="pam_unix.so" | |
b19ccc9e | 78 | fi |
ef416fc2 | 79 | |
18ecb428 MS |
80 | if test "x$PAMMOD" = xpam_unix.so; then |
81 | PAMMODAUTH="$PAMMOD shadow nodelay" | |
82 | else | |
83 | PAMMODAUTH="$PAMMOD nodelay" | |
84 | fi | |
ef416fc2 | 85 | ;; |
86 | esac | |
87 | fi | |
88 | ||
89 | AC_SUBST(PAMDIR) | |
90 | AC_SUBST(PAMFILE) | |
91 | AC_SUBST(PAMLIBS) | |
92 | AC_SUBST(PAMMOD) | |
18ecb428 | 93 | AC_SUBST(PAMMODAUTH) |
ef416fc2 | 94 | |
95 | dnl | |
5ec1fd3d | 96 | dnl End of "$Id$". |
ef416fc2 | 97 | dnl |