1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

s4-winreg: fix dcesrv_winreg_EnumValue behavior

When returning WERR_MORE_DATA the winreg server needs to indicate the
required buffer size.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 20 04:50:00 UTC 2023 on atb-devel-224
This commit is contained in:
Günther Deschner 2023-11-16 21:05:12 +01:00 committed by Andrew Bartlett
parent 1fd0689f0e
commit 5119d5540d
2 changed files with 5 additions and 4 deletions

View File

@ -1 +0,0 @@
^samba4.rpc.winreg.*

View File

@ -312,6 +312,10 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call,
}
*r->out.type = (enum winreg_Type) data_type;
if (r->in.size != NULL) {
r->out.size = talloc(mem_ctx, uint32_t);
*r->out.size = data.length;
}
/* check the client has enough room for the value */
if (r->in.value != NULL &&
r->in.size != NULL &&
@ -323,9 +327,7 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call,
r->out.value = data.data;
}
if (r->in.size != NULL) {
r->out.size = talloc(mem_ctx, uint32_t);
*r->out.size = data.length;
if (r->in.length != NULL) {
r->out.length = r->out.size;
}