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:26:57 UTC
svn commit: r1077539 - in
/hadoop/common/branches/branch-0.20-security-patches/src:
contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/
hdfs/org/apache/hadoop/hdfs/server/namenode/ webapps/datanode/
Author: omalley
Date: Fri Mar 4 04:26:57 2011
New Revision: 1077539
URL: http://svn.apache.org/viewvc?rev=1077539&view=rev
Log:
commit eb57e52aebba2ff76a93f8c2059306b1f3106c8a
Author: Tsz Wo Wo Sze <ts...@ucdev29.inktomisearch.com>
Date: Wed Jul 14 00:14:38 2010 +0000
HDFS-1109 from https://issues.apache.org/jira/secure/attachment/12449294/HDFS-1109.2_y0.20.1xx.patch
+++ b/YAHOO-CHANGES.txt
+ HDFS-1109. HFTP supports filenames that contains the character "+".
+ (Dmytro Molkov via dhruba, backported by szetszwo)
+
Modified:
hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileForward.java
hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/StreamFile.java
hadoop/common/branches/branch-0.20-security-patches/src/webapps/datanode/browseBlock.jsp
Modified: hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java?rev=1077539&r1=1077538&r2=1077539&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java Fri Mar 4 04:26:57 2011
@@ -50,8 +50,8 @@ public class ProxyFileDataServlet extend
}
return new URI(request.getScheme(), null, request.getServerName(), request
- .getServerPort(), "/streamFile", "filename=" + i.getFullName(parent)
- + "&ugi=" + ugi.getShortUserName() + dtParam, null);
+ .getServerPort(), "/streamFile" + i.getFullName(parent),
+ "&ugi=" + ugi.getShortUserName() + dtParam, null);
}
/** {@inheritDoc} */
Modified: hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileForward.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileForward.java?rev=1077539&r1=1077538&r2=1077539&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileForward.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileForward.java Fri Mar 4 04:26:57 2011
@@ -28,12 +28,12 @@ public class ProxyFileForward extends Pr
@Override
protected String buildForwardPath(HttpServletRequest request, String pathInfo) {
String path = "/streamFile";
- path += "?filename=" + request.getPathInfo();
+ path += request.getPathInfo();
String userID = (String) request.
getAttribute("org.apache.hadoop.hdfsproxy.authorized.userID");
UserGroupInformation ugi = ProxyUtil.getProxyUGIFor(userID);
if (ugi != null) {
- path += "&ugi=" + ugi.getShortUserName();
+ path += "?ugi=" + ugi.getShortUserName();
}
return path;
}
Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java?rev=1077539&r1=1077538&r2=1077539&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java Fri Mar 4 04:26:57 2011
@@ -62,8 +62,8 @@ public class FileDataServlet extends Dfs
"https".equals(scheme)
? (Integer)getServletContext().getAttribute("datanode.https.port")
: host.getInfoPort(),
- "/streamFile", "filename=" + i.getFullName(parent) +
- "&ugi=" + ugi.getShortUserName() + dtParam, null);
+ "/streamFile" + i.getFullName(parent),
+ "ugi=" + ugi.getShortUserName() + dtParam, null);
}
private static JspHelper jspHelper = null;
Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/StreamFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/StreamFile.java?rev=1077539&r1=1077538&r2=1077539&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/StreamFile.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/StreamFile.java Fri Mar 4 04:26:57 2011
@@ -17,16 +17,20 @@
*/
package org.apache.hadoop.hdfs.server.namenode;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.*;
-import java.net.*;
-import java.security.PrivilegedExceptionAction;
-import org.apache.hadoop.fs.*;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.net.InetSocketAddress;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSInputStream;
import org.apache.hadoop.hdfs.DFSClient;
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hadoop.conf.*;
public class StreamFile extends DfsServlet {
static InetSocketAddress nameNodeAddr;
@@ -41,7 +45,8 @@ public class StreamFile extends DfsServl
throws ServletException, IOException {
Configuration conf =
(Configuration) getServletContext().getAttribute(JspHelper.CURRENT_CONF);
- String filename = request.getParameter("filename");
+ final String filename = request.getPathInfo() != null ?
+ request.getPathInfo() : "/";
if (filename == null || filename.length() == 0) {
response.setContentType("text/plain");
PrintWriter out = response.getWriter();
Modified: hadoop/common/branches/branch-0.20-security-patches/src/webapps/datanode/browseBlock.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/webapps/datanode/browseBlock.jsp?rev=1077539&r1=1077538&r2=1077539&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/webapps/datanode/browseBlock.jsp (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/webapps/datanode/browseBlock.jsp Fri Mar 4 04:26:57 2011
@@ -88,9 +88,10 @@
//Add the various links for looking at the file contents
//URL for downloading the full file
String downloadUrl = "http://" + req.getServerName() + ":" +
- + req.getServerPort() + "/streamFile?" + "filename="
+ + req.getServerPort() + "/streamFile"
+ URLEncoder.encode(filename, "UTF-8")
- + JspHelper.SET_DELEGATION + tokenString;
+ + "?" + JspHelper.DELEGATION_PARAMETER_NAME
+ + "=" + tokenString;
out.print("<a name=\"viewOptions\"></a>");
out.print("<a href=\"" + downloadUrl + "\">Download this file</a><br>");