From: Stefan Metzmacher Date: Sat, 14 Sep 2024 13:57:03 +0000 (+0200) Subject: s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key() X-Git-Tag: tdb-1.4.13~1118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f75189dee9db486d393cd17c25f5a84ce2d0b889;p=thirdparty%2Fsamba.git 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 --- 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,