From eda3728a4079c5399f693b1d68e64e5660647c72 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 2 Oct 2024 18:06:44 +0200 Subject: [PATCH] s3:rpc_server/netlogon: add client_sid helper variables This will make the following changes simpler... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall --- source3/rpc_server/netlogon/srv_netlog_nt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c index 4a258874d16..1c740fa4730 100644 --- a/source3/rpc_server/netlogon/srv_netlog_nt.c +++ b/source3/rpc_server/netlogon/srv_netlog_nt.c @@ -1321,6 +1321,7 @@ NTSTATUS _netr_ServerPasswordSet(struct pipes_struct *p, size_t i; struct netlogon_creds_CredentialState *creds = NULL; struct _samr_Credentials_t cr = { CRED_TYPE_NT_HASH, {0}}; + const struct dom_sid *client_sid = NULL; DEBUG(5,("_netr_ServerPasswordSet: %d\n", __LINE__)); @@ -1345,6 +1346,7 @@ NTSTATUS _netr_ServerPasswordSet(struct pipes_struct *p, TALLOC_FREE(creds); return status; } + client_sid = creds->sid; DEBUG(3,("_netr_ServerPasswordSet: Server Password Set by remote machine:[%s] on account [%s]\n", r->in.computer_name, creds->computer_name)); @@ -1363,7 +1365,7 @@ NTSTATUS _netr_ServerPasswordSet(struct pipes_struct *p, status = netr_set_machine_account_password(p->mem_ctx, session_info, p->msg_ctx, - creds->sid, + client_sid, &cr); return status; } @@ -1380,6 +1382,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p, dcesrv_call_session_info(dce_call); NTSTATUS status; struct netlogon_creds_CredentialState *creds = NULL; + const struct dom_sid *client_sid = NULL; DATA_BLOB plaintext = data_blob_null; DATA_BLOB new_password = data_blob_null; size_t confounder_len; @@ -1405,6 +1408,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p, TALLOC_FREE(creds); return status; } + client_sid = creds->sid; DBG_NOTICE("Server Password Set2 by remote " "machine:[%s] on account [%s]\n", @@ -1525,7 +1529,7 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p, status = netr_set_machine_account_password(p->mem_ctx, session_info, p->msg_ctx, - creds->sid, + client_sid, &cr); TALLOC_FREE(creds); return status; -- 2.47.3