mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
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 <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
7a68a90ba8
commit
bbea955c3d
@ -159,6 +159,8 @@ static NTSTATUS rpccli_setup_netlogon_creds_locked(
|
|||||||
struct netlogon_creds_cli_context *creds_ctx,
|
struct netlogon_creds_cli_context *creds_ctx,
|
||||||
bool force_reauth,
|
bool force_reauth,
|
||||||
struct cli_credentials *cli_creds,
|
struct cli_credentials *cli_creds,
|
||||||
|
TALLOC_CTX *mem_ctx,
|
||||||
|
struct rpc_pipe_client **_netlogon_pipe,
|
||||||
uint32_t *negotiate_flags)
|
uint32_t *negotiate_flags)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *frame = talloc_stackframe();
|
TALLOC_CTX *frame = talloc_stackframe();
|
||||||
@ -249,6 +251,10 @@ static NTSTATUS rpccli_setup_netlogon_creds_locked(
|
|||||||
remote_name));
|
remote_name));
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (_netlogon_pipe != NULL) {
|
||||||
|
*_netlogon_pipe = talloc_move(mem_ctx, &netlogon_pipe);
|
||||||
|
}
|
||||||
|
|
||||||
if (negotiate_flags != NULL) {
|
if (negotiate_flags != NULL) {
|
||||||
*negotiate_flags = creds->negotiate_flags;
|
*negotiate_flags = creds->negotiate_flags;
|
||||||
}
|
}
|
||||||
@ -278,8 +284,14 @@ NTSTATUS rpccli_setup_netlogon_creds(
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = rpccli_setup_netlogon_creds_locked(
|
status = rpccli_setup_netlogon_creds_locked(cli,
|
||||||
cli, transport, creds_ctx, force_reauth, cli_creds, NULL);
|
transport,
|
||||||
|
creds_ctx,
|
||||||
|
force_reauth,
|
||||||
|
cli_creds,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
|
|
||||||
@ -407,9 +419,14 @@ again:
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = rpccli_setup_netlogon_creds_locked(
|
status = rpccli_setup_netlogon_creds_locked(cli,
|
||||||
cli, transport, creds_ctx, true, trust_creds,
|
transport,
|
||||||
&negotiate_flags);
|
creds_ctx,
|
||||||
|
true,
|
||||||
|
trust_creds,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&negotiate_flags);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DBG_DEBUG("rpccli_setup_netlogon_creds failed for %s, "
|
DBG_DEBUG("rpccli_setup_netlogon_creds failed for %s, "
|
||||||
"unable to setup NETLOGON credentials: %s\n",
|
"unable to setup NETLOGON credentials: %s\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user