]> arthur.barton.de Git - netatalk.git/blobdiff - macros/pam-check.m4
AFP statistics via dbus IPC
[netatalk.git] / macros / pam-check.m4
index f900cd45bacd1eeaac321f99a3b2463eb4be1bd3..26d14b850482e09331cc1ec46227d32a3e8128f9 100644 (file)
@@ -1,7 +1,7 @@
-dnl $Id: pam-check.m4,v 1.4 2009-11-23 18:29:50 franklahm Exp $
 dnl PAM finding macro
 
-AC_DEFUN([AC_PATH_PAM], [
+AC_DEFUN([AC_NETATALK_PATH_PAM], [
+    netatalk_cv_use_pam=no
        AC_ARG_WITH(pam, [  --with-pam[[=PATH]]       specify path to PAM installation [[auto]]],
                [
                        require_pam="yes"
@@ -90,6 +90,21 @@ AC_DEFUN([AC_PATH_PAM], [
            PAM_ACCOUNT=system-auth
            PAM_PASSWORD=system-auth
            PAM_SESSION=system-auth
+        dnl FreeBSD
+        elif test -f "$pampath/system" ; then
+           PAM_DIRECTIVE=include
+           PAM_AUTH=system
+           PAM_ACCOUNT=system
+           PAM_PASSWORD=system
+           PAM_SESSION=system
+        dnl Solaris 11+
+        elif test -f "$pampath/other" ; then
+           PAM_DIRECTIVE=include
+           PAM_AUTH=${PAMDIR}etc/pam.d/other
+           PAM_ACCOUNT=${PAMDIR}etc/pam.d/other
+           PAM_PASSWORD=${PAMDIR}etc/pam.d/other
+           PAM_SESSION=${PAMDIR}etc/pam.d/other
+        dnl Fallback
         else
            PAM_DIRECTIVE=required
            PAM_AUTH=pam_unix.so
@@ -107,6 +122,7 @@ AC_DEFUN([AC_PATH_PAM], [
 
        AC_MSG_CHECKING([whether to enable PAM support])
        if test "x$pam_found" = "xno"; then
+               netatalk_cv_install_pam=no
                if test "x$require_pam" = "xyes"; then
                        AC_MSG_ERROR([PAM support missing])
                else
@@ -116,10 +132,21 @@ AC_DEFUN([AC_PATH_PAM], [
        else
                AC_MSG_RESULT([yes])
                ifelse([$1], , :, [$1])
+        use_pam_so=yes
+           compile_pam=yes
+           netatalk_cv_use_pam=yes
+           AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
        fi
 
-        LIB_REMOVE_USR_LIB(PAM_LIBS)
-        CFLAGS_REMOVE_USR_INCLUDE(PAM_CFLAGS)
+    AC_ARG_WITH(
+        pam-confdir,
+        [AS_HELP_STRING([--with-pam-confdir=PATH],[Path to PAM config dir (default: $sysconfdir/pam.d)])],
+        PAMDIR=$withval,
+        PAMDIR='${sysconfdir}/pam.d'
+    )
+
+    LIB_REMOVE_USR_LIB(PAM_LIBS)
+    CFLAGS_REMOVE_USR_INCLUDE(PAM_CFLAGS)
        AC_SUBST(PAMDIR)
        AC_SUBST(PAM_CFLAGS)
        AC_SUBST(PAM_LIBS)