#1063755 after upgrading to booksworm samba stopped working with autofs in ghost mode

Package:
samba
Source:
samba
Description:
SMB/CIFS file, print, and login server for Unix
Submitter:
Barchan barchan
Date:
2024-02-12 09:03:04 UTC
Severity:
normal
Tags:
#1063755#5
Date:
2024-02-12 08:59:58 UTC
From:
To:
Dear Maintainer,

After upgrading Debian from version 11 to 12, we have observed
incorrect behavior of our mechanism for sharing logs from filesystems
mounted using autofs through Samba.

The autofs configuration appears as follows:

File /etc/auto.master:
/mnt/linbkp1 /etc/autofs.linbkp1 --timeout=60,--ghost

File /etc/autofs.linbkp1:
dd     -fstype=nfs,ro, linbkp1:/mnt/dd

Autofs itself works well - when the resource is not mounted, accessing
the directory from shell triggers its mounting.

The /mnt directory is shared in Samba in the standard way:

[mnt]
  path = /mnt
  browseable = yes
  read only = yes
  force user = root
  guest ok = no

(the rest of the smb.conf is the default debian configuration)

When access to the directory is initiated from a Linux system and the
resource is still mounted, the shared directory works correctly.

However, if the resource expires and is unmounted from the filesystem,
Samba version 4.17.12 fails to access the resource.

Attempting to list the resource results in an error:

smb: \linbkp1\dd\> ls
NT_STATUS_OBJECT_NAME_NOT_FOUND listing \linbkp1\dd\*

In Debian 11, where Samba 4.13.13 was used, a similar operation would
mount the resource, and if not on the first attempt, then subsequent
attempts to list the contents of the directory would display them
correctly. This mechanism also worked in older versions of Samba (from
Debian 9 and Debian 10).

I also tested Samba in debian-backports (samba 4.19.4) and
debian-experimental (samba 4.20.0~rc1), as well as with Red Hat 9
(Samba 4.18.6), and the error still persists.

Bug is reported upstream with the same content as
https://bugzilla.samba.org/show_bug.cgi?id=15578