From c5da08422990dfc1e082bc01aa10d6e415eebe3f Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 11 Dec 2020 13:00:56 +0100 Subject: [PATCH] vfs_fruit: check fake_fd in fruit_pread_meta_stream() Don't call into the next VFS backend if we know we still have a fake-fd. Just return -1 and the caller has the logic to handle this, which results in returning a AFP_AfpInfo blob initialized with some defaults. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14596 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/modules/vfs_fruit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 0cf819f7f78..26f0a9e22d5 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -2122,9 +2122,14 @@ static ssize_t fruit_pread_meta_stream(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) { + struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp); ssize_t nread; int ret; + if (fio->fake_fd) { + return -1; + } + nread = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset); if (nread == -1 || nread == n) { return nread; -- 2.47.2