]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/utils: use full 64 bit address for getrows (with 64bit offsets)
authorNoel Power <noel.power@suse.com>
Mon, 8 Jan 2024 15:56:38 +0000 (15:56 +0000)
committerJule Anger <janger@samba.org>
Mon, 26 Feb 2024 09:34:15 +0000 (09:34 +0000)
if 64bit offsets are used the hi 32-bits of address are stored in
the ulreserved2 member of the message header field and the low 32-bits
are stored in the ulclientbase member of the cpmgetrows message

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 6ecb614b8ec6953ba15e8061fce9b395615b035a)

source3/utils/wspsearch.c

index 2c56c97736b9a4eb8b76520471689970e0e07fc9..063b952d4683c7e979d7fd9834b3f017a77275a3 100644 (file)
@@ -350,6 +350,10 @@ static NTSTATUS create_getrows(TALLOC_CTX *ctx,
        uint32_t INITIAL_ROWS = 32;
        uint32_t requested_rows = INITIAL_ROWS;
        uint32_t rows_printed;
+       uint64_t baseaddress;
+       uint32_t offset_lowbits = 0xdeabd860;
+       uint32_t offset_hibits  = 0xfeeddeaf;
+
        TALLOC_CTX *row_ctx;
        bool loop_again;
 
@@ -377,10 +381,24 @@ static NTSTATUS create_getrows(TALLOC_CTX *ctx,
                                        skip,
                                        requested_rows,
                                        40,
-                                       0xDEAbd860,
+                                       offset_lowbits,
                                        bindings->brow,
                                        0);
 
+               if (is_64bit) {
+                       /*
+                        * MS-WSP 2.2.2
+                        * ulreservered holds the high 32-bits part of
+                        * a 64-bit offset if 64-bit offsets are being used.
+                        */
+                       request->header.ulreserved2 = offset_hibits;
+                       baseaddress = request->header.ulreserved2;
+                       baseaddress <<= 32;
+                       baseaddress += offset_lowbits;
+               } else {
+                       baseaddress = offset_lowbits;
+               }
+
                status = wsp_request_response(request,
                                wsp_ctx,
                                request,
@@ -419,7 +437,7 @@ static NTSTATUS create_getrows(TALLOC_CTX *ctx,
                                is_64bit,
                                disp_all_cols,
                                bindings, 40,
-                               0xDEAbd860,
+                               baseaddress,
                                response->message.cpmgetrows.rowsreturned,
                                &rows_printed);
                        if (!NT_STATUS_IS_OK(status)) {