• Chris Collins's avatar
    Fix SMB read to not exceed our negotiated buffer size · 1052e13e
    Chris Collins authored
    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.
    
    Actually, Samba should abort the connection, but it responds to deal
    with Win2k having a similar bug.
    
    Ref:
     * Definition of MaxBufferSize [MS-CIFS v20180912 s 2.2.4.53.1, pg 282]
     * Definition of SMB_COM_READ [MS-CIFS v20180912 s2.2.4.11, pg 120]
    
    Version 2.66. Tagged as 'OmniLanManFS-2_66'
    1052e13e
VersionNum 681 Bytes