]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: remove useless samba_kdc_get_user_info_dc() from samba_kdc_get_device_info_blob()
authorStefan Metzmacher <metze@samba.org>
Wed, 19 Feb 2025 12:28:56 +0000 (13:28 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 22 Feb 2025 22:06:39 +0000 (22:06 +0000)
There's no need to call it again if the caller already did.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/kdc/pac-glue.c

index cfe3d285ab2e28ee73393a87cbc3076598d19168..e58c0d290ccd8d9a8aefaabe117fdf219c2fa55e 100644 (file)
@@ -2102,14 +2102,12 @@ static krb5_error_code samba_kdc_get_device_info_pac_blob(TALLOC_CTX *mem_ctx,
 static krb5_error_code samba_kdc_get_device_info_blob(TALLOC_CTX *mem_ctx,
                                                      krb5_context context,
                                                      struct samba_kdc_db_context *kdc_db_ctx,
-                                                     const struct samba_kdc_entry_pac device,
+                                                     const struct auth_user_info_dc *device_info,
                                                      DATA_BLOB **device_info_blob)
 {
        TALLOC_CTX *frame = NULL;
        krb5_error_code code = EINVAL;
        NTSTATUS nt_status;
-
-       const struct auth_user_info_dc *device_info = NULL;
        struct netr_SamInfo3 *info3 = NULL;
        struct PAC_DOMAIN_GROUP_MEMBERSHIP *resource_groups = NULL;
 
@@ -2117,22 +2115,6 @@ static krb5_error_code samba_kdc_get_device_info_blob(TALLOC_CTX *mem_ctx,
 
        frame = talloc_stackframe();
 
-       code = samba_kdc_get_user_info_dc(frame,
-                                         context,
-                                         kdc_db_ctx,
-                                         device,
-                                         &device_info,
-                                         NULL /* resource_groups_out */);
-       if (code) {
-               const char *krb5_err = krb5_get_error_message(context, code);
-               DBG_ERR("samba_kdc_get_user_info_dc failed: %s\n",
-                       krb5_err != NULL ? krb5_err : "<unknown>");
-               krb5_free_error_message(context, krb5_err);
-
-               talloc_free(frame);
-               return KRB5KDC_ERR_TGT_REVOKED;
-       }
-
        nt_status = auth_convert_user_info_dc_saminfo3(frame, device_info,
                                                       AUTH_INCLUDE_RESOURCE_GROUPS_COMPRESSED,
                                                       &info3,
@@ -2774,7 +2756,7 @@ krb5_error_code samba_kdc_update_pac(TALLOC_CTX *mem_ctx,
                        code = samba_kdc_get_device_info_blob(tmp_ctx,
                                                              context,
                                                              kdc_db_ctx,
-                                                             device,
+                                                             device_info_dc,
                                                              &device_info_blob);
                        if (code != 0) {
                                goto done;