Bug 7684 - fd leak in libwbclient.so
fd leak in libwbclient.so
Product: Samba 3.5
Classification: Unclassified
Component: Winbind
All Linux
: P3 critical
: ---
Assigned To: Karolin Seeger
Samba QA Contact
: 7265 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2010-09-16 11:59 UTC by Yong Feng
Modified: 2011-01-01 23:59 UTC (History)
2 users (show)

See Also:

Patch for 3.5 (1011 bytes, patch)
2010-09-16 12:09 UTC, Volker Lendecke
jra: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Yong Feng 2010-09-16 11:59:07 UTC
I am using pam+winbind+AD to authenticate request. The linux version is RHEL 5.4 and winbind is 3.5.3.
The issue I met is that after our daemon is running for a while, it cannot accept any request due to fd reach the limit.
After checking the source codes of winbind, I find libwbclient.so caches privilege connection to winbindd for reuse (please refer to winbind_open_pipe_sock() in wb_common.c). However every time a process call pam API to create a new PAM session, pam_winbind.so will dynamically load libwbclient.so and then unload it after the session is done. At that time the cached privilege connection is not closed. As a result, during the process is running whenever a PAM session is created, there will be a fd leaked by libwbclient.so. 

So we need either provide a way to disable cache of privilege connection or implement clean-up logic when libwbclient.so is unloaded.


Comment 1 Volker Lendecke 2010-09-16 12:09:22 UTC
Created attachment 5965 [details]
Patch for 3.5

Should be fixed with the attached patch. This is aa8d91ae8e6b4 from master.

Comment 2 Jeremy Allison 2010-09-16 18:21:06 UTC
Comment on attachment 5965 [details]
Patch for 3.5

Looks good to me.
Comment 3 Jeremy Allison 2010-09-16 18:21:26 UTC
Re-assigning for inclusion in 3.5.next.

Comment 4 Yong Feng 2010-09-17 10:04:47 UTC
Thanks for the patch. It works well.

Comment 5 Karolin Seeger 2010-09-21 03:25:53 UTC
Pushed to v3-5-test. Will be included in 3.5.6.
Closing out bug report.

Comment 6 Debian samba package maintainers (PUBLIC MAILING LIST) 2011-01-01 23:59:39 UTC
*** Bug 7265 has been marked as a duplicate of this bug. ***