From c57b2068ff45f1d184d034e62c48a6bdd9d6eed7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 28 Jul 2011 15:15:26 -0400 Subject: 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) --- src/sss_client/common.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sss_client/common.c') diff --git a/src/sss_client/common.c b/src/sss_client/common.c index c17629a9f..5f6af418a 100644 --- a/src/sss_client/common.c +++ b/src/sss_client/common.c @@ -55,6 +55,9 @@ int sss_cli_sd = -1; /* the sss client socket descriptor */ struct stat sss_cli_sb; /* the sss client stat buffer */ +#if HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR +__attribute__((destructor)) +#endif static void sss_cli_close_socket(void) { if (sss_cli_sd != -1) { -- cgit