1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:kdc: Add ‘msg’ parameter to samba_kdc_get_user_info_dc()

We want to call this function from more places. But some potential
callers, found in db-glue.c, have only a partially‐initialized
‘samba_kdc_entry’ structure, without the crucial ‘msg’ member. These
callers need to be able to pass in the ldb message as a separate
parameter.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-10-03 11:14:30 +13:00 committed by Andrew Bartlett
parent ce7c543ffc
commit 96ab35bb91
4 changed files with 8 additions and 1 deletions

View File

@ -486,6 +486,7 @@ krb5_error_code mit_samba_get_pac(struct mit_samba_context *smb_ctx,
nt_status = samba_kdc_get_user_info_dc(tmp_ctx,
skdc_entry,
skdc_entry->msg,
&user_info_dc);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(tmp_ctx);

View File

@ -1152,13 +1152,14 @@ NTSTATUS samba_kdc_get_claims_blob(TALLOC_CTX *mem_ctx,
NTSTATUS samba_kdc_get_user_info_dc(TALLOC_CTX *mem_ctx,
struct samba_kdc_entry *entry,
const struct ldb_message *msg,
struct auth_user_info_dc **info_out)
{
NTSTATUS nt_status;
const struct auth_user_info_dc *user_info_dc_from_db = NULL;
struct auth_user_info_dc *user_info_dc = NULL;
nt_status = samba_kdc_get_user_info_from_db(entry, entry->msg, &user_info_dc_from_db);
nt_status = samba_kdc_get_user_info_from_db(entry, msg, &user_info_dc_from_db);
if (!NT_STATUS_IS_OK(nt_status)) {
DBG_ERR("Getting user info for PAC failed: %s\n",
nt_errstr(nt_status));
@ -1257,6 +1258,7 @@ static krb5_error_code samba_kdc_obtain_user_info_dc(TALLOC_CTX *mem_ctx,
*/
nt_status = samba_kdc_get_user_info_dc(mem_ctx,
entry.entry,
entry.entry->msg,
&user_info_dc);
if (!NT_STATUS_IS_OK(nt_status)) {
DBG_ERR("samba_kdc_get_user_info_dc failed: %s\n",
@ -2065,6 +2067,7 @@ static krb5_error_code samba_kdc_get_device_info_blob(TALLOC_CTX *mem_ctx,
nt_status = samba_kdc_get_user_info_dc(frame,
device,
device->msg,
&device_info_dc);
if (!NT_STATUS_IS_OK(nt_status)) {
DBG_ERR("samba_kdc_get_user_info_dc failed: %s\n",
@ -2927,6 +2930,7 @@ krb5_error_code samba_kdc_check_device(TALLOC_CTX *mem_ctx,
} else {
nt_status = samba_kdc_get_user_info_dc(frame,
device.entry,
device.entry->msg,
&device_info);
if (!NT_STATUS_IS_OK(nt_status)) {
DBG_ERR("samba_kdc_get_user_info_dc failed: %s\n",

View File

@ -113,6 +113,7 @@ NTSTATUS samba_kdc_get_user_info_from_db(struct samba_kdc_entry *entry,
NTSTATUS samba_kdc_get_user_info_dc(TALLOC_CTX *mem_ctx,
struct samba_kdc_entry *entry,
const struct ldb_message *msg,
struct auth_user_info_dc **info_out);
krb5_error_code samba_kdc_map_policy_err(NTSTATUS nt_status);

View File

@ -125,6 +125,7 @@ static krb5_error_code samba_wdc_get_pac(void *priv,
nt_status = samba_kdc_get_user_info_dc(mem_ctx,
skdc_entry,
skdc_entry->msg,
&user_info_dc);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);