Commit 43faf008 authored by Jitendra Pandey's avatar Jitendra Pandey Committed by Wei-Chiu Chuang
Browse files

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

(cherry picked from commit cb60c05c)
(cherry picked from commit dd1de1ea)

Conflicts:
	hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
(cherry picked from commit 7ca1d96b)

Conflicts:
	hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
(cherry picked from commit 995e0590)
No related merge requests found
Showing with 8 additions and 4 deletions
+8 -4
......@@ -1030,10 +1030,14 @@ public class UserGroupInformation {
Object cred = iter.next();
if (cred instanceof KerberosTicket) {
KerberosTicket ticket = (KerberosTicket) cred;
if (!ticket.getServer().getName().startsWith("krbtgt")) {
LOG.warn("The first kerberos ticket is not TGT(the server" +
" principal is " + ticket.getServer() + "), remove" +
" and destroy it.");
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 " + ticket.getServer() +
")), remove and destroy it.");
iter.remove();
try {
ticket.destroy();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment