]> 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)
committerJeremy Allison <jra@samba.org>
Fri, 8 Jan 2021 20:31:33 +0000 (20:31 +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>
source3/modules/vfs_fruit.c

index 0cf819f7f780a6a7dc91136ca930d764c1c37887..26f0a9e22d53340a8e59c2d1937916aeacb71d0b 100644 (file)
@@ -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;