mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
* configure.in: Move check for pwdauth() to MC_MCSERVER_CHECKS.
* acinclude.m4 (MC_MCSERVER_CHECKS): If using crypt(), check for shadow password support.
This commit is contained in:
parent
7ba4aacd85
commit
9e20efe375
@ -1,5 +1,9 @@
|
||||
2002-11-16 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* configure.in: Move check for pwdauth() to MC_MCSERVER_CHECKS.
|
||||
* acinclude.m4 (MC_MCSERVER_CHECKS): If using crypt(), check for
|
||||
shadow password support.
|
||||
|
||||
* acinclude.m4 (MC_MCSERVER_CHECKS): Don't limit PAM check to
|
||||
Linux. Use AC_SEARCH_LIBS to find crypt(). Consolidate mcserv
|
||||
libraries into MCSERVLIBS.
|
||||
|
32
acinclude.m4
32
acinclude.m4
@ -37,22 +37,27 @@ AC_DEFUN([MC_UNDELFS_CHECKS], [
|
||||
|
||||
dnl MC_MCSERVER_CHECKS
|
||||
dnl Check how mcserver should check passwords.
|
||||
dnl Possible methods are PAM and libcrypt.
|
||||
dnl Possible methods are PAM, pwdauth and crypt.
|
||||
dnl The later works with both /etc/shadow and /etc/passwd.
|
||||
dnl If PAM is found, other methods are not checked.
|
||||
|
||||
AC_DEFUN([MC_MCSERVER_CHECKS], [
|
||||
|
||||
mcserv_auth=
|
||||
|
||||
dnl Check if PAM can be used for mcserv
|
||||
AC_CHECK_LIB(dl, dlopen, [LIB_DL="-ldl"])
|
||||
AC_CHECK_LIB(pam, pam_start, [
|
||||
AC_DEFINE(HAVE_PAM, 1,
|
||||
[Define if PAM (Pluggable Authentication Modules) is available])
|
||||
MCSERVLIBS="-lpam $LIB_DL"
|
||||
mcserv_auth=pam], [], [$LIB_DL])
|
||||
mcserv_pam=yes], [], [$LIB_DL])
|
||||
|
||||
dnl Fallback to libcrypt (uses passwords from /etc/passwd)
|
||||
if test -z "$mcserv_auth"; then
|
||||
dnl Check for crypt() - needed for both /etc/shadow and /etc/passwd.
|
||||
if test -z "$mcserv_pam"; then
|
||||
|
||||
dnl Check for pwdauth() - used on SunOS.
|
||||
AC_CHECK_FUNCS([pwdauth])
|
||||
|
||||
dnl Check for crypt()
|
||||
AC_CHECK_HEADERS([crypt.h], [crypt_header=yes])
|
||||
if test -n "$crypt_header"; then
|
||||
save_LIBS="$LIBS"
|
||||
@ -63,6 +68,21 @@ AC_DEFUN([MC_MCSERVER_CHECKS], [
|
||||
if test -n "$mcserv_auth"; then
|
||||
AC_DEFINE(HAVE_CRYPT, 1,
|
||||
[Define to use crypt function in mcserv])
|
||||
|
||||
dnl Check for shadow passwords
|
||||
AC_CHECK_HEADERS([shadow.h shadow/shadow.h],
|
||||
[shadow_header=yes; break])
|
||||
if test -n "$shadow_header"; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$MCSERVLIBS"
|
||||
AC_SEARCH_LIBS(getspnam, [shadow], [mcserv_auth=shadow])
|
||||
MCSERVLIBS="$LIBS"
|
||||
LIBS="$save_LIBS"
|
||||
if test -n "$mcserv_auth"; then
|
||||
AC_DEFINE(HAVE_SHADOW, 1,
|
||||
[Define to use shadow passwords for mcserv])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -132,7 +132,7 @@ dnl Check availability of some functions
|
||||
dnl
|
||||
|
||||
AC_CHECK_FUNCS([strerror statfs strftime \
|
||||
memmove pwdauth truncate initgroups putenv \
|
||||
memmove truncate initgroups putenv \
|
||||
memset memcpy tcsetattr tcgetattr cfgetospeed \
|
||||
sigaction sigemptyset sigprocmask sigaddset \
|
||||
sysconf setuid setreuid telldir seekdir])
|
||||
|
Loading…
Reference in New Issue
Block a user