Merged r1208926 from trunk for HADOOP-7854.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1208929 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jitendra Nath Pandey 2011-12-01 01:21:23 +00:00
parent 3610bc8c4c
commit ca3fb12d09
2 changed files with 6 additions and 3 deletions

View File

@ -54,6 +54,8 @@ Release 0.23.1 - Unreleased
HADOOP-7853. multiple javax security configurations cause conflicts.
(daryn via tucu)
HADOOP-7854. UGI getCurrentUser is not synchronized. (Daryn Sharp via jitendra)
Release 0.23.0 - 2011-11-01
INCOMPATIBLE CHANGES

View File

@ -449,7 +449,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);
if (subject == null || subject.getPrincipals(User.class).isEmpty()) {