Creating a VFS backend

Matthew DeVore matvore at
Tue Aug 11 21:10:39 UTC 2020


I'm investigating using Samba to host a custom filesystem which
currently relies on FUSE.

To get started, I wanted to make a trivial VFS backend which exposed a
few hard-coded files in a single directory. Samba is invoking
connectpath, get_realpath, and some other methods that I've
implemented but for some reason it's giving up ("it" refers to either
Samba's smbclient and the macOS SMB client). It never seems to attempt
an opendir or openat operation.

TL;DR: what VFS operation did I omit or implement wrongly that, if
fixed, will result in opendir or openat being attempted?

Here is the source code:

Only the last commit is relevant - the others are hacks and tweaks to
make the code work on macOS. Detailed output follows.

Thank you,


This is what I tried to do in smbclient:

$ ~/samba_build/bin/smbclient -p 8111 //localhost/sambashare
Enter WORKGROUP\matvore's password:
Try "help" to get a list of possible commands.
smb: \> dir
smb: \> ls
smb: \> more foo
smb1cli_req_writev_submit: called for dialect[SMB3_11] server[localhost]
NT_STATUS_REVISION_MISMATCH opening remote file \foo
smb: \>

Here is the output of smbd:

$ sudo ~/samba_build/sbin/smbd  --foreground --port 8111 --debuglevel=1 -S
smbd version 4.14.0pre1-GIT-be59b2d19d4 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
INFO: Profiling support unavailable in this build.
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
Failed to fetch record!
idmap range not specified for domain '*'
hello_realpath: '/'
hello_realpath: '/'
hello_stat: '/'
hello_stat: '.'
hello_realpath: '.'
hello_connectpath: '.' '/'
hello_stat: '.'
hello_realpath: '.'
hello_connectpath: '.' '/'
hello_stat: 'foo'
hello_realpath: 'foo'
hello_connectpath: 'foo' '/'

More information about the samba-technical mailing list