Midnight Commander and SMB

Andrew Tridgell tridge at samba.org
Sat Jan 9 00:20:00 GMT 1999

> That is, smbwrapper doesn't report the /smb directory as existing
> when gmc reads the root directory.

yep, that's the problem. 

> ...  One workaround would be to make smbwrapper also `fake` the /smb
> directory from within the root directory, would be my best guess.

yes, that's the right fix, although it should use smbw_prefix not /smb
as users can choose /smb to be something else on the smbsh command
line (say /home/shem/smb)

> With all of this stuff sorted out, i can now smbwrap my whole login
> shell and X session, including gnome & gmc and browse the workgroup in
> both panes.


try running smbd within smbwrapper some day and exporting /smb in
smb.conf. The results are really quite interesting! Recursive smb is
fun :)

> Andrew, are you sure this is not a good way to abstract away different
> filesystem types in userspace? The smbwrapper/gmc combination performs
> magnificently.

It is a good way to provide this functionality for existing programs,
but isn't as robust as more conventional library techniques if you
have the option of recompiling. The smbwrapper code is also quite a
bit harder to maintain as it needs to know about some internal
structures (look at what it has to do for stat() under linux).

I'm not familiar with what level of abstraction gnome uses, but if
gnome does have a mechanism in place to wrap filesystem calls at link
time then that would almost certainly be a better option for gnome

I do hope to get some time to work on smbwrapper a bit more later this
year. I'd like to get mmap(), exec() and generalised file descriptor
passing working as well as getting it working on a few more OSes.

One possible avenue to investigate if you want this functionality with
multiple protocols is to directly support user-level filesystems in
glibc. You could build basic VFS hooks into glibc much like how nis+
and other hostname/password systems are hooked in. Then a config file
could specify loadable user-space filesystems (as .so files) to
populate the VFS tables. I don't know how the glibc maintainers would
react to this, but it might be worth looking at.

Cheers, Tridge

More information about the samba-technical mailing list