]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Remove ‘compounded_auth’ parameter from samba_kdc_add_compounded_auth()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 9 Oct 2023 02:24:06 +0000 (15:24 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Oct 2023 23:13:32 +0000 (23:13 +0000)
It’s only ever equal to SAMBA_COMPOUNDED_AUTH_INCLUDE.

View with ‘git show -b’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/pac-glue.c
source4/kdc/pac-glue.h

index cf82f9a4f2a4d901082ded20c0a419aea1d2592b..0f34b218526206734cd83eaa68010e601bfad996 100644 (file)
@@ -824,24 +824,14 @@ NTSTATUS samba_kdc_add_claims_valid(struct auth_user_info_dc *user_info_dc)
                &user_info_dc->num_sids);
 }
 
-NTSTATUS samba_kdc_add_compounded_auth(enum samba_compounded_auth compounded_auth,
-                                      struct auth_user_info_dc *user_info_dc)
+NTSTATUS samba_kdc_add_compounded_auth(struct auth_user_info_dc *user_info_dc)
 {
-       switch (compounded_auth) {
-       case SAMBA_COMPOUNDED_AUTH_EXCLUDE:
-               return NT_STATUS_OK;
-       case SAMBA_COMPOUNDED_AUTH_INCLUDE:
-       {
-               return add_sid_to_array_attrs_unique(
-                       user_info_dc,
-                       &global_sid_Compounded_Authentication,
-                       SE_GROUP_DEFAULT_FLAGS,
-                       &user_info_dc->sids,
-                       &user_info_dc->num_sids);
-       }
-       }
-
-       return NT_STATUS_INVALID_PARAMETER;
+       return add_sid_to_array_attrs_unique(
+               user_info_dc,
+               &global_sid_Compounded_Authentication,
+               SE_GROUP_DEFAULT_FLAGS,
+               &user_info_dc->sids,
+               &user_info_dc->num_sids);
 }
 
 bool samba_kdc_entry_is_trust(const struct samba_kdc_entry *entry)
@@ -2620,8 +2610,7 @@ krb5_error_code samba_kdc_update_pac(TALLOC_CTX *mem_ctx,
                        goto done;
                }
 
-               nt_status = samba_kdc_add_compounded_auth(SAMBA_COMPOUNDED_AUTH_INCLUDE,
-                                                         user_info_dc_shallow_copy);
+               nt_status = samba_kdc_add_compounded_auth(user_info_dc_shallow_copy);
                if (!NT_STATUS_IS_OK(nt_status)) {
                        DBG_ERR("Failed to add Compounded Authentication: %s\n",
                                nt_errstr(nt_status));
index 8a280779f576d74defeafde54642f8df9f956bc1..63d93f5193bdff89e7fecdde53db154bcbe9c4b0 100644 (file)
@@ -40,11 +40,6 @@ enum samba_asserted_identity {
        SAMBA_ASSERTED_IDENTITY_AUTHENTICATION_AUTHORITY,
 };
 
-enum samba_compounded_auth {
-       SAMBA_COMPOUNDED_AUTH_EXCLUDE = 0,
-       SAMBA_COMPOUNDED_AUTH_INCLUDE,
-};
-
 enum {
        SAMBA_KDC_FLAG_PROTOCOL_TRANSITION    = 0x00000001,
        SAMBA_KDC_FLAG_CONSTRAINED_DELEGATION = 0x00000002,
@@ -197,5 +192,4 @@ NTSTATUS samba_kdc_add_asserted_identity(enum samba_asserted_identity ai,
 
 NTSTATUS samba_kdc_add_claims_valid(struct auth_user_info_dc *user_info_dc);
 
-NTSTATUS samba_kdc_add_compounded_auth(enum samba_compounded_auth compounded_auth,
-                                      struct auth_user_info_dc *user_info_dc);
+NTSTATUS samba_kdc_add_compounded_auth(struct auth_user_info_dc *user_info_dc);