hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077546 - in /hadoop/common/branches/branch-0.20-security-patches/src/test/system: conf/system-test.xml java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
Date Fri, 04 Mar 2011 04:27:44 GMT
Author: omalley
Date: Fri Mar  4 04:27:43 2011
New Revision: 1077546

URL: http://svn.apache.org/viewvc?rev=1077546&view=rev
Log:
commit 786531ea15ca5527b74524de98d8c9327c2ba683
Author: Vinay Kumar Thota <vinayt@yahoo-inc.com>
Date:   Thu Jul 15 04:27:05 2010 +0000

    HADOOP:6839 from https://issues.apache.org/jira/secure/attachment/12449534/6839-ydist-security.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/test/system/conf/system-test.xml
    hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/system/conf/system-test.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/system/conf/system-test.xml?rev=1077546&r1=1077545&r2=1077546&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/system/conf/system-test.xml
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/system/conf/system-test.xml
Fri Mar  4 04:27:43 2011
@@ -109,6 +109,13 @@ neutral at the forward-port stage -->
   </description>
 </property>
 <property>
+  <name>test.system.hdrc.multi-user.list.path</name>
+  <value>$(YINST_ROOT)/conf/hadoop/proxyusers</value>
+  <description>
+  Multi user list for creating the proxy users.
+  </description>
+</property>
+<property>
   <name>test.system.hdrc.multi-user.binary.path</name>
   <value>$(YINST_ROOT)/conf/hadoop/runAs</value>
   <description>

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java?rev=1077546&r1=1077545&r2=1077546&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
Fri Mar  4 04:27:43 2011
@@ -21,6 +21,8 @@ package org.apache.hadoop.test.system;
 import java.io.IOException;
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.FileInputStream;
+import java.io.DataInputStream;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -48,6 +50,8 @@ public abstract class AbstractDaemonClus
   private String newConfDir = null;  
   private static final  String CONF_HADOOP_LOCAL_DIR =
       "test.system.hdrc.hadoop.local.confdir"; 
+  private static final  String CONF_HADOOP_MULTI_USER_LIST =
+      "test.system.hdrc.multi-user.list.path";
   private final static Object waitLock = new Object();
   
   /**
@@ -296,6 +300,30 @@ public abstract class AbstractDaemonClus
       }
     }
   }
+
+  /**
+   * Get the multi users list.
+   * @return ArrayList - users list as a array list.
+   * @throws IOException - if an I/O error occurs.
+   */
+  public ArrayList<String> getHadoopMultiUsersList() throws
+     IOException {
+    String hadoopUserListPath = conf.get(CONF_HADOOP_MULTI_USER_LIST);
+    if (hadoopUserListPath == null || hadoopUserListPath.isEmpty()) {
+      LOG.error("Proxy user list path has not been passed for "
+          + CONF_HADOOP_MULTI_USER_LIST);
+      throw new IllegalArgumentException(
+          "Proxy user list hasn't been provided.");
+    }
+    File fileObj = new File(hadoopUserListPath);
+    DataInputStream disObj = new DataInputStream(new FileInputStream(fileObj));
+    ArrayList<String> usersList = new ArrayList<String>();
+    String strLine = null;
+    while((strLine = disObj.readLine()) != null){
+      usersList.add(strLine.substring(0,strLine.indexOf(',')));
+    }
+    return usersList;
+  }
   
   /**
    * It's a local folder where the config file stores temporarily



Mime
View raw message