svn commit: samba r10176 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/client branches/SAMBA_3_0/source/libsmb trunk/source trunk/source/client trunk/source/libsmb

derrell at derrell at
Sun Sep 18 15:37:22 GMT 2005

"Gerald (Jerry) Carter" <jerry at> writes:

> jerry at wrote:
>> Author: jerry
>> Date: 2005-09-12 18:12:53 +0000 (Mon, 12 Sep 2005)
>> New Revision: 10176
>> WebSVN:
>> Log:
>> adding smbctool from Kalim's SoC project; requires make bin/smbctool
>> Added:
>>    branches/SAMBA_3_0/source/client/smbctool.c
>>    trunk/source/client/smbctool.c
>> Modified:
>>    branches/SAMBA_3_0/source/
>>    branches/SAMBA_3_0/source/libsmb/libsmbclient.c
>>    trunk/source/
>>    trunk/source/libsmb/libsmbclient.c
> Derrell,
> You might want to look over these libsmbclient changes as well
> if you haven't already.

Hi Jerry, Kalim,

I spent some time looking through the changes to libsmbclient to add DFS
support.  They generally look good, although I'm concerned about some possible
performance issues.

1. Currently, the code issues a cli_resolve_path() call for each
   smbc_open_ctx(), smbc_read_ctx(), smbc_write_ctx() and smbc_close_ctx().
   Unless the path can resolve to a different location each time, and we want
   to follow the location even with an open connection that we're reading from
   or writing to (unlikely), we should be able to resolve the path once at
   smbc_open_ctx() time and use the resolved path for all further accesses to
   the file with the now-open file descriptor.

2. The code currently always does cli_resolve_path() *before* attempting the
   native call.  DFS is likely the "fringe" case, not the common case, I
   think.  Given that, is it possible to issue the native call first, assuming
   that DFS is not in use, get back an error code that indicates that the path
   must be resolved (if it is actually DFS), and *then* do the DFS-specific

3. In the function cli_dfs_make_full_path(),

        if (*sharename == '\\') {
                server = sharename+2;

   Should that be sharename+1 ?

4. Less importantly...  In tracing through the code, I noticed that there are
   numerous calls to cli_dfs_make_full_path(), first within cli_resolve_path()
   a few times, and then in smbc_open_ctx().  Is it possible to build each
   path only once?



More information about the samba-technical mailing list