vfs_default: fix vfswrap_offload_write_send() NT_STATUS_INVALID_VIEW_SIZE check
commit74001095d25e6130979b5c9c973cc2414c9d60f7
authorStefan Metzmacher <metze@samba.org>
Tue, 31 Jul 2018 10:29:29 +0000 (31 12:29 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Apr 2019 07:00:30 +0000 (24 07:00 +0000)
treee009c8ea4ce50f6732d57b7380a8ec71bc51ed66
parenta50c4d7a8915630c8d2707d07b6e6fd51e421e6d
vfs_default: fix vfswrap_offload_write_send() NT_STATUS_INVALID_VIEW_SIZE check

This fixes a regression introduced in commit
60e45a2d25401eaf9a15a86d19114670ccfde259, where the 'num' variable
was renamed to 'to_copy', but a new 'num' variable was introduced.

Note that off_t is signed!
In future we need to watch out for filesystems supporting
FMODE_UNSIGNED_OFFSET on Linux. Which means they use it unsigned.

This is more or less a theoretical problem, The
NT_STATUS_INVALID_PARAMETER cases are catched before by
SMB_VFS_PREAD_SEND/RECV.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13862

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4d6cd932a955a99ca33cc4aedd7f612e56e0b1de)
source3/modules/vfs_default.c