1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Use rpccli_netr_ServerPasswordSet in "just_change_the_password()".

Guenther
(This used to be commit 33f91c8944)
This commit is contained in:
Günther Deschner 2008-02-16 16:04:01 +01:00
parent b6285fc052
commit dd65a34935

View File

@ -58,7 +58,32 @@ static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX
}
}
result = rpccli_net_srv_pwset(cli, mem_ctx, global_myname(), new_trust_passwd_hash);
{
struct netr_Authenticator clnt_creds, srv_cred;
struct samr_Password new_password;
netlogon_creds_client_step(cli->dc, &clnt_creds);
cred_hash3(new_password.hash,
new_trust_passwd_hash,
cli->dc->sess_key, 1);
result = rpccli_netr_ServerPasswordSet(cli, mem_ctx,
cli->dc->remote_machine,
cli->dc->mach_acct,
sec_channel_type,
global_myname(),
&clnt_creds,
&srv_cred,
&new_password);
/* Always check returned credentials. */
if (!netlogon_creds_client_check(cli->dc, &srv_cred.cred)) {
DEBUG(0,("rpccli_netr_ServerPasswordSet: "
"credentials chain check failed\n"));
return NT_STATUS_ACCESS_DENIED;
}
}
if (!NT_STATUS_IS_OK(result)) {
DEBUG(0,("just_change_the_password: unable to change password (%s)!\n",