From a65edfb82de3f301e674e44aef413c0479ec37a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 22 Jun 2006 02:40:25 +0000 Subject: [PATCH] Save KRB-ERROR on error. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17672 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/init_creds_pw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/krb5/init_creds_pw.c b/lib/krb5/init_creds_pw.c index 360a8d668..81795d719 100644 --- a/lib/krb5/init_creds_pw.c +++ b/lib/krb5/init_creds_pw.c @@ -274,6 +274,8 @@ get_init_creds_common(krb5_context context, if (options == NULL) { krb5_get_init_creds_opt_init (&default_opt); options = &default_opt; + } else { + _krb5_get_init_creds_opt_free_krb5_error(options); } if (options->opt_private) { @@ -1175,7 +1177,7 @@ process_pa_data_to_key(krb5_context context, static krb5_error_code init_cred_loop(krb5_context context, - const krb5_get_init_creds_opt *init_cred_opts, + krb5_get_init_creds_opt *init_cred_opts, const krb5_prompter_fct prompter, void *prompter_data, krb5_get_init_creds_ctx *ctx, @@ -1343,8 +1345,12 @@ out: if (ret == 0 && ret_as_reply) *ret_as_reply = rep; - else + else { + _krb5_get_init_creds_opt_set_krb5_error(context, + init_cred_opts, + &rep.error); krb5_free_kdc_rep (context, &rep); + } return ret; }