You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ji...@apache.org on 2011/11/26 12:08:00 UTC

svn commit: r1206427 - in /hadoop/common/branches/branch-0.20-security: CHANGES.txt src/core/org/apache/hadoop/security/UserGroupInformation.java

Author: jitendra
Date: Sat Nov 26 11:07:55 2011
New Revision: 1206427

URL: http://svn.apache.org/viewvc?rev=1206427&view=rev
Log:
HADOOP-7854. UGI getCurrentUser is not synchronized. Contributed by Daryn Sharp.

Modified:
    hadoop/common/branches/branch-0.20-security/CHANGES.txt
    hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/security/UserGroupInformation.java

Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1206427&r1=1206426&r2=1206427&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Sat Nov 26 11:07:55 2011
@@ -225,6 +225,8 @@ Release 0.20.205.1 - unreleased
 
     HDFS-2590. Fix the missing links in the WebHDFS forrest doc.  (szetszwo)
 
+    HDFS-7854. UGI getCurrentUser is not synchronized. (Daryn Sharp via jitendra)
+
 Release 0.20.205.0 - 2011.10.06
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/security/UserGroupInformation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/security/UserGroupInformation.java?rev=1206427&r1=1206426&r2=1206427&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/security/UserGroupInformation.java (original)
+++ hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/security/UserGroupInformation.java Sat Nov 26 11:07:55 2011
@@ -407,7 +407,8 @@ public class UserGroupInformation {
    * @return the current user
    * @throws IOException if login fails
    */
-  public static UserGroupInformation getCurrentUser() throws IOException {
+  public synchronized
+  static UserGroupInformation getCurrentUser() throws IOException {
     AccessControlContext context = AccessController.getContext();
     Subject subject = Subject.getSubject(context);
     return subject == null ? getLoginUser() : new UserGroupInformation(subject);