smb client support in midnight commander

wayne roberts wroberts1 at
Sat May 1 22:54:56 GMT 1999

   I have implemented smb client functionality in midnight commander
file manager.  It is implemented in its virtual filesystem layer,
just like the ftpfs and others. It mostly uses the functionality
provided by the libsmb/clientgen.c in samba.

   The functionality of browsing for servers, showing shares on server
as directories, and all read/write/erase/mkdir/rmdir/etc.. is all

   The reason for posting this is to find developers more familiar with
the smb protocol who can review the implementation and test it.
Everything works fine as far as i can tell, but there may be issues I
am not aware of in other environments.

   So i'm asking samba developers who want smb client support in midnight
commander to look at the code:, then mail me to
get the location of the full MC source, which is 3.7MByte which i'm not
sure I want everybody & their brother sucking up my bandwidth.

   The only change I had to make to samba source is dbf = stderr in
setup_logging() in lib/debug.c so i could redirect messages to a fifo
to view them on another terminal.

   Of particular difficulty is: since i cant send cli_chkpath when
idle to keep connection alive, NT server times out & closes in 15-20min.
So I have to catch the EPIPE myself to know when i need to close &
reconnect.  cli_reestablish_connect() in libsmb/clientgen.c is disfunctional.
I seem to have it reconnecting fine in this situation.

   Additional functionality that should be added to midnight commander
to better support smb filesystem is to support the comments field in
server & share listings.  Also, the servers are currently shown as
directories.  There should be a way to tell mc that this dir is a server
so it can show a server icon for the entry.  These are cosmetic issues
that the MC team should address.

More information about the samba mailing list