From 3d47cae71d953e05e793ca5dd392fa6e260e23e0 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 8 Jan 2024 15:12:35 +0000 Subject: [PATCH] s3/rpc_client: change type of offset to uint64_t Offset can be a 32 or 64 bit address depending on the indexing addressing mode negotiated by the client With a 32 bit param we can only specify a 32 bit base address. This change alone doesn't affect anything as it is the client itself that choses and passes the base address offset and wspsearch is the only current user of this code. In this case even with 64bit addressing negotiated the address passed represents only the lower 32-bits part of the address. However, for coverage purposes it would be better for the client to use an address that covers the full 64bit range of the address (when 64 bit addressing is negotiated). This change will alow the wspsearch client in a future commit to pass a base address value with both the hi and low 32 bits values set to make up the full 64 bit address. Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett (cherry picked from commit a61eb7032896265eaef3ba225aafd6f293e7569d) --- source3/rpc_client/wsp_cli.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source3/rpc_client/wsp_cli.c b/source3/rpc_client/wsp_cli.c index b21f55c86f09..450bd2525e0f 100644 --- a/source3/rpc_client/wsp_cli.c +++ b/source3/rpc_client/wsp_cli.c @@ -761,7 +761,7 @@ void create_seekat_getrows_request(TALLOC_CTX * ctx, static bool extract_rowbuf_variable_type(TALLOC_CTX *ctx, uint16_t type, - uint32_t offset, + uint64_t offset, DATA_BLOB *rows_buf, uint32_t len, struct wsp_cbasestoragevariant *val) { @@ -770,7 +770,7 @@ static bool extract_rowbuf_variable_type(TALLOC_CTX *ctx, ndr_flags_type ndr_flags = NDR_SCALARS | NDR_BUFFERS; DATA_BLOB variant_blob = data_blob_null; if (offset >= rows_buf->length) { - DBG_ERR("offset %d outside buffer range (buf len - %zu)", + DBG_ERR("offset %"PRIu64" outside buffer range (buf len - %zu)", offset, rows_buf->length); return false; @@ -902,7 +902,7 @@ static enum ndr_err_code extract_variant_addresses(TALLOC_CTX *ctx, bool is_64bit, struct ndr_pull *ndr_pull, ndr_flags_type flags, - uint32_t offset, + uint64_t offset, DATA_BLOB *rows_buf, uint64_t *pcount, uint64_t **pvec_address/*, @@ -1010,7 +1010,7 @@ static enum ndr_err_code extract_crowvariant_variable(TALLOC_CTX *ctx, bool is_64bit, struct ndr_pull *ndr_pull, ndr_flags_type flags, - uint32_t offset, + uint64_t offset, DATA_BLOB *rows_buf, uint32_t len, struct wsp_cbasestoragevariant *val) @@ -1116,7 +1116,7 @@ static enum ndr_err_code extract_crowvariant(TALLOC_CTX *ctx, bool is_64bit, struct ndr_pull *ndr_pull, ndr_flags_type flags, - uint32_t offset, + uint64_t offset, DATA_BLOB *rows_buf, uint32_t len, struct wsp_cbasestoragevariant *val) { -- 2.34.1