summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_netlog_nt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 4b83279897..491754f76a 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -827,6 +827,7 @@ NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
struct samu *sampass;
DATA_BLOB plaintext;
struct samr_CryptPassword password_buf;
+ struct samr_Password nt_hash;
become_root();
status = netr_creds_server_step_check(p, p->mem_ctx,
@@ -852,6 +853,8 @@ NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
return NT_STATUS_WRONG_PASSWORD;
}
+ mdfour(nt_hash.hash, plaintext.data, plaintext.length);
+
status = netr_find_machine_account(p->mem_ctx,
creds->account_name,
&sampass);
@@ -861,8 +864,8 @@ NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
status = netr_set_machine_account_password(sampass,
sampass,
- &plaintext,
NULL,
+ &nt_hash,
NULL);
TALLOC_FREE(sampass);
return status;