summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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 'src')
-rw-r--r--src/sss_client/common.c3
1 files changed, 3 insertions, 0 deletions
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) {