s4-kdc: pass down only a samba_kdc_entry to samba_krbtgt_is_in_db().
[mat/samba.git] / source4 / kdc / wdc-samba4.c
index 9bd0422c7f26f1603bad232edac5733585002acd..b8929e6047ac7084a1aef8e3bea49c2bc6617090 100644 (file)
@@ -68,6 +68,9 @@ static krb5_error_code samba_wdc_reget_pac(void *priv, krb5_context context,
        struct samba_kdc_entry *p =
                talloc_get_type_abort(server->ctx,
                struct samba_kdc_entry);
+       struct samba_kdc_entry *krbtgt_skdc_entry =
+               talloc_get_type_abort(krbtgt->ctx,
+               struct samba_kdc_entry);
        TALLOC_CTX *mem_ctx = talloc_named(p, 0, "samba_kdc_reget_pac context");
        DATA_BLOB *pac_blob;
        DATA_BLOB *deleg_blob = NULL;
@@ -90,7 +93,7 @@ static krb5_error_code samba_wdc_reget_pac(void *priv, krb5_context context,
        /* If the krbtgt was generated by an RODC, and we are not that
         * RODC, then we need to regenerate the PAC - we can't trust
         * it */
-       ret = samba_krbtgt_is_in_db(krbtgt, &is_in_db, &is_untrusted);
+       ret = samba_krbtgt_is_in_db(krbtgt_skdc_entry, &is_in_db, &is_untrusted);
        if (ret != 0) {
                talloc_free(mem_ctx);
                return ret;