diff options
author | Günther Deschner <gd@samba.org> | 2021-11-18 11:52:18 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2021-12-02 13:59:31 +0000 |
commit | 6bf3a39b11832ad2feb655e29da84f8b5aac298e (patch) | |
tree | 2cbf4d672b2249fec9a51afda9eadf9697dd15f2 /source3/libnet | |
parent | 62aa769667464451cda672fc073e52a8e52ae4c1 (diff) | |
download | samba-6bf3a39b11832ad2feb655e29da84f8b5aac298e.tar.gz |
s3:rpc_client: Pass remote name and socket to cli_rpc_pipe_open_schannel_with_creds()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_join.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 025190cb860..02705f1c70c 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -1297,11 +1297,18 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx, TALLOC_FREE(creds); if (netlogon_flags & NETLOGON_NEG_AUTHENTICATED_RPC) { - status = cli_rpc_pipe_open_schannel_with_creds(cli, - &ndr_table_netlogon, - NCACN_NP, - netlogon_creds, - &passwordset_pipe); + const char *remote_name = smbXcli_conn_remote_name(cli->conn); + const struct sockaddr_storage *remote_sockaddr = + smbXcli_conn_remote_sockaddr(cli->conn); + + status = cli_rpc_pipe_open_schannel_with_creds( + cli, + &ndr_table_netlogon, + NCACN_NP, + netlogon_creds, + remote_name, + remote_sockaddr, + &passwordset_pipe); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(frame); return status; @@ -1700,6 +1707,8 @@ NTSTATUS libnet_join_ok(struct messaging_context *msg_ctx, uint32_t netlogon_flags = 0; NTSTATUS status; int flags = CLI_FULL_CONNECTION_IPC; + const char *remote_name = NULL; + const struct sockaddr_storage *remote_sockaddr = NULL; if (!dc_name) { TALLOC_FREE(frame); @@ -1800,9 +1809,15 @@ NTSTATUS libnet_join_ok(struct messaging_context *msg_ctx, return NT_STATUS_OK; } + remote_name = smbXcli_conn_remote_name(cli->conn); + remote_sockaddr = smbXcli_conn_remote_sockaddr(cli->conn); + status = cli_rpc_pipe_open_schannel_with_creds( cli, &ndr_table_netlogon, NCACN_NP, - netlogon_creds, &netlogon_pipe); + netlogon_creds, + remote_name, + remote_sockaddr, + &netlogon_pipe); TALLOC_FREE(netlogon_pipe); @@ -1810,7 +1825,7 @@ NTSTATUS libnet_join_ok(struct messaging_context *msg_ctx, DEBUG(0,("libnet_join_ok: failed to open schannel session " "on netlogon pipe to server %s for domain %s. " "Error was %s\n", - smbXcli_conn_remote_name(cli->conn), + remote_name, netbios_domain_name, nt_errstr(status))); cli_shutdown(cli); TALLOC_FREE(frame); |