s4-kdc/db_glue: pass down only a samba_kdc_entry to samba_kdc_check_s4u2proxy().
authorGünther Deschner <gd@samba.org>
Fri, 9 May 2014 12:58:08 +0000 (14:58 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 27 Mar 2015 00:26:16 +0000 (01:26 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/kdc/db-glue.c
source4/kdc/db-glue.h
source4/kdc/hdb-samba4.c
source4/kdc/mit_samba.c

index 827a9b958d4bd571be5e2cc4baa5d4d6ec311796..1b663595cba9b36e2833991c5a4fce85bb4c5f84 100644 (file)
@@ -1985,7 +1985,7 @@ samba_kdc_check_pkinit_ms_upn_match(krb5_context context,
 krb5_error_code
 samba_kdc_check_s4u2proxy(krb5_context context,
                          struct samba_kdc_db_context *kdc_db_ctx,
-                         hdb_entry_ex *entry,
+                         struct samba_kdc_entry *skdc_entry,
                          krb5_const_principal target_principal)
 {
        krb5_error_code ret;
@@ -1996,7 +1996,6 @@ samba_kdc_check_s4u2proxy(krb5_context context,
        struct ldb_val val;
        unsigned int i;
        bool found = false;
-       struct samba_kdc_entry *p = talloc_get_type(entry->ctx, struct samba_kdc_entry);
 
        TALLOC_CTX *mem_ctx = talloc_named(kdc_db_ctx, 0, "samba_kdc_check_s4u2proxy");
 
@@ -2008,7 +2007,7 @@ samba_kdc_check_s4u2proxy(krb5_context context,
                return ret;
        }
 
-       client_dn = ldb_dn_get_linearized(p->msg->dn);
+       client_dn = ldb_dn_get_linearized(skdc_entry->msg->dn);
        if (!client_dn) {
                if (errno == 0) {
                        errno = ENOMEM;
@@ -2050,7 +2049,7 @@ samba_kdc_check_s4u2proxy(krb5_context context,
                return ret;
        }
 
-       el = ldb_msg_find_element(p->msg, "msDS-AllowedToDelegateTo");
+       el = ldb_msg_find_element(skdc_entry->msg, "msDS-AllowedToDelegateTo");
        if (el == NULL) {
                goto bad_option;
        }
index 0d86e4bfdc963ab223561b018744552741e388c9..9a3052126a02bd3ef71baf15eeb3eec577b59968 100644 (file)
@@ -51,7 +51,7 @@ samba_kdc_check_pkinit_ms_upn_match(krb5_context context,
 krb5_error_code
 samba_kdc_check_s4u2proxy(krb5_context context,
                          struct samba_kdc_db_context *kdc_db_ctx,
-                         hdb_entry_ex *entry,
+                         struct samba_kdc_entry *skdc_entry,
                          krb5_const_principal target_principal);
 
 NTSTATUS samba_kdc_setup_db_ctx(TALLOC_CTX *mem_ctx, struct samba_kdc_base_context *base_ctx,
index 04b520087b92d79ca24ef21d32085194d212fcd4..77f6a9079dd77c2a158fff62bd3a8447c6036bf6 100644 (file)
@@ -128,12 +128,15 @@ hdb_samba4_check_constrained_delegation(krb5_context context, HDB *db,
                                        krb5_const_principal target_principal)
 {
        struct samba_kdc_db_context *kdc_db_ctx;
+       struct samba_kdc_entry *skdc_entry;
 
        kdc_db_ctx = talloc_get_type_abort(db->hdb_db,
                                           struct samba_kdc_db_context);
+       skdc_entry = talloc_get_type_abort(entry->ctx,
+                                          struct samba_kdc_entry);
 
        return samba_kdc_check_s4u2proxy(context, kdc_db_ctx,
-                                        entry,
+                                        skdc_entry,
                                         target_principal);
 }
 
index f56e6796d0919caa6b193d09de89ce087a654873..a51f18da0df0845667df6cb1c20687cd07f2ca3c 100644 (file)
@@ -343,7 +343,7 @@ static int mit_samba_check_s4u2proxy(struct mit_samba_context *ctx,
 
        ret = samba_kdc_check_s4u2proxy(ctx->context,
                                        ctx->db_ctx,
-                                       entry,
+                                       skdc_entry,
                                        target_principal);
 
        krb5_free_principal(ctx->context, target_principal);