smbd: simplify handling of failing fstat() after unlinking file
authorRalph Boehme <slow@samba.org>
Mon, 5 Feb 2024 14:03:48 +0000 (15:03 +0100)
committerJule Anger <janger@samba.org>
Wed, 27 Mar 2024 14:52:15 +0000 (14:52 +0000)
commit3634df5d59e9f47345932a00098aead7efe55009
treeb0ee709f94acd1eac3064897a2d6ec48b604401b
parenta58338ec926d4979253b86fcc273be66e708adbd
smbd: simplify handling of failing fstat() after unlinking file

close_remove_share_mode() already called vfs_stat_fsp(), so we can skip the
fstat() triggered in fd_close() by fsp->fsp_flags.fstat_before_close being true.

This avoids getting an EACCESS error when doing an fstat() on the removed file
which seems to happen with some FUSE filesystems.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15527

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6e6324cff29089a636823786183222a73fe7cb28)
source3/smbd/close.c
source3/smbd/open.c