ソースを参照

Merged r1206427 from branch-0.20-security for HADOOP-7854.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-205@1206428 13f79535-47bb-0310-9956-ffa450edef68
Jitendra Nath Pandey 13 年 前
コミット
bebc8657c1

+ 2 - 0
CHANGES.txt

@@ -134,6 +134,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

+ 2 - 1
src/core/org/apache/hadoop/security/UserGroupInformation.java

@@ -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);