From b7323a8b85ed3aeb3dac2688431fa3f18ac92651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 7 Feb 2009 15:11:36 +0000 Subject: [PATCH] (process_last_request): Process the lr.func even if we have no prompter. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24643 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/init_creds_pw.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/krb5/init_creds_pw.c b/lib/krb5/init_creds_pw.c index 763f23c06..b046ec04d 100644 --- a/lib/krb5/init_creds_pw.c +++ b/lib/krb5/init_creds_pw.c @@ -231,8 +231,9 @@ process_last_request(krb5_context context, time_t t; size_t i; - if (ctx->prompter == NULL) - return 0; + /* + * First check if there is a API consumer. + */ realm = krb5_principal_get_realm (context, ctx->cred.client); lr = &ctx->enc_part.last_req; @@ -241,7 +242,7 @@ process_last_request(krb5_context context, krb5_last_req_entry **lre; lre = calloc(lr->len + 1, sizeof(**lre)); - if (lre) { + if (lre == NULL) { krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", "")); return ENOMEM; @@ -262,6 +263,13 @@ process_last_request(krb5_context context, free(lre); } + /* + * Now check if we should prompt the user + */ + + if (ctx->prompter == NULL) + return 0; + krb5_timeofday (context, &sec); t = sec + get_config_time (context,