smbd: make vfs_stat_fsp() a no-op on fake file-handles
authorRalph Boehme <slow@samba.org>
Fri, 4 Aug 2023 15:19:00 +0000 (17:19 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 12 Sep 2023 17:08:17 +0000 (17:08 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 12 17:08:17 UTC 2023 on atb-devel-224

source3/smbd/vfs.c

index 89150b37f90a21cc7d5ba0cdbade29fd3d1c6d31..a34b908335284ecc3feeea79523715a3e3c94373 100644 (file)
@@ -1166,6 +1166,10 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
        int ret;
        struct stat_ex saved_stat = fsp->fsp_name->st;
 
+       if (fsp->fake_file_handle != NULL) {
+               return NT_STATUS_OK;
+       }
+
        if (fsp_get_pathref_fd(fsp) == -1) {
                if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
                        ret = SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name);