HADOOP-15143. NPE due to Invalid KerberosTicket in UGI. Contributed by Mukul Kumar Singh.

(cherry picked from commit cb60c05c3a)
This commit is contained in:
Jitendra Pandey 2018-01-01 21:51:48 -08:00 committed by Wei-Chiu Chuang
parent 6e11ef7c44
commit dd1de1ea37
1 changed files with 4 additions and 1 deletions

View File

@ -1174,7 +1174,10 @@ public class UserGroupInformation {
Object cred = iter.next();
if (cred instanceof KerberosTicket) {
KerberosTicket ticket = (KerberosTicket) cred;
if (!ticket.getServer().getName().startsWith("krbtgt")) {
if (ticket.isDestroyed() || ticket.getServer() == null) {
LOG.warn("Ticket is already destroyed, remove it.");
iter.remove();
} else if (!ticket.getServer().getName().startsWith("krbtgt")) {
LOG.warn(
"The first kerberos ticket is not TGT"
+ "(the server principal is {}), remove and destroy it.",