kuser: kinit renew_func do not update expire if no new tickets
authorJeffrey Altman <jaltman@auristor.com>
Fri, 16 Sep 2022 17:52:37 +0000 (13:52 -0400)
committerJeffrey Altman <jaltman@auristor.com>
Fri, 16 Sep 2022 19:58:45 +0000 (15:58 -0400)
If neither get_new_tickets() nor renew_validate() succeeded, do not
bother recomputing the 'expire' time as it is unchanged.

kuser/kinit.c

index 6ac4b45426a9927a45b6aff808fa53771d0ba4d1..01cb8ed1a41b59a9d3bba1496b6a3a72f41cc816 100644 (file)
@@ -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);