Pārlūkot izejas kodu

merge -r 1292830:1292831 from trunk to branch-0.23. FIXES: MAPREDUCE-3878

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1292834 13f79535-47bb-0310-9956-ffa450edef68
Thomas Graves 13 gadi atpakaļ
vecāks
revīzija
1714f8b6c7

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -42,6 +42,9 @@ Release 0.23.2 - UNRELEASED
     to the maven build. (Ravi Prakash via vinodkv)
 
     MAPREDUCE-3884. PWD should be first in the classpath of MR tasks (tucu)
+
+    MAPREDUCE-3878. Null user on filtered jobhistory job page (Jonathon Eagles
+    via tgraves)
  
 Release 0.23.1 - 2012-02-17 
 

+ 9 - 3
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java

@@ -343,9 +343,15 @@ public class AppController extends Controller implements AMParams {
    * @return True if the requesting user has permission to view the job
    */
   boolean checkAccess(Job job) {
-    UserGroupInformation callerUgi = UserGroupInformation.createRemoteUser(
-        request().getRemoteUser());
-    return job.checkAccess(callerUgi, JobACL.VIEW_JOB);
+    String remoteUser = request().getRemoteUser();
+    UserGroupInformation callerUGI = null;
+    if (remoteUser != null) {
+      callerUGI = UserGroupInformation.createRemoteUser(remoteUser);
+    }
+    if (callerUGI != null && !job.checkAccess(callerUGI, JobACL.VIEW_JOB)) {
+      return false;
+    }
+    return true;
   }
 
   /**