From 2f2236661c0353f6dc1aedf70eb99c9c2be202b5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 20 Sep 2011 22:45:52 +0200 Subject: [PATCH] v3-6-test: Further fix for bug 8338 OS/X can not deal with a 10-vwv read on normal files. Autobuild-User: Volker Lendecke Autobuild-Date: Wed Sep 21 00:51:08 CEST 2011 on sn-devel-104 (cherry picked from commit 81703ab7528055bbae8306d2c9a8314316107f85) --- source3/libsmb/clireadwrite.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 724c846e840..b80151e2ff7 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -88,7 +88,6 @@ struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx, { struct tevent_req *req, *subreq; struct cli_read_andx_state *state; - bool bigoffset = False; uint8_t wct = 10; if (size > cli_read_max_bufsize(cli)) { @@ -115,11 +114,17 @@ struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx, SSVAL(state->vwv + 8, 0, 0); SSVAL(state->vwv + 9, 0, 0); - if ((uint64_t)offset >> 32) { - bigoffset = true; + if (cli->capabilities & CAP_LARGE_FILES) { SIVAL(state->vwv + 10, 0, (((uint64_t)offset)>>32) & 0xffffffff); - wct += 2; + wct = 12; + } else { + if ((((uint64_t)offset) & 0xffffffff00000000LL) != 0) { + DEBUG(10, ("cli_read_andx_send got large offset where " + "the server does not support it\n")); + tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); + return tevent_req_post(req, ev); + } } subreq = cli_smb_req_create(state, ev, cli, SMBreadX, 0, wct, -- 2.34.1