hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r689993 - in /hadoop/core/trunk: CHANGES.txt src/webapps/job/jobdetails.jsp src/webapps/job/taskdetails.jsp
Date Thu, 28 Aug 2008 21:22:04 GMT
Author: omalley
Date: Thu Aug 28 14:22:03 2008
New Revision: 689993

URL: http://svn.apache.org/viewvc?rev=689993&view=rev
Log:
HADOOP-3342. Change the kill task actions to require http post instead of 
get to prevent accidental crawls from triggering it. (enis via omalley)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/webapps/job/jobdetails.jsp
    hadoop/core/trunk/src/webapps/job/taskdetails.jsp

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=689993&r1=689992&r2=689993&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Aug 28 14:22:03 2008
@@ -236,6 +236,9 @@
     HADOOP-3488. Prevent hadoop-daemon from rsync'ing log files (Stefan 
     Groshupf and Craig Macdonald via omalley)
 
+    HADOOP-3342. Change the kill task actions to require http post instead of 
+    get to prevent accidental crawls from triggering it. (enis via omalley)
+
   OPTIMIZATIONS
 
     HADOOP-3556. Removed lock contention in MD5Hash by changing the 

Modified: hadoop/core/trunk/src/webapps/job/jobdetails.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/jobdetails.jsp?rev=689993&r1=689992&r2=689993&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/jobdetails.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/jobdetails.jsp Thu Aug 28 14:22:03 2008
@@ -95,9 +95,13 @@
         + url+"\"></head>"
         + "<body><h3> Are you sure you want to kill " + jobId
         + " ?<h3><br><table border=\"0\"><tr><td width=\"100\">"
-        + "<a href=\"" +  url + "&action=kill"
-        + "\">Kill</a></td><td width=\"100\"><a href=\"" + url
-        + "\">Cancel </a></td></tr></table></body></html>");
+        + "<form action=\"" + url + "\" method=\"post\">"
+        + "<input type=\"hidden\" name=\"action\" value=\"kill\" />"
+        + "<input type=\"submit\" name=\"kill\" value=\"Kill\" />"
+        + "</form>"
+        + "</td><td width=\"100\"><form method=\"post\" action=\"" + url
+        + "\"><input type=\"submit\" value=\"Cancel\" name=\"Cancel\""
+        + "/></form></td></tr></table></body></html>");
   }
   
 %>       
@@ -121,7 +125,7 @@
     JobInProgress job = (JobInProgress) tracker.getJob(jobIdObj);
     
     String action = request.getParameter("action");
-    if("changeprio".equalsIgnoreCase(action)) {
+    if("changeprio".equalsIgnoreCase(action) && request.getMethod().equalsIgnoreCase("POST"))
{
       tracker.setJobPriority(jobIdObj, 
                              JobPriority.valueOf(request.getParameter("prio")));
     }
@@ -132,7 +136,8 @@
   	      printConfirm(out, jobId);
     	    return;
 	    }
-  	    else if(action != null && action.equalsIgnoreCase("kill")) {
+  	    else if(action != null && action.equalsIgnoreCase("kill") && 
+  	        request.getMethod().equalsIgnoreCase("POST")) {
 	      tracker.killJob(jobIdObj);
 	    }
     }
@@ -292,16 +297,24 @@
        style="width:100%" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/"
/>
 <%} }%>
 
-<hr>Change priority from <%=job.getPriority()%> to: 
+<hr>
+<table border="0"> <tr> <td>
+Change priority from <%=job.getPriority()%> to:
+<form action="jobdetails.jsp" method="post">
+<input type="hidden" name="action" value="changeprio"/>
+<input type="hidden" name="jobid" value="<%=jobId%>"/>
+</td><td> <select name="prio"> 
 <%
   JobPriority jobPrio = job.getPriority();
   for (JobPriority prio : JobPriority.values()) {
     if(jobPrio != prio) {
-      %> <a style="margin-left: 5px; margin-right: 5px;" href="jobdetails.jsp?action=changeprio&jobid=<%=jobId%>&prio=<%=prio%>">
<%=prio%> </a> <%
+      %> <option value=<%=prio%>><%=prio%></option> <%
     }
   }
 %>
-</br>
+</select> </td><td><input type="submit" value="Submit"> </form></td></tr>
</table>
+
+<table border="0"> <tr>
     
 <% if(JspHelper.conf.getBoolean(PRIVATE_ACTIONS_KEY, false) 
     	&& runState == JobStatus.RUNNING) { %>

Modified: hadoop/core/trunk/src/webapps/job/taskdetails.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/taskdetails.jsp?rev=689993&r1=689992&r2=689993&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/taskdetails.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/taskdetails.jsp Thu Aug 28 14:22:03 2008
@@ -22,9 +22,13 @@
     out.print("<html><head><META http-equiv=\"refresh\" content=\"15;URL="
         + url + "\"></head>" + "<body><h3> Are you sure you want to
kill/fail "
         + taskid + " ?<h3><br><table border=\"0\"><tr><td width=\"100\">"
-        + "<a href=\"" + url + "&action=" + action
-        + "\">Kill / Fail</a></td><td width=\"100\"><a href=\"" +
url
-        + "\">Cancel</a></td></tr></table></body></html>");
+        + "<form action=\"" + url + "\" method=\"post\">"
+        + "<input type=\"hidden\" name=\"action\" value=\"" + action + "\" />"
+        + "<input type=\"submit\" name=\"Kill/Fail\" value=\"Kill/Fail\" />"
+        + "</form>"
+        + "</td><td width=\"100\"><form method=\"post\" action=\"" + url
+        + "\"><input type=\"submit\" value=\"Cancel\" name=\"Cancel\""
+        + "/></form></td></tr></table></body></html>");
   }%>
 <%
     JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
@@ -49,13 +53,15 @@
           printConfirm(out, jobid, tipid, taskid, subAction);
           return;
         }
-        else if (action.equalsIgnoreCase("kill-task")) {
+        else if (action.equalsIgnoreCase("kill-task") 
+            && request.getMethod().equalsIgnoreCase("POST")) {
           tracker.killTask(taskidObj, false);
           //redirect again so that refreshing the page will not attempt to rekill the task
           response.sendRedirect("/taskdetails.jsp?" + "&subaction=kill-task"
               + "&jobid=" + jobid + "&tipid=" + tipid);
         }
-        else if (action.equalsIgnoreCase("fail-task")) {
+        else if (action.equalsIgnoreCase("fail-task")
+            && request.getMethod().equalsIgnoreCase("POST")) {
           tracker.killTask(taskidObj, true);
           response.sendRedirect("/taskdetails.jsp?" + "&subaction=fail-task"
               + "&jobid=" + jobid + "&tipid=" + tipid);



Mime
View raw message