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], [
12 AC_ARG_ENABLE([mcserver],
13 [ --enable-mcserver Support mc-specific networking file system server [[no]]],
14 [if test "x$enableval" != "xno"; then
15 AC_DEFINE(ENABLE_MCSERVER, 1, [Define to enable mc-specific networking file system server])
16 AC_MC_VFS_ADDNAME([mcfs])
21 if test x"$enable_mcserver" = "xyes"; then
24 dnl Check if PAM can be used for mcserv
25 AC_CHECK_LIB(dl, dlopen, [LIB_DL="-ldl"])
26 AC_CHECK_LIB(pam, pam_start, [
27 AC_DEFINE(HAVE_PAM, 1,
28 [Define if PAM (Pluggable Authentication Modules) is available])
29 MCSERVLIBS="-lpam $LIB_DL"
30 mcserv_pam=yes], [], [$LIB_DL])
32 dnl Check for crypt() - needed for both /etc/shadow and /etc/passwd.
33 if test x"$mcserv_pam" = x; then
35 dnl Check for pwdauth() - used on SunOS.
36 AC_CHECK_FUNCS([pwdauth])
39 AC_CHECK_HEADERS([crypt.h], [crypt_header=yes])
40 if test -n "$crypt_header"; then
43 AC_SEARCH_LIBS(crypt, [crypt crypt_i], [mcserv_auth=crypt])
46 if test -n "$mcserv_auth"; then
47 AC_DEFINE(HAVE_CRYPT, 1,
48 [Define to use crypt function in mcserv])
50 dnl Check for shadow passwords
51 AC_CHECK_HEADERS([shadow.h shadow/shadow.h],
52 [shadow_header=yes; break])
53 if test -n "$shadow_header"; then
56 AC_SEARCH_LIBS(getspnam, [shadow], [mcserv_auth=shadow])
59 if test -n "$mcserv_auth"; then
60 AC_DEFINE(HAVE_SHADOW, 1,
61 [Define to use shadow passwords for mcserv])