Bug 7265 - pam_winbind leaks file descriptors
Summary: pam_winbind leaks file descriptors
Status: RESOLVED DUPLICATE of bug 7684
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 3.4.7
Hardware: Other Linux
: P3 major
Target Milestone: ---
Assignee: Michael Adam
QA Contact: Samba QA Contact
URL: http://bugs.debian.org/574468
Keywords:
Depends on:
Blocks:
 
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 ***