9eb798
From 6c4e8869ba6121ddbc6e1eca880c39b0af3391e0 Mon Sep 17 00:00:00 2001
9eb798
From: Alexander Bokovoy <abokovoy@redhat.com>
9eb798
Date: Wed, 25 Oct 2017 11:38:55 +0300
9eb798
Subject: [PATCH 15/17] configure.ac: detect extended NSS API provided by SSSD
9eb798
9eb798
SSSD exposes an extended NSS API via libsss_nss_idmap. This API allows
9eb798
to query getpwnam()/getgrnam()/getgruid()/getpwuid()/getgrouplist()
9eb798
information with a timeout per request. As result, an application has
9eb798
possibility to cancel too long request.
9eb798
9eb798
This API also allows to ignore SSSD cache or invalidate it when
9eb798
requesting certain information. slapi-nis needs this functionality when
9eb798
invalidating own entries as result of changes done by other LDAP clients
9eb798
in the areas which slapi-nis doesn't track directly.
9eb798
9eb798
For example, an update of ID override in the Default Trust View should
9eb798
invalidate user or group entry for that AD object. Since retrieval of
9eb798
the user/group information relies on SSSD, SSSD needs to be notified
9eb798
that there is a change in ID override and evict the entry from its cache
9eb798
as well.
9eb798
---
9eb798
 configure.ac | 6 ++++++
9eb798
 1 file changed, 6 insertions(+)
9eb798
9eb798
diff --git a/configure.ac b/configure.ac
9eb798
index f82a47e..a958607 100644
9eb798
--- a/configure.ac
9eb798
+++ b/configure.ac
9eb798
@@ -361,8 +361,13 @@ if test "x$use_nsswitch" != xno ; then
9eb798
 			SSS_NSS_IDMAP_LIBS=
9eb798
 		fi
9eb798
 	fi
9eb798
+
9eb798
 	AC_SUBST(SSS_NSS_IDMAP_CFLAGS)
9eb798
 	AC_SUBST(SSS_NSS_IDMAP_LIBS)
9eb798
+	AC_CHECK_LIB(sss_nss_idmap,sss_nss_getpwnam_timeout)
9eb798
+	if test "x$ac_cv_lib_sss_nss_idmap_sss_nss_getpwnam_timeout" = xyes ; then
9eb798
+		AC_DEFINE(USE_SSS_NSS_TIMEOUT,1,[Use extended NSS API provided by SSSD])
9eb798
+	fi
9eb798
 
9eb798
 	if test "x$use_pam" != xno ; then
9eb798
 		AC_CHECK_HEADERS(security/pam_appl.h)
9eb798
@@ -384,6 +389,7 @@ if test "x$use_nsswitch" != xno ; then
9eb798
 	fi
9eb798
 	AC_DEFINE(USE_NSSWITCH,1,[Use nsswitch API to lookup users and groups not found in the LDAP tree])
9eb798
 fi
9eb798
+AM_CONDITIONAL([USE_SSS_NSS_TIMEOUT], [test "x$ac_cv_lib_sss_nss_idmap_sss_nss_getpwnam_timeout" = xyes])
9eb798
 
9eb798
 use_idviews=true
9eb798
 AC_ARG_WITH(idviews,
9eb798
-- 
9eb798
2.13.6
9eb798