smbd: look only at handle readability for COPYCHUNK dest

Enterprise / Samba - Uri Simchoni [samba.org] - 16 August 2016 08:21 UTC

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

3e42b69 smbd: look only at handle readability for COPYCHUNK dest
source3/include/smb_macros.h | 8 ++++++++
source3/smbd/smb2_ioctl_network_fs.c | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)

Upstream: gitweb.samba.org


  • Share