smbd: look only at handle readability for COPYCHUNK dest
authorUri Simchoni <uri@samba.org>
Fri, 12 Aug 2016 21:19:33 +0000 (00:19 +0300)
committerDavid Disseldorp <ddiss@samba.org>
Tue, 16 Aug 2016 13:21:03 +0000 (15:21 +0200)
commit3e42b69d5e1216b6af570a09d58040d281bbbf17
treed44243cc4a7e1afe7f09b2dcb55002d73eb18c05
parent5bf11f6f5b4dab4cba4b00674bcb76138fb55974
smbd: look only at handle readability for COPYCHUNK dest

This commits sets the stage for a change of behavior
in a later commit.

When checking FILE_READ_DATA on the COPYCHUNK dest handle,
only check the handle readability and not the extra right
that may have been added due to the FILE_EXECUTE right.

The check for FILE_READ_DATA always seemed strange for the
dest handle, which is not read. It turns out that in Windows,
this check is not done at the SMB layer, but at a lower layer
that processes the IOCTL request - the IOCTL code has bits
that specify what type of access check needs to be done.

Therefore, this lower layer is unaware of the SMB layer's
practice of granting READ access based on the FILE_EXECUTE
right, and it only checks the handle's readability.

This subtle difference has observable behavior - the
COPYCHUNK source handle can have FILE_EXECUTE right instead
of FILE_READ_DATA, but the dest handle cannot.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Aug 16 15:21:03 CEST 2016 on sn-devel-144
source3/include/smb_macros.h
source3/smbd/smb2_ioctl_network_fs.c