s3-libsmb Do not limit read replies to NBT packet sizes
authorAndrew Bartlett <abartlet@samba.org>
Fri, 27 Jan 2012 02:53:34 +0000 (13:53 +1100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 5 Mar 2012 19:55:39 +0000 (20:55 +0100)
With the posix extensions, we can read 16MB at a time, so we need to
check the full size of the packet, not the size rounded down to the
old NBT limit.

Andrew Bartlett

Fix bug #8727 (smbclient fails with posix large reads).
(cherry picked from commit 3394bbf45dd219dc0293809fe2c50ad3ab7cede6)

source3/libsmb/clireadwrite.c

index 53ecacc10936e3ea4a561377046a8ecaa9de87e3..724c846e840969ed79ca8f19d254c71f44dac22e 100644 (file)
@@ -199,7 +199,7 @@ static void cli_read_andx_done(struct tevent_req *subreq)
        inbuf = cli_smb_inbuf(subreq);
        state->buf = (uint8_t *)smb_base(inbuf) + SVAL(vwv+6, 0);
 
-       if (trans_oob(smb_len(inbuf), SVAL(vwv+6, 0), state->received)
+       if (trans_oob(smb_len_large(inbuf), SVAL(vwv+6, 0), state->received)
            || ((state->received != 0) && (state->buf < bytes))) {
                DEBUG(5, ("server returned invalid read&x data offset\n"));
                tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);