Bug 3267 - libsmbclient: file descriptor leak
libsmbclient: file descriptor leak
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient
3.0.20b
Other Linux
: P3 normal
: none
Assigned To: Derrell Lipman
Samba QA Contact
http://bugs.debian.org/339564
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-16 23:44 UTC by Christian Perrier
Modified: 2005-12-05 20:44 UTC (History)
0 users

See Also:


Attachments
Patch proposed by the bug submitter (588 bytes, patch)
2005-11-16 23:44 UTC, Christian Perrier
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Perrier 2005-11-16 23:44:02 UTC
Bug report by Julien Cristau <julien.cristau@ens-lyon.org> in Debian BTS:

Package: libsmbclient
Version: 3.0.20b-2
Severity: normal
Tags: patch

Hi

when connecting to netbios shares, libsmbclient tries to cache
connections. smbc_server thus calls find_server to avoid creating
multiple connections with the same parameters. The problem is that if
find_server fails, and the subsequent call to cli_session_setup (at
libsmb/libsmbclient.c:715) fails too, it then tries to open a connection
with username = "". If this connection succeeds, it is cached, but the
username value of the cache entry is "", and the connection is never
reused, because every call to smbc_server (and thus to find_server) uses
the original username.
I think that there should either be a call to find_server(context,
server, share, workgroup, username_used, password) after username_used
has been set to "", or the connection should be cached with the original
username (which is what the attached patch does).
Comment 1 Christian Perrier 2005-11-16 23:44:34 UTC
Created attachment 1576 [details]
Patch proposed by the bug submitter
Comment 2 Derrell Lipman 2005-12-05 20:44:27 UTC
I looked at both patch options.  I agree with your choice.  Patch applied.  Thanks.