]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: check fake_fd in fruit_pread_meta_stream()
authorRalph Boehme <slow@samba.org>
Fri, 11 Dec 2020 12:00:56 +0000 (13:00 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Jan 2021 12:41:13 +0000 (12:41 +0000)
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 <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(back-ported from commit c5da08422990dfc1e082bc01aa10d6e415eebe3f)

source3/modules/vfs_fruit.c

index a61a7393adac6b9ed5073da35aac0f2f738f8f84..5f0ac1d28b3bcbd95322a7db70d193c32885ef14 100644 (file)
@@ -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;