From: Ralph Boehme Date: Fri, 11 Dec 2020 12:00:56 +0000 (+0100) Subject: vfs_fruit: check fake_fd in fruit_pread_meta_stream() X-Git-Tag: samba-4.12.11~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a77dcd69358a3f16ae7a93f9e7f606967ab2951;p=thirdparty%2Fsamba.git 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 (back-ported from commit c5da08422990dfc1e082bc01aa10d6e415eebe3f) --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index a61a7393ada..5f0ac1d28b3 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -2186,9 +2186,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;