Creating a VFS backend

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


Hello,

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: https://gitlab.com/matvore/samba/-/commits/vfs_hello

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

Thank you,
Matt

---

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
NT_STATUS_NOT_IMPLEMENTED listing \*
smb: \> ls
NT_STATUS_NOT_IMPLEMENTED listing \*
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_init
hello_connect
hello_realpath: '/'
hello_realpath: '/'
hello_stat: '/'
hello_fs_capabilities
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