hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: HADOOP-14659. UGI getShortUserName does not need to search the Subject. Contributed by Daryn Sharp.
Date Thu, 20 Jul 2017 21:22:27 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 6e45c543c -> 5d58ba0e3


HADOOP-14659. UGI getShortUserName does not need to search the Subject. Contributed by Daryn
Sharp.

(cherry picked from commit b3269f7cc119cbc51b16118b918f345f970804bc)


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

Branch: refs/heads/branch-2.8
Commit: 5d58ba0e3debba928496c027b1349d0fcf1cfd07
Parents: 6e45c54
Author: Kihwal Lee <kihwal@apache.org>
Authored: Thu Jul 20 16:22:11 2017 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Thu Jul 20 16:22:11 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/hadoop/security/UserGroupInformation.java   | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5d58ba0e/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 8d10d5a..5b28ba3 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
@@ -1552,10 +1552,7 @@ public class UserGroupInformation {
    * @return the user's name up to the first '/' or '@'.
    */
   public String getShortUserName() {
-    for (User p: subject.getPrincipals(User.class)) {
-      return p.getShortName();
-    }
-    return null;
+    return user.getShortName();
   }
 
   public String getPrimaryGroupName() throws IOException {


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


Mime
View raw message