Preserve outer error

This commit is contained in:
Love Hornquist Astrand
2011-05-08 14:15:37 -07:00
committed by Love Hörnquist Åstrand
parent 4561012998
commit 04983dfd94

View File

@@ -1178,6 +1178,7 @@ _kdc_as_rep(krb5_context context,
kdc_log(context, config, 5, kdc_log(context, config, 5,
"armor key does not have secrets at this KDC, " "armor key does not have secrets at this KDC, "
"need to proxy"); "need to proxy");
ret = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;
goto out; goto out;
} if(ret){ } if(ret){
free_AP_REQ(&ap_req); free_AP_REQ(&ap_req);
@@ -1824,12 +1825,10 @@ _kdc_as_rep(krb5_context context,
/* /*
* Announce FX-FAST * Announce FX-FAST
*/ */
ret = realloc_method_data(&error_method); ret = krb5_padata_add(context, &error_method,
KRB5_PADATA_FX_FAST, NULL, 0);
if (ret) if (ret)
goto out; goto out;
pa = &error_method.val[error_method.len-1];
pa->padata_type = KRB5_PADATA_FX_FAST;
pa->padata_value.length = 0;
/* /*
* If there is a client key, send ETYPE_INFO{,2} * If there is a client key, send ETYPE_INFO{,2}
@@ -2255,6 +2254,7 @@ out:
free_AS_REP(&rep); free_AS_REP(&rep);
if(ret != 0 && ret != HDB_ERR_NOT_FOUND_HERE){ if(ret != 0 && ret != HDB_ERR_NOT_FOUND_HERE){
krb5_error_code outer_error = ret;
krb5_data e_data; krb5_data e_data;
krb5_principal error_client = client_princ; krb5_principal error_client = client_princ;
krb5_principal error_server = server_princ; krb5_principal error_server = server_princ;
@@ -2272,7 +2272,7 @@ out:
/* first add the KRB-ERROR to the fast errors */ /* first add the KRB-ERROR to the fast errors */
ret = krb5_mk_error(context, ret = krb5_mk_error(context,
ret, outer_error,
e_text, e_text,
NULL, NULL,
error_client, error_client,
@@ -2281,7 +2281,7 @@ out:
NULL, NULL,
&e_data); &e_data);
if (ret) if (ret)
goto out2; goto out;
ret = krb5_padata_add(context, &error_method, ret = krb5_padata_add(context, &error_method,
KRB5_PADATA_FX_ERROR, KRB5_PADATA_FX_ERROR,
@@ -2333,7 +2333,7 @@ out:
} }
ret = krb5_mk_error(context, ret = krb5_mk_error(context,
ret, outer_error,
e_text, e_text,
(e_data.length ? &e_data : NULL), (e_data.length ? &e_data : NULL),
error_client, error_client,