From 6d71407582bad00cacf5d8974a17ddc962d5ac60 Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Thu, 17 May 2012 16:55:49 +0000 Subject: [PATCH] HDFS-1153. dfsnodelist.jsp should handle invalid input parameters. Contributed by Ravi Phulari git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1339706 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/NamenodeJspHelper.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 28b7377c373..7b52d55c9ae 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -211,6 +211,9 @@ Release 2.0.1-alpha - UNRELEASED HDFS-3433. GetImageServlet should allow administrative requestors when security is enabled. (atm) + HDFS-1153. dfsnodelist.jsp should handle invalid input parameters. + (Ravi Phulari via eli) + Release 2.0.0-alpha - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java index f284aaa6702..3fdc2413dcf 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java @@ -587,6 +587,10 @@ class NamenodeJspHelper { whatNodes = request.getParameter("whatNodes"); // show only live or only // dead nodes + if (null == whatNodes || whatNodes.isEmpty()) { + out.print("Invalid input"); + return; + } sorterField = request.getParameter("sorter/field"); sorterOrder = request.getParameter("sorter/order"); if (sorterField == null) @@ -714,6 +718,8 @@ class NamenodeJspHelper { } out.print("\n"); } + } else { + out.print("Invalid input"); } out.print(""); }