From de7b452dcb06f0841e057759b5ad1b16038389dd Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 16 Sep 2022 13:52:37 -0400 Subject: [PATCH] kuser: kinit renew_func do not update expire if no new tickets If neither get_new_tickets() nor renew_validate() succeeded, do not bother recomputing the 'expire' time as it is unchanged. --- kuser/kinit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kuser/kinit.c b/kuser/kinit.c index 6ac4b4542..01cb8ed1a 100644 --- a/kuser/kinit.c +++ b/kuser/kinit.c @@ -1321,13 +1321,15 @@ renew_func(void *ptr) ret = get_new_tickets(ctx->context, ctx->principal, ctx->ccache, ctx->ticket_life, 0, ctx->anonymous_pkinit); } - expire = ticket_lifetime(ctx->context, ctx->ccache, ctx->principal, - server_str, &renew_expire); + if (ret == 0) { + expire = ticket_lifetime(ctx->context, ctx->ccache, ctx->principal, + server_str, &renew_expire); #ifndef NO_AFS - if (ret == 0 && server_str == NULL && do_afslog && k_hasafs()) - krb5_afslog(ctx->context, ctx->ccache, NULL, NULL); + if (server_str == NULL && do_afslog && k_hasafs()) + krb5_afslog(ctx->context, ctx->ccache, NULL, NULL); #endif + } update_siginfo_msg(expire, server_str);