diff options
author | Volker Lendecke <vl@samba.org> | 2017-09-06 14:12:27 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-09-16 08:36:17 +0200 |
commit | a6ad0da292912d3b970914cb965b0cd890aa56c7 (patch) | |
tree | b5581f0ad274f1e8a7b220fc3f33f53add1685e0 /source3/libnet | |
parent | 9dd0b7fb2c1447a1d2ff5040fad993c09f63f3a4 (diff) | |
download | samba-a6ad0da292912d3b970914cb965b0cd890aa56c7.tar.gz |
libnet: Use rpccli_create_netlogon_creds_with_creds in join_unsecure
rpccli_create_netlogon_creds_with_creds just extracts the values we set here
from cli_credentials, and the lower-level interface is supposed to go away.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_join.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 36b9addcf4f..f3fd48c9cd8 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -1122,6 +1122,7 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx, { TALLOC_CTX *frame = talloc_stackframe(); struct rpc_pipe_client *netlogon_pipe = NULL; + struct cli_credentials *cli_creds; struct netlogon_creds_cli_context *netlogon_creds = NULL; struct samr_Password current_nt_hash; size_t len = 0; @@ -1151,14 +1152,23 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx, /* according to WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED */ E_md4hash(r->in.admin_password, current_nt_hash.hash); - status = rpccli_create_netlogon_creds(netlogon_pipe->desthost, - r->in.domain_name, - "", /* Never unsecure in AD */ - r->out.account_name, - r->in.secure_channel_type, - r->in.msg_ctx, - frame, - &netlogon_creds); + cli_creds = cli_credentials_init(talloc_tos()); + if (cli_creds == NULL) { + TALLOC_FREE(frame); + return NT_STATUS_NO_MEMORY; + } + + cli_credentials_set_username(cli_creds, r->out.account_name, + CRED_SPECIFIED); + cli_credentials_set_domain(cli_creds, r->in.domain_name, + CRED_SPECIFIED); + cli_credentials_set_realm(cli_creds, "", CRED_SPECIFIED); + cli_credentials_set_secure_channel_type(cli_creds, + r->in.secure_channel_type); + + status = rpccli_create_netlogon_creds_with_creds( + cli_creds, netlogon_pipe->desthost, r->in.msg_ctx, + frame, &netlogon_creds); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(frame); return status; |