VFS Module Docs & Examples

Jeremy Allison jra at samba.org
Tue Jul 31 17:06:48 UTC 2018


On Tue, Jul 31, 2018 at 09:55:27AM -0700, Richard Sharpe via samba-technical wrote:
> On Tue, Jul 31, 2018 at 9:52 AM, Kory Draughn
> <korydraughn.renci at gmail.com> wrote:
> > I've been using those links as well as the vfs_default.c as a reference, but
> > I feel I am still missing something.
> >
> > The software I'm trying to make work with samba manages lots of files.  The
> > files managed by this software can only be accessed through the interface
> > provided.  Even if I know the physical location of the files, I'm not
> > allowed to access them that way.  I can only use the logical path.
> >
> > Does samba expect a file to actually reside under the share?
> > Is the path with the share required?
> > Am I wrong in thinking that the files do NOT have to exist under the share
> > at all?
> >
> > It appears that samba is trying to lookup the file on the local filesystem.
> > After module_realpath() is called, I get a message saying:
> >   check_reduced_name: Bad access attempt: . is a symlink outside the share
> > path
> > This is understandable because the file does not exist locally.  Hopefully
> > that makes sense.
> 
> Yes, it makes sense. If the files are not in a local file system then
> you have to implement every VFS function and provide the correct steps
> for your file system. In some cases you may need to return ENOSYS.
> 
> As Jeremy says, look at the module for CEPH or GlusterFS.

Also, you can make the "virtual" path exported by the
share be "/", that way all paths you implement will
automatically be under it. Be careful with that though,
you must implement *all* filesystem functions in order
to prevent smbd trying to access the local filesystem
for that share definition.



More information about the samba-technical mailing list