1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3/utils: use full 64 bit address for getrows (with 64bit offsets)

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>
This commit is contained in:
Noel Power 2024-01-08 15:56:38 +00:00 committed by Noel Power
parent efa60ff310
commit 6ecb614b8e

View 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)) {