2 dnl Check how mcserver should check passwords.
3 dnl Possible methods are PAM, pwdauth and crypt.
4 dnl The later works with both /etc/shadow and /etc/passwd.
5 dnl If PAM is found, other methods are not checked.
7 AC_DEFUN([MC_MCSERVER_CHECKS], [
10 dnl mcfs server support
12 AC_ARG_ENABLE([mcserver],
13 [ --enable-mcserver Support mc-specific networking file system server [[no]]],
14 [enable_mcserver="$enableval"]
17 if test x"$enable_mcserver" = "xyes"; then
18 AC_DEFINE(ENABLE_MCSERVER, 1, [Define to enable mc-specific networking file system server])
23 dnl Check if PAM can be used for mcserv
24 AC_CHECK_LIB(dl, dlopen, [LIB_DL="-ldl"])
25 AC_CHECK_LIB(pam, pam_start, [
26 AC_DEFINE(HAVE_PAM, 1,
27 [Define if PAM (Pluggable Authentication Modules) is available])
28 MCSERVLIBS="-lpam $LIB_DL"
29 mcserv_pam=yes], [], [$LIB_DL])
31 dnl Check for crypt() - needed for both /etc/shadow and /etc/passwd.
32 if test x"$mcserv_pam" = x; then
34 dnl Check for pwdauth() - used on SunOS.
35 AC_CHECK_FUNCS([pwdauth])
38 AC_CHECK_HEADERS([crypt.h], [crypt_header=yes])
39 if test -n "$crypt_header"; then
42 AC_SEARCH_LIBS(crypt, [crypt crypt_i], [mcserv_auth=crypt])
45 if test -n "$mcserv_auth"; then
46 AC_DEFINE(HAVE_CRYPT, 1,
47 [Define to use crypt function in mcserv])
49 dnl Check for shadow passwords
50 AC_CHECK_HEADERS([shadow.h shadow/shadow.h],
51 [shadow_header=yes; break])
52 if test -n "$shadow_header"; then
55 AC_SEARCH_LIBS(getspnam, [shadow], [mcserv_auth=shadow])
58 if test -n "$mcserv_auth"; then
59 AC_DEFINE(HAVE_SHADOW, 1,
60 [Define to use shadow passwords for mcserv])
67 AM_CONDITIONAL(ENABLE_MCSERVER, [test x"$enable_mcserver" = "xyes"])