Bug 7265 - pam_winbind leaks file descriptors
pam_winbind leaks file descriptors
Status: RESOLVED DUPLICATE of bug 7684
Product: Samba 3.4
Classification: Unclassified
Component: Winbind
3.4.7
Other Linux
: P3 major
: ---
Assigned To: Michael Adam
Samba QA Contact
http://bugs.debian.org/574468
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-19 01:00 UTC by Debian samba package maintainers (PUBLIC MAILING LIST)
Modified: 2011-01-01 23:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian samba package maintainers (PUBLIC MAILING LIST) 2010-03-19 01:00:33 UTC
From our user in the abovementioned bug report in Debian:

The pam_winbind module leaks file descriptors.  wb_common.c keeps its
file descriptor in the winbindd_fd global variable and closes that
through the winbind_close_sock function, but there's no provision for
making sure that winbind_close_sock is called when pam_winbind is closed
via dlclose.

A symptom of this is that Apache, if set up to use its auth_pam module,
is eventually unable to authenticate new users.

The attached patch instructs gcc to treat winbind_close_sock as a
destructor.  This is the simplest fix but maybe not the best; from
looking at the docs, specifying a cleanup function to pam_set_data (and
doing something else for nss_winbind?) may be more correct.


diff -r samba-3.4.7.orig/nsswitch/winbind_client.h samba-3.4.7/nsswitch/winbind_client.h
28c28
< void winbind_close_sock(void);
---
> void winbind_close_sock(void) __attribute__((destructor));
Comment 1 Debian samba package maintainers (PUBLIC MAILING LIST) 2011-01-01 23:59:39 UTC
From a discussion on IRC, this bug is a duplicate of #7684 (rather saif that 7684 is a duplicate of this one..:-))

*** This bug has been marked as a duplicate of bug 7684 ***