Browse Source

commit f3757f3082540cf01848e6c262d5c291c4f085bb
Author: Richard King <dking@yahoo-inc.com>
Date: Sat Jan 15 02:11:42 2011 +0000

. When a queue is built without any access rights we explain the
problem. (dking, rvw ramach) [attachment of 2010-11-24]


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077773 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 năm trước cách đây
mục cha
commit
c269974eae
2 tập tin đã thay đổi với 20 bổ sung2 xóa
  1. 7 0
      CHANGES.txt
  2. 13 2
      src/mapred/org/apache/hadoop/mapred/QueueManager.java

+ 7 - 0
CHANGES.txt

@@ -1,5 +1,12 @@
 Hadoop Change Log
 
+Release 0.20.203
+
+  BUG FIXES
+
+    BZ4101537 .  When a queue is built without any access rights we explain the
+    problem.  (dking, rvw ramach)  [attachment of 2010-11-24]
+
 Release 0.20.3 - Unreleased
 
   IMPROVEMENTS

+ 13 - 2
src/mapred/org/apache/hadoop/mapred/QueueManager.java

@@ -113,6 +113,10 @@ class QueueManager {
     String[] queueNameValues = conf.getStrings("mapred.queue.names",
         new String[]{JobConf.DEFAULT_QUEUE_NAME});
     for (String name : queueNameValues) {
+      Map queueACLs = getQueueAcls(name, conf);
+      if (queueACLs == null) {
+        LOG.error("The queue, " + name + " does not have a configured ACL list");
+      }
       queues.put(name, new Queue(name, getQueueAcls(name, conf),
           getQueueState(name, conf)));
     }
@@ -376,8 +380,15 @@ class QueueManager {
   synchronized AccessControlList getQueueACL(String queueName, QueueACL qACL) {
     if (aclsEnabled) {
       Queue q = queues.get(queueName);
-      assert q != null;
-      return q.getAcls().get(toFullPropertyName(queueName, qACL.getAclName()));
+      assert q != null : "There is no queue named " + queueName;
+      Map<String, AccessControlList> acls = q.getAcls();
+      assert acls != null
+        : ( "The queue named "
+            + queueName
+            + " does not have any access control lists.  "
+            + "An error log message should have shown up "
+            + "in the cluster initialization logs.");
+      return acls.get(toFullPropertyName(queueName, qACL.getAclName()));
     }
     return new AccessControlList("*");
   }