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

s4-kdc/db_glue: pass down only a samba_kdc_entry to samba_kdc_check_s4u2proxy().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Günther Deschner 2014-05-09 14:58:08 +02:00
parent f4b087b483
commit ba1838300c
4 changed files with 9 additions and 7 deletions

View 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;
}

View 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,

View 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);
}

View 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);