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).

Cheers,
Julien Cristau

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.13
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages libsmbclient depends on:
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libcomerr2                    1.38-2     common error description library
ii  libkrb53                      1.3.6-5    MIT Kerberos runtime libraries
ii  libldap2                      2.1.30-12  OpenLDAP libraries
ii  libroken16-kerberos4kth       1.2.2-11.3 Roken Libraries for Kerberos4 From

libsmbclient recommends no packages.

-- no debconf information
--- source/libsmb/libsmbclient.c.orig   2005-11-17 06:09:09.073665787 +0100
+++ source/libsmb/libsmbclient.c        2005-11-17 05:56:50.079229544 +0100
@@ -764,7 +764,7 @@
        /* now add it to the cache (internal or external)  */
        /* Let the cache function set errno if it wants to */
        errno = 0;
-       if (context->callbacks.add_cached_srv_fn(context, srv, server, share, 
workgroup, username_used)) {
+       if (context->callbacks.add_cached_srv_fn(context, srv, server, share, 
workgroup, username)) {
                int saved_errno = errno;
                DEBUG(3, (" Failed to add server to cache\n"));
                errno = saved_errno;

Reply via email to