summaryrefslogtreecommitdiff
path: root/nsswitch/wb_common.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-05-10 12:05:01 +0200
committerVolker Lendecke <vl@samba.org>2010-05-10 14:11:14 +0200
commitaa8d91ae8e6b4b813c0479f09be9e090aff047a9 (patch)
treeb12426dab31c549e0635fef555a41bbb318646f8 /nsswitch/wb_common.c
parent36e736871e28665ffcbbc4d0c87e1a2b60fcf0e0 (diff)
downloadsamba-aa8d91ae8e6b4b813c0479f09be9e090aff047a9.tar.gz
samba-aa8d91ae8e6b4b813c0479f09be9e090aff047a9.tar.bz2
samba-aa8d91ae8e6b4b813c0479f09be9e090aff047a9.zip
libwbclient: Fix a fd-leak at dlclose-time
__attribute__((destructor)) makes winbind_close_sock() being called at dlclose() time. Found while testing apache on Linux with mod_auth_pam. Other platforms will have to find a different fix. One possibility would be to always close the socket after each operation, but this badly sucks performance-wise.
Diffstat (limited to 'nsswitch/wb_common.c')
-rw-r--r--nsswitch/wb_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/nsswitch/wb_common.c b/nsswitch/wb_common.c
index fbb550f139..9a3788a072 100644
--- a/nsswitch/wb_common.c
+++ b/nsswitch/wb_common.c
@@ -62,6 +62,9 @@ static void init_response(struct winbindd_response *response)
/* Close established socket */
+#if HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR
+__attribute__((destructor))
+#endif
static void winbind_close_sock(void)
{
if (winbindd_fd != -1) {