From 9fcace5818a43770c2f30710fb32e0db8dd599c3 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 12 Oct 2023 13:40:21 +1300 Subject: [PATCH] =?UTF-8?q?s4:kdc:=20Make=20=E2=80=98struct=20user=5Finfo?= =?UTF-8?q?=5Fdc=E2=80=99=20members=20const?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/kdc/pac-glue.c | 5 ++++- source4/kdc/samba_kdc.h | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index 124f2e35003..25d1126f5c4 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -1133,6 +1133,7 @@ krb5_error_code samba_kdc_get_user_info_from_db(TALLOC_CTX *mem_ctx, *info_out = NULL; if (entry->info_from_db == NULL) { + struct auth_user_info_dc *info_from_db = NULL; struct loadparm_context *lp_ctx = entry->kdc_db_ctx->lp_ctx; nt_status = authsam_make_user_info_dc(entry, @@ -1144,13 +1145,15 @@ krb5_error_code samba_kdc_get_user_info_from_db(TALLOC_CTX *mem_ctx, msg, data_blob_null, data_blob_null, - &entry->info_from_db); + &info_from_db); if (!NT_STATUS_IS_OK(nt_status)) { DBG_ERR("Getting user info for PAC failed: %s\n", nt_errstr(nt_status)); /* NT_STATUS_OBJECT_NAME_NOT_FOUND is mapped to ENOENT. */ return map_errno_from_nt_status(nt_status); } + + entry->info_from_db = info_from_db; } *info_out = entry->info_from_db; diff --git a/source4/kdc/samba_kdc.h b/source4/kdc/samba_kdc.h index 70feae38f47..d1100f657a4 100644 --- a/source4/kdc/samba_kdc.h +++ b/source4/kdc/samba_kdc.h @@ -62,9 +62,9 @@ struct samba_kdc_entry { struct ldb_dn *realm_dn; struct claims_data *claims_from_pac; struct claims_data *claims_from_db; - struct auth_user_info_dc *info_from_pac; - struct PAC_DOMAIN_GROUP_MEMBERSHIP *resource_groups_from_pac; - struct auth_user_info_dc *info_from_db; + const struct auth_user_info_dc *info_from_pac; + const struct PAC_DOMAIN_GROUP_MEMBERSHIP *resource_groups_from_pac; + const struct auth_user_info_dc *info_from_db; const struct authn_kerberos_client_policy *client_policy; const struct authn_server_policy *server_policy; uint32_t supported_enctypes;