From: Stefan Metzmacher Date: Thu, 19 Sep 2024 05:41:09 +0000 (+0200) Subject: s3:rpc_client: let cli_rpc_pipe_open_schannel() use rpccli_connect_netlogon() for... X-Git-Tag: tdb-1.4.13~1072 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=677a6125bc2ced693b4969f859e922c3740447e5;p=thirdparty%2Fsamba.git s3:rpc_client: let cli_rpc_pipe_open_schannel() use rpccli_connect_netlogon() for netlogon This way we could reuse the connection already created... Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/source3/rpc_client/cli_pipe_schannel.c b/source3/rpc_client/cli_pipe_schannel.c index c33fc5baa17..abfdd8d5b5a 100644 --- a/source3/rpc_client/cli_pipe_schannel.c +++ b/source3/rpc_client/cli_pipe_schannel.c @@ -73,6 +73,22 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, return status; } + if (table == &ndr_table_netlogon) { + status = rpccli_connect_netlogon(cli, + transport, + remote_name, + remote_sockaddr, + netlogon_creds, + false, /* force_reauth */ + cli_creds, + &result); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(frame); + return status; + } + goto done; + } + status = rpccli_setup_netlogon_creds(cli, transport, netlogon_creds, false, /* force_reauth */ @@ -110,6 +126,7 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, } } +done: *presult = result; if (pcreds != NULL) { *pcreds = talloc_move(mem_ctx, &netlogon_creds);