Fix SMB read to not request overlength read exceeding our neg. buffer size
Per [MS-CIFS], the limit for data length in the read operation is set by MaxBufferSize (MAX_RX_BLOCK_SIZE in the source).
The problem is, in executing the read, there was no allowance for the SMB overhead, so we're asking for reads that produce packets larger than our buffer, which Samba4 is rightfully rejecting and giving us a short response to fit into the buffer we said we needed it to fit into.
In actually, Samba should abort the connection, but it responds to deal with Win2k having a similar bug.
Ref:
- Definition of MaxBufferSize [MS-CIFS v20180912 s2.2.4.53.1, pg 282]
- Definition of SMB_COM_READ [MS-CIFS v20180912 s2.2.4.11, pg 120]
Thanks to Rik Griffin for reporting this bug.