JDK-8170278 : ticket renewal won't happen with debugging turned on
  • Type: Bug
  • Component: security-libs
  • Sub-Component: org.ietf.jgss:krb5
  • Affected Version: 8u101
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-11-21
  • Updated: 2017-11-29
  • Resolved: 2016-11-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u152 b01Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux <hostname> 4.2.0-42-generic #49-Ubuntu SMP Tue Jun 28 21:26:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
From sun/security/jgss/krb5/SubjectComber.java, method findAux(), upon finding an expired ticket:

if (!ticket.isCurrent()) {
...
     ticket.destroy();
     if (DEBUG) {
       System.out.println("Removed and destroyed "
       + "the expired Ticket \n"
       + ticket);
...

The problem is that after ticket.destroy() call all methods of ticket object, including toSttring(), throw IllegalStateException, so if DEBUG == true, System.out.println() throws IllegalStateException.

For toString() throwing IllegalStateException makes no sense; we always want to print out the ticket info, expired or not.

Since there is no proper handling of IllegalStateException, the ticket does not get renewed.

Suggested fix: remove the following lines from from toString() method of javax.security.auth.kerberos.KerberosTicket class:

if (destroyed)
    throw new IllegalStateException("This ticket is no longer valid");



REPRODUCIBILITY :
This bug can be reproduced always.


Comments
KerberosTicket::toString on JDK 9 is already fixed in JDK-8043071 [1]. [1] http://hg.openjdk.java.net/jdk9/dev/jdk/rev/0b225b3c621b#l6.184
24-11-2016