2

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) and samba-dot-org-smbd (homebrew) are registered for "Full Disk Access":

    enter image description here

  • 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.

1 Answer 1

3

I have the same issue, and no proper solution to it yet. However, I found that the issue does not happen on samba version 4.18.6, so here is a workaround (for homebrew):

  • Uninstall samba:
brew uninstall samba
  • Download the 4.18.6 homebrew formula:
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/2204327fea7f7e98bc640a6b1057079eace89eee/Formula/s/samba.rb
  • Install formula:
brew install --formula samba.rb
  • Pin to version 4.18.6 (to prevent it from updating):
brew pin samba
3
  • 1
    I thought so too, but I get Error: No formulae or casks found for [email protected]., hence the manual download of the old version. Dec 30, 2023 at 18:38
  • Thx for replying with your workaround, I can confirm that using a samba version < 4.19 does not show this behaviour. I should add: I have reported this to the samba list, to no avail at the moment.
    – mrcalvin
    Dec 31, 2023 at 12:10
  • I had the same issue and same solution. However, [email protected] stopped working recently when another package (icu4c) got updated (the update is required by brew PHP). This led me to discover that it is, fortunately, possible to have both versions of icu4c installed - see homebrew FAQ - which seems to work.
    – rowatt
    Mar 10 at 16:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .