Repository: hadoop
Updated Branches:
  refs/heads/trunk e6de10d0a -> fea16a440


HADOOP-15294. TestUGILoginFromKeytab fails on Java9

Signed-off-by: Akira Ajisaka <aajis...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fea16a44
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fea16a44
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fea16a44

Branch: refs/heads/trunk
Commit: fea16a440d195f1b4e03a62c9249e3518cea23b5
Parents: e6de10d
Author: Takanobu Asanuma <tasan...@yahoo-corp.jp>
Authored: Wed Mar 14 13:38:07 2018 +0900
Committer: Akira Ajisaka <aajis...@apache.org>
Committed: Wed Mar 14 13:38:07 2018 +0900

----------------------------------------------------------------------
 .../java/org/apache/hadoop/security/UserGroupInformation.java   | 5 ++++-
 .../src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java    | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/fea16a44/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
----------------------------------------------------------------------
diff --git 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
index 003a51c..d0522a0 100644
--- 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
+++ 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
@@ -1885,7 +1885,10 @@ public class UserGroupInformation {
     @Override
     public void logout() throws LoginException {
       synchronized(getSubjectLock()) {
-        super.logout();
+        if (this.getSubject() != null
+            && !this.getSubject().getPrivateCredentials().isEmpty()) {
+          super.logout();
+        }
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fea16a44/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
----------------------------------------------------------------------
diff --git 
a/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
 
b/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
index 204f656..74130cf 100644
--- 
a/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
+++ 
b/hadoop-common-project/hadoop-minikdc/src/test/java/org/apache/hadoop/minikdc/TestMiniKdc.java
@@ -166,7 +166,7 @@ public class TestMiniKdc extends KerberosSecurityTestcase {
 
     } finally {
       if (loginContext != null && loginContext.getSubject() != null
-          && !loginContext.getSubject().getPrincipals().isEmpty()) {
+          && !loginContext.getSubject().getPrivateCredentials().isEmpty()) {
         loginContext.logout();
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to