* configure.in, lib/nscd.h, lib/nscd.c: Added --with-nscd flag to

support systems without nscd.
This commit is contained in:
nekral-guest 2008-08-30 18:30:36 +00:00
parent b4899946ef
commit c59126a817
4 changed files with 21 additions and 2 deletions

View File

@ -5,6 +5,8 @@
standard. Check if they are implemented before using them. Do not standard. Check if they are implemented before using them. Do not
set the time of links if lutimes() does not exist, and use set the time of links if lutimes() does not exist, and use
utimes() as a replacement for futimes(). utimes() as a replacement for futimes().
* configure.in, lib/nscd.h, lib/nscd.c: Added --with-nscd flag to
support systems without nscd.
2008-08-26 Nicolas François <nicolas.francois@centraliens.net> 2008-08-26 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -38,9 +38,9 @@ AC_CHECK_HEADERS(errno.h fcntl.h limits.h unistd.h sys/time.h utmp.h \
dnl shadow now uses the libc's shadow implementation dnl shadow now uses the libc's shadow implementation
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])]) AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
AC_CHECK_FUNCS(l64a fchmod fchown fsync getgroups gethostname getspnam \ AC_CHECK_FUNCS(l64a fchmod fchown fsync futimes getgroups gethostname getspnam \
gettimeofday getusershell getutent initgroups lchown lckpwdf lstat \ gettimeofday getusershell getutent initgroups lchown lckpwdf lstat \
memcpy memset setgroups sigaction strchr updwtmp updwtmpx innetgr \ lutimes memcpy memset setgroups sigaction strchr updwtmp updwtmpx innetgr \
getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r) getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
@ -235,12 +235,20 @@ AC_ARG_WITH(libcrack,
AC_ARG_WITH(sha-crypt, AC_ARG_WITH(sha-crypt,
[AC_HELP_STRING([--with-sha-crypt], [allow the SHA256 and SHA512 password encryption algorithms @<:@default=yes@:>@])], [AC_HELP_STRING([--with-sha-crypt], [allow the SHA256 and SHA512 password encryption algorithms @<:@default=yes@:>@])],
[with_sha_crypt=$withval], [with_sha_crypt=yes]) [with_sha_crypt=$withval], [with_sha_crypt=yes])
AC_ARG_WITH(nscd,
[AC_HELP_STRING([--with-nscd], [enable support for nscd @<:@default=yes@:>@])],
[with_nscd=$withval], [with_nscd=yes])
AM_CONDITIONAL(USE_SHA_CRYPT, test "x$with_sha_crypt" = "xyes") AM_CONDITIONAL(USE_SHA_CRYPT, test "x$with_sha_crypt" = "xyes")
if test "$with_sha_crypt" = "yes"; then if test "$with_sha_crypt" = "yes"; then
AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms]) AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms])
fi fi
AM_CONDITIONAL(USE_NSCD, test "x$with_nscd" = "xyes")
if test "$with_nscd" = "yes"; then
AC_DEFINE(USE_NSCD, 1, [Define to support flushing of nscd caches])
fi
dnl Check for some functions in libc first, only if not found check for dnl Check for some functions in libc first, only if not found check for
dnl other libraries. This should prevent linking libnsl if not really dnl other libraries. This should prevent linking libnsl if not really
dnl needed (Linux glibc, Irix), but still link it if needed (Solaris). dnl needed (Linux glibc, Irix), but still link it if needed (Solaris).
@ -457,4 +465,5 @@ echo " SELinux support: $with_selinux"
echo " shadow group support: $enable_shadowgrp" echo " shadow group support: $enable_shadowgrp"
echo " S/Key support: $with_skey" echo " S/Key support: $with_skey"
echo " SHA passwords encryption: $with_sha_crypt" echo " SHA passwords encryption: $with_sha_crypt"
echo " nscd support: $with_nscd"
echo echo

View File

@ -1,5 +1,8 @@
/* Author: Peter Vrabec <pvrabec@redhat.com> */ /* Author: Peter Vrabec <pvrabec@redhat.com> */
#include <config.h>
#ifdef USE_NSCD
/* because of TEMP_FAILURE_RETRY */ /* because of TEMP_FAILURE_RETRY */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -54,4 +57,5 @@ int nscd_flush_cache (const char *service)
return 0; return 0;
} }
#endif

View File

@ -4,6 +4,10 @@
/* /*
* nscd_flush_cache - flush specified service buffer in nscd cache * nscd_flush_cache - flush specified service buffer in nscd cache
*/ */
#ifdef USE_NSCD
extern int nscd_flush_cache (const char *service); extern int nscd_flush_cache (const char *service);
#else
#define nscd_flush_cache(service) (0)
#endif
#endif #endif