summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-07-28 15:15:26 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-08-04 10:32:18 -0400
commitbd2695cc4732f307b47a9cb567a68f67a992fd8f (patch)
treebc998e5593a73209fcbe2a124fcbbd04511d65fd /configure.ac
parent5e05962686b436b0fd7297fa07e2bd857967144e (diff)
downloadsssd-bd2695cc4732f307b47a9cb567a68f67a992fd8f.tar.gz
sssd-bd2695cc4732f307b47a9cb567a68f67a992fd8f.tar.xz
sssd-bd2695cc4732f307b47a9cb567a68f67a992fd8f.zip
sss_client: avoid leaking file descriptors
If a pam or nss module is dlcolse()d and unloaded we were leaking the file descriptor used to communicate to sssd in the process. Make sure the fucntion used to close the socket file descriptor is called on dlclose() Silence autoconf 2.28 warnings (Patch by Jakub Hrozek)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 966499538..eb068e4dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,6 +172,18 @@ AC_CHECK_HEADERS([sys/inotify.h])
AC_CHECK_HEADERS([sasl/sasl.h],,AC_MSG_ERROR([Could not find SASL headers]))
+AC_CACHE_CHECK([whether compiler supports __attribute__((destructor))],
+ sss_client_cv_attribute_destructor,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([__attribute__((destructor)) static void cleanup(void) { }])],
+ sss_client_cv_attribute_destructor=yes)
+ ])
+
+if test x"$sss_client_cv_attribute_destructor" = xyes ; then
+ AC_DEFINE(HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR, 1,
+ [whether compiler supports __attribute__((destructor))])
+fi
+
PKG_CHECK_MODULES([CHECK], [check >= 0.9.5], [have_check=1], [have_check=])
if test x$have_check = x; then
AC_MSG_WARN([Without the 'CHECK' libraries, you will be unable to run all tests in the 'make check' suite])