From f75189dee9db486d393cd17c25f5a84ce2d0b889 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 14 Sep 2024 15:57:03 +0200 Subject: [PATCH] s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key() Note we only need to call this once per connection, not after each request... Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source3/rpcclient/cmd_drsuapi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c index bf87a26a8d5..3137bc656d2 100644 --- a/source3/rpcclient/cmd_drsuapi.c +++ b/source3/rpcclient/cmd_drsuapi.c @@ -573,6 +573,14 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, } } + status = dcerpc_binding_handle_auth_session_key( + b, mem_ctx, &session_key); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to get Session Key: %s", + nt_errstr(status)); + return ntstatus_to_werror(status); + } + for (y=0; ;y++) { if (level == 8) { @@ -609,13 +617,6 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, ctr1 = &ctr.ctr2.mszip1.ts->ctr1; } - status = cli_get_session_key(mem_ctx, cli, &session_key); - if (!NT_STATUS_IS_OK(status)) { - printf("Failed to get Session Key: %s", - nt_errstr(status)); - return ntstatus_to_werror(status); - } - if (out_level == 1) { DEBUG(1,("end[%d] tmp_highest_usn: %llu , highest_usn: %llu\n",y, (long long)ctr1->new_highwatermark.tmp_highest_usn, -- 2.47.2