I hope to make samba.org's smbd
run on my MacBook Pro (M1, 13.6.2) to provide shares to some VMs (qemu/ UTM) on and restricted to the same host. I succeeded in installing Samba via MacPorts and via homebrew, I created some test shares (incl. a public one allowing for guest access), but there is an anomaly: I can access the shares using smbclient
from the macOS host, from any VM (running Windows, running Linux), but they appear empty:
This is a macOS local directory (permissions are set as permissive):
/tmp/publictest (drwxrwxrwx: <username>:staff)
└── dummy-1.pdf (-rw-rw-rw-@: <username>:staff)
<username>
refers to my macOS user name, for Samba shares etc. I created a sharing-only macOS-local user sambauser
(505) as a member of group staff
(20).
The directory is exposed as a share (smb.conf):
[public]
ea support = No
force create mode = 0666
force directory mode = 0777
guest ok = Yes
guest only = Yes
path = /tmp/publictest
read only = No
store dos attributes = No
Running locally, from the same macOS machine, yields:
% /opt/homebrew/bin/smbclient //localhost/public
Password for [WORKGROUP\<username>]:
Anonymous login successful
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Sat Nov 25 11:04:43 2023
.. D 0 Sat Nov 25 11:04:43 2023
482797652 blocks of size 1024. 108446544 blocks available
So, dummy-1.pdf
is missing?!
Logging reveals (--debuglevel=10 --debug-stdout --foreground
):
file_name_hash: /private/tmp/publictest/. hash 0x7aedb117
push_sec_ctx(4294967294, 4294967294) : sec_ctx_stack_ndx = 1
push_conn_ctx(1627971036) : conn_ctx_stack_ndx = 0
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
Security token: (NULL)
UNIX token of user 0
Primary group is 0 and contains 0 supplementary groups
pop_sec_ctx (4294967294, 4294967294) - sec_ctx_stack_ndx = 0
fd_openat: name ., flags = 04 mode = 00, fd = 26
openat_pathref_fullname: fsp [.]: OK
fdos_mode: .
dos_mode_debug_print: dos_mode_from_sbuf returning (0x10): "d"
dos_mode_debug_print: fdos_mode returning (0x10): "d"
smbd_dirptr_get_entry: mask=[*] found . fname=.. (..)
smbd_marshall_dir_entry: space_remaining = 8388488
smbd_marshall_dir_entry: SMB_FIND_ID_BOTH_DIRECTORY_INFO
delete_lock_ref_count for file .
file_free: freed files structure 0 (1 used)
smbd_dirptr_get_entry: dir [.] dirptr [0x131e123c0] offset [3] => dname [dummy-1.pdf]
openat_pathref_fsp_nosymlink: path_in=dummy-1.pdf
fsp_new: allocated files structure (2 used)
openat_pathref_fsp_nosymlink: SMB_VFS_OPENAT(., dummy-1.pdf, RESOLVE_NO_SYMLINKS) returned 78 Function not implemented => NT_STATUS_NOT_SUPPORTED
readlink_talloc: SMB_VFS_READLINKAT() failed: No such file or directory
read_symlink_reparse: readlink_talloc failed: NT_STATUS_OBJECT_NAME_NOT_FOUND
openat_pathref_fsp_nosymlink: create_open_symlink_err failed: NT_STATUS_OBJECT_NAME_NOT_FOUND
file_free: freed files structure 0 (1 used)
smbd_dirptr_get_entry: Could not open dummy-1.pdf: NT_STATUS_NOT_A_DIRECTORY
smbd_dirptr_get_entry: dir [.] dirptr [0x131e123c0] offset [3] => dname [(finished)]
smbd_smb2_request_find_done: out_output_buffer.length = 220
This is where I am stuck. I have failed to understand (so far) why dummy-1.pdf
is processed (as a directory), but not simply as a file.
Samba version (via Homebrew):
sudo /opt/homebrew/sbin/samba-dot-org-smbd --version Version 4.19.2
Global parameters:
[global] allow insecure wide links = Yes bind interfaces only = Yes interfaces = lo0 max log size = 50 security = USER server role = standalone server server string = samba server idmap config * : backend = tdb
smbd
(MacPorts) andsamba-dot-org-smbd
(homebrew) are registered for "Full Disk Access":As I stated earlier, this is not a Samba client issue (e.g., SELinux being active on some Linux VM or so). The behaviour is reproducible for any Samba client/ remote machine I had been testing (e.g., mounting in Powershell on Windows 2022 server, etc.)
I checked the MacPorts and Homebrew tickets, no mention of this problem.
macOS-own
smbd
is inactive, and File Sharing is deactivated.