gvfs and (lib)smbclient (resend)

Richard Sharpe realrichardsharpe at gmail.com
Sat Aug 2 09:11:14 MDT 2014

On Sat, Aug 2, 2014 at 8:01 AM, Ross Lagerwall <rosslagerwall at gmail.com> wrote:
> Hi all,
> (I sent this to the samba list a few months back with little response so
> resending to samba-technical in the hope of more feedback.)
> I'm one of the GNOME gvfs maintainers, and would like to improve the support of
> smb in gvfs, especially in the context of taking advantage of the improvements
> of SMB2 and SMB3.  Currently we use libsmbclient which provides a fairly easy to
> use API.  It is not, however, quite sufficient for the way that we would like to
> use it (at least I think so):
> - Slow transfer speeds.  Although passing very large blocks to
> libsmbclient does cause it to pipeline requests, this is not always
> practical, and it's not really possible to get the level of pipelining
> seen with smbclient where you can have multiple 1MB requests in flight.
> Some sort of async interface would be nice.  We also usually want to
> display progress with a reasonable resolution....
> - The mapping between NT error message and UNIX errno makes it difficult to
> provide a nice error message to the user or even to know what's going on.  For
> example, calling rename() with one of the path's having an invalid character
> gives ENOMEM.  It is difficult to tell whether this is an out of memory error,
> a malformed source URI or a malformed target URI.  It would be nice to get
> access to the real error message.
> Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=702568
>               https://bugzilla.gnome.org/show_bug.cgi?id=350976
> - No way of easily mapping to and from POSIX permissions resulting in files'
> permissions often being inadvertently changed when saving files.
> Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=592651
>               https://bugzilla.gnome.org/show_bug.cgi?id=581368
> - No support for POSIX extensions.
> Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=562029
>               https://bugzilla.samba.org/show_bug.cgi?id=5926
> - No support for file monitoring, e.g. NT_TRANSACT_NOTIFY_CHANGE.
> Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=627107
>               https://bugzilla.samba.org/show_bug.cgi?id=7393
> - Some extras that would be nice to have:
> Server side copy.  (I understand this hasn't been implemented in Samba
> client-side?).
> Setting mtime and atime individually.
> Finer-grained (e.g. microsecond/nanosecond) timestamps.
> While some of these problems could probably be fixed by extending
> libsmbclient, I feel that libsmbclient is probably slightly too
> high-level for ideal use in gvfs.  I note the existence of
> libsmbclient-raw but it appears to not provide a stable (or documented!)
> API.  Searching through the mailing lists shows that I'm not the only
> one to come to this conclusion, but I suppose the difficulty is in
> getting the level of abstraction in the library correct.

Hi Ross,

So, assuming that a 'better' API becomes available, two questions come to mind:

1. How are you going to harmonize these with POSIX? That is, it would
seem that you are going to have to engage in some pretty heroic code
contortions for this to work both with POSIX and NTFS semantics.

2. Do you have a concise list of the API calls you would like available?

Something else that comes to mind is: Do you want all functions to
return NT_STATUS results and then have functions like
map_nt_status_to_errno and nt_errstr?

It might be easier to get what you want if we precisely define what you want.

Richard Sharpe

More information about the samba-technical mailing list