summaryrefslogtreecommitdiffstats
path: root/src/sss_client/common.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-07-28 15:15:26 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-07-29 10:13:26 -0400
commit336879aabae137f9a81304f147fb0d43001654b0 (patch)
tree0ac8745808d88bab42409427cf425d8b75458105 /src/sss_client/common.c
parent3654a0c49e5ef3f24e2af29b34a13ff651a94c3d (diff)
downloadsssd-336879aabae137f9a81304f147fb0d43001654b0.tar.gz
sssd-336879aabae137f9a81304f147fb0d43001654b0.tar.xz
sssd-336879aabae137f9a81304f147fb0d43001654b0.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/sss_client/common.c')
-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 b60330559..55e393e57 100644
--- a/src/sss_client/common.c
+++ b/src/sss_client/common.c
@@ -53,6 +53,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) {