From: Stefan Metzmacher Date: Tue, 17 Sep 2024 03:35:01 +0000 (+0200) Subject: s3:rpc_client: allow rpccli_setup_netlogon_creds_locked() to return netlogon_pipe X-Git-Tag: tdb-1.4.13~1076 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbea955c3df91fdfcddf3742211485601dc3bdaf;p=thirdparty%2Fsamba.git s3:rpc_client: allow rpccli_setup_netlogon_creds_locked() to return netlogon_pipe Let the caller decide if it wants to keep the netlogon connection... Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 20cccf19292..1553e68c00b 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -159,6 +159,8 @@ static NTSTATUS rpccli_setup_netlogon_creds_locked( struct netlogon_creds_cli_context *creds_ctx, bool force_reauth, struct cli_credentials *cli_creds, + TALLOC_CTX *mem_ctx, + struct rpc_pipe_client **_netlogon_pipe, uint32_t *negotiate_flags) { TALLOC_CTX *frame = talloc_stackframe(); @@ -249,6 +251,10 @@ static NTSTATUS rpccli_setup_netlogon_creds_locked( remote_name)); done: + if (_netlogon_pipe != NULL) { + *_netlogon_pipe = talloc_move(mem_ctx, &netlogon_pipe); + } + if (negotiate_flags != NULL) { *negotiate_flags = creds->negotiate_flags; } @@ -278,8 +284,14 @@ NTSTATUS rpccli_setup_netlogon_creds( return status; } - status = rpccli_setup_netlogon_creds_locked( - cli, transport, creds_ctx, force_reauth, cli_creds, NULL); + status = rpccli_setup_netlogon_creds_locked(cli, + transport, + creds_ctx, + force_reauth, + cli_creds, + NULL, + NULL, + NULL); TALLOC_FREE(frame); @@ -407,9 +419,14 @@ again: goto fail; } - status = rpccli_setup_netlogon_creds_locked( - cli, transport, creds_ctx, true, trust_creds, - &negotiate_flags); + status = rpccli_setup_netlogon_creds_locked(cli, + transport, + creds_ctx, + true, + trust_creds, + NULL, + NULL, + &negotiate_flags); if (!NT_STATUS_IS_OK(status)) { DBG_DEBUG("rpccli_setup_netlogon_creds failed for %s, " "unable to setup NETLOGON credentials: %s\n",