v3-6-test: Further fix for bug 8338
authorVolker Lendecke <vl@samba.org>
Tue, 20 Sep 2011 20:45:52 +0000 (22:45 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 22 Jun 2012 19:38:42 +0000 (21:38 +0200)
OS/X can not deal with a 10-vwv read on normal files.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Sep 21 00:51:08 CEST 2011 on sn-devel-104
(cherry picked from commit 5ca1ff390843e2a0c217a3627297d7af4eadd50d)

source3/libsmb/clireadwrite.c

index 83531a5270bb006104726c0496beb6d46086acff..a32f0789b598dc200d0511a58e1419351220f233 100644 (file)
@@ -133,10 +133,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) {
+       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,