summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/netlogon/srv_netlog_nt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c
index b817545937..26b92c8618 100644
--- a/source3/rpc_server/netlogon/srv_netlog_nt.c
+++ b/source3/rpc_server/netlogon/srv_netlog_nt.c
@@ -1287,7 +1287,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p,
struct netr_ServerPasswordSet2 *r)
{
NTSTATUS status;
- struct netlogon_creds_CredentialState *creds;
+ struct netlogon_creds_CredentialState *creds = NULL;
DATA_BLOB plaintext;
struct samr_CryptPassword password_buf;
struct samr_Password nt_hash;
@@ -1301,9 +1301,14 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p,
unbecome_root();
if (!NT_STATUS_IS_OK(status)) {
+ const char *computer_name = "<unknown>";
+
+ if (creds && creds->computer_name) {
+ computer_name = creds->computer_name;
+ }
DEBUG(2,("_netr_ServerPasswordSet2: netlogon_creds_server_step "
"failed. Rejecting auth request from client %s machine account %s\n",
- r->in.computer_name, creds->computer_name));
+ r->in.computer_name, computer_name));
TALLOC_FREE(creds);
return status;
}
@@ -1313,6 +1318,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p,
netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
if (!extract_pw_from_buffer(p->mem_ctx, password_buf.data, &plaintext)) {
+ TALLOC_FREE(creds);
return NT_STATUS_WRONG_PASSWORD;
}
@@ -1323,6 +1329,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p,
p->msg_ctx,
creds->account_name,
&nt_hash);
+ TALLOC_FREE(creds);
return status;
}