MC with SMB as VFS

Pavel Roskin proski at gnu.org
Fri Nov 30 20:46:07 UTC 2001


Hi, Zdzislaw!

> It looks like things with samba are getting better and better, and the 
> current (2.2.2) version of samba builds a shared library named 
> libsmbclient.so (whether it is a part of standard build is another thing - I 
> haven't checked it yet).

The rpm specfile doesn't create the library.  There is an option for
configure, but it's off by default.  Anyway, it's a good point to start.

> Since I can't locate libsmbclient on my machine (and I'm running 
> samba-2.0.10) I think it was not built in the past.

. From WHATSNEW.txt:

Changes in 2.2.2
...
6). libsmbclient stand-alone code added. Can be built as a shared library
under Linux.

> The list of the functions the library implements is as follows:
> int smbc_init(smbc_get_auth_data_fn fn, int debug);
> int smbc_open(const char *furl, int flags, mode_t mode);
> int smbc_creat(const char *furl, mode_t mode);
> ssize_t smbc_read(int fd, void *buf, size_t bufsize);
> ssize_t smbc_write(int fd, void *buf, size_t bufsize);
> off_t smbc_lseek(int fd, off_t offset, int whence);
> int smbc_close(int fd);
> int smbc_unlink(const char *furl);
...

All this looks good.  The library doesn't attempt to override standard 
libc routines (open, read, write) but defines its names instead.

The existing smbfs implimentation uses names beginning with "cli_"  
(cli_read, cli_write) but it's basically the standard libc-like functions,
so it should be easy to support the libsmbclient library.

> the first obstacle to make proper smbfs support for mc disappeared then (I 
> looked at the one in the mc's sources, and searched the mc's archives to get 
> an idea of the level of "hackery" you've been talking about).

Yes.  We don't have to wait until libsmbclient becomes widespread.  MC can 
make it happen.

-- 
Regards,
Pavel Roskin




More information about the mc mailing list