You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 05:53:51 UTC

svn commit: r1077773 - in /hadoop/common/branches/branch-0.20-security-patches: CHANGES.txt src/mapred/org/apache/hadoop/mapred/QueueManager.java

Author: omalley
Date: Fri Mar  4 04:53:50 2011
New Revision: 1077773

URL: http://svn.apache.org/viewvc?rev=1077773&view=rev
Log:
commit f3757f3082540cf01848e6c262d5c291c4f085bb
Author: Richard King <dk...@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]

Modified:
    hadoop/common/branches/branch-0.20-security-patches/CHANGES.txt
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java

Modified: hadoop/common/branches/branch-0.20-security-patches/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/CHANGES.txt?rev=1077773&r1=1077772&r2=1077773&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security-patches/CHANGES.txt Fri Mar  4 04:53:50 2011
@@ -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

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java?rev=1077773&r1=1077772&r2=1077773&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java Fri Mar  4 04:53:50 2011
@@ -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("*");
   }