merege -r 1293455:1293456 from trunk. FIXES: MAPREDUCE-3904
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1293459 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
46801fdc94
commit
785573713c
|
@ -56,6 +56,10 @@ Release 0.23.2 - UNRELEASED
|
|||
MAPREDUCE-3738. MM can hang during shutdown if AppLogAggregatorImpl thread
|
||||
dies unexpectedly (Jason Lowe via sseth)
|
||||
|
||||
MAPREDUCE-3904 Job history produced with mapreduce.cluster.acls.enabled
|
||||
false can not be viewed with mapreduce.cluster.acls.enabled true
|
||||
(Jonathon Eagles via tgraves)
|
||||
|
||||
Release 0.23.1 - 2012-02-17
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -438,6 +438,9 @@ public class JobImpl implements org.apache.hadoop.mapreduce.v2.app.job.Job,
|
|||
public boolean checkAccess(UserGroupInformation callerUGI,
|
||||
JobACL jobOperation) {
|
||||
AccessControlList jobACL = jobACLs.get(jobOperation);
|
||||
if (jobACL == null) {
|
||||
return true;
|
||||
}
|
||||
return aclsManager.checkAccess(callerUGI, jobOperation, username, jobACL);
|
||||
}
|
||||
|
||||
|
|
|
@ -191,5 +191,16 @@ public class TestJobImpl {
|
|||
null, null, null, true, null, 0, null);
|
||||
Assert.assertTrue(job4.checkAccess(ugi1, JobACL.VIEW_JOB));
|
||||
Assert.assertTrue(job4.checkAccess(ugi2, JobACL.VIEW_JOB));
|
||||
|
||||
// Setup configuration access without security enabled
|
||||
Configuration conf5 = new Configuration();
|
||||
conf5.setBoolean(MRConfig.MR_ACLS_ENABLED, true);
|
||||
conf5.set(MRJobConfig.JOB_ACL_VIEW_JOB, "");
|
||||
|
||||
// Verify access
|
||||
JobImpl job5 = new JobImpl(jobId, null, conf5, null, null, null, null, null,
|
||||
null, null, null, true, null, 0, null);
|
||||
Assert.assertTrue(job5.checkAccess(ugi1, null));
|
||||
Assert.assertTrue(job5.checkAccess(ugi2, null));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -330,6 +330,9 @@ public class CompletedJob implements org.apache.hadoop.mapreduce.v2.app.job.Job
|
|||
boolean checkAccess(UserGroupInformation callerUGI, JobACL jobOperation) {
|
||||
Map<JobACL, AccessControlList> jobACLs = jobInfo.getJobACLs();
|
||||
AccessControlList jobACL = jobACLs.get(jobOperation);
|
||||
if (jobACL == null) {
|
||||
return true;
|
||||
}
|
||||
return aclsMgr.checkAccess(callerUGI, jobOperation,
|
||||
jobInfo.getUsername(), jobACL);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue