|
@@ -18,6 +18,7 @@
|
|
import="org.apache.hadoop.hdfs.security.token.block.BlockTokenSecretManager"
|
|
import="org.apache.hadoop.hdfs.security.token.block.BlockTokenSecretManager"
|
|
import="org.apache.hadoop.security.UserGroupInformation"
|
|
import="org.apache.hadoop.security.UserGroupInformation"
|
|
import="org.apache.hadoop.util.*"
|
|
import="org.apache.hadoop.util.*"
|
|
|
|
+ import="org.apache.hadoop.http.HtmlQuoting"
|
|
import="java.text.DateFormat"
|
|
import="java.text.DateFormat"
|
|
%>
|
|
%>
|
|
|
|
|
|
@@ -66,7 +67,7 @@
|
|
startOffset = 0;
|
|
startOffset = 0;
|
|
else startOffset = Long.parseLong(startOffsetStr);
|
|
else startOffset = Long.parseLong(startOffsetStr);
|
|
|
|
|
|
- String filename = req.getParameter("filename");
|
|
|
|
|
|
+ String filename = HtmlQuoting.unquoteHtmlChars(req.getParameter("filename"));
|
|
if (filename == null || filename.length() == 0) {
|
|
if (filename == null || filename.length() == 0) {
|
|
out.print("Invalid input");
|
|
out.print("Invalid input");
|
|
return;
|
|
return;
|
|
@@ -159,7 +160,7 @@
|
|
locs[j].getInfoPort() +
|
|
locs[j].getInfoPort() +
|
|
"/browseBlock.jsp?blockId=" + Long.toString(blockId) +
|
|
"/browseBlock.jsp?blockId=" + Long.toString(blockId) +
|
|
"&blockSize=" + blockSize +
|
|
"&blockSize=" + blockSize +
|
|
- "&filename=" + URLEncoder.encode(filename, "UTF-8")+
|
|
|
|
|
|
+ "&filename=" + URLEncoder.encode(filename, "UTF-8") +
|
|
"&datanodePort=" + datanodePort +
|
|
"&datanodePort=" + datanodePort +
|
|
"&genstamp=" + cur.getBlock().getGenerationStamp() +
|
|
"&genstamp=" + cur.getBlock().getGenerationStamp() +
|
|
"&namenodeInfoPort=" + namenodeInfoPort +
|
|
"&namenodeInfoPort=" + namenodeInfoPort +
|
|
@@ -190,12 +191,12 @@
|
|
if (namenodeInfoPortStr != null)
|
|
if (namenodeInfoPortStr != null)
|
|
namenodeInfoPort = Integer.parseInt(namenodeInfoPortStr);
|
|
namenodeInfoPort = Integer.parseInt(namenodeInfoPortStr);
|
|
|
|
|
|
- String filename = req.getParameter("filename");
|
|
|
|
|
|
+ String filename = HtmlQuoting.unquoteHtmlChars(req.getParameter("filename"));
|
|
if (filename == null) {
|
|
if (filename == null) {
|
|
out.print("Invalid input (filename absent)");
|
|
out.print("Invalid input (filename absent)");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
String blockIdStr = null;
|
|
String blockIdStr = null;
|
|
long blockId = 0;
|
|
long blockId = 0;
|
|
blockIdStr = req.getParameter("blockId");
|
|
blockIdStr = req.getParameter("blockId");
|
|
@@ -263,11 +264,12 @@
|
|
}
|
|
}
|
|
datanodePort = Integer.parseInt(datanodePortStr);
|
|
datanodePort = Integer.parseInt(datanodePortStr);
|
|
out.print("<h3>File: ");
|
|
out.print("<h3>File: ");
|
|
- JspHelper.printPathWithLinks(filename, out, namenodeInfoPort,
|
|
|
|
- tokenString);
|
|
|
|
|
|
+ JspHelper.printPathWithLinks(HtmlQuoting.quoteHtmlChars(filename),
|
|
|
|
+ out, namenodeInfoPort, tokenString);
|
|
out.print("</h3><hr>");
|
|
out.print("</h3><hr>");
|
|
String parent = new File(filename).getParent();
|
|
String parent = new File(filename).getParent();
|
|
- JspHelper.printGotoForm(out, namenodeInfoPort, tokenString, parent);
|
|
|
|
|
|
+ JspHelper.printGotoForm(out, namenodeInfoPort, tokenString,
|
|
|
|
+ HtmlQuoting.quoteHtmlChars(parent));
|
|
out.print("<hr>");
|
|
out.print("<hr>");
|
|
out.print("<a href=\"http://" + req.getServerName() + ":" +
|
|
out.print("<a href=\"http://" + req.getServerName() + ":" +
|
|
req.getServerPort() +
|
|
req.getServerPort() +
|
|
@@ -382,7 +384,7 @@
|
|
"/browseBlock.jsp?blockId=" + prevBlockIdStr +
|
|
"/browseBlock.jsp?blockId=" + prevBlockIdStr +
|
|
"&blockSize=" + prevBlockSize + "&startOffset=" +
|
|
"&blockSize=" + prevBlockSize + "&startOffset=" +
|
|
prevStartOffset +
|
|
prevStartOffset +
|
|
- "&filename=" + URLEncoder.encode(filename, "UTF-8") +
|
|
|
|
|
|
+ "&filename=" + URLEncoder.encode(filename, "UTF-8") +
|
|
"&chunkSizeToView=" + chunkSizeToView +
|
|
"&chunkSizeToView=" + chunkSizeToView +
|
|
"&genstamp=" + prevGenStamp +
|
|
"&genstamp=" + prevGenStamp +
|
|
"&datanodePort=" + prevDatanodePort +
|
|
"&datanodePort=" + prevDatanodePort +
|