tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hari...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/server ServerRequest.java
Date Sat, 30 Oct 1999 03:18:21 GMT
harishp     99/10/29 20:18:19

  Modified:    src/share/org/apache/tomcat/core Tag: TOMCAT_J2EE_10F_102199
                        DefaultServlet.java
               src/share/org/apache/tomcat/server Tag:
                        TOMCAT_J2EE_10F_102199 ServerRequest.java
  Log:
  Modified Default Servlet so that cononical and absolute path
  equals check gets tiggered only in case of Windows. (How? check for
  the File.separator==\
  Modified the ServletRequest to stop processing & send an error
  code to the client when it encounters IOException instead of
  printing out stackTrace on the client side.....
  Notice that these changes are being done to the branch.... Not
  to the main tree.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +5 -4      jakarta-tomcat/src/share/org/apache/tomcat/core/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/DefaultServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- DefaultServlet.java	1999/10/19 06:45:03	1.3
  +++ DefaultServlet.java	1999/10/30 03:18:17	1.3.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/DefaultServlet.java,v
1.3 1999/10/19 06:45:03 jhunter Exp $
  - * $Revision: 1.3 $
  - * $Date: 1999/10/19 06:45:03 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/DefaultServlet.java,v
1.3.2.1 1999/10/30 03:18:17 harishp Exp $
  + * $Revision: 1.3.2.1 $
  + * $Date: 1999/10/30 03:18:17 $
    *
    * ====================================================================
    *
  @@ -352,7 +352,8 @@
           // return 404 instead of the JSP source
   	// On all platforms, makes sure we don't let ../'s through
           // Unfortunately, on Unix, it prevents symlinks from working
  -	if (! absPath.equals(canPath)) {
  +	// So, a check for File.separator("\\").....
  +	if (File.separator.equals("\\") && (!absPath.equals(canPath)) ) {
   	    response.sendError(response.SC_NOT_FOUND);
   
   	    return;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.2 +14 -4     jakarta-tomcat/src/share/org/apache/tomcat/server/ServerRequest.java
  
  Index: ServerRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/server/ServerRequest.java,v
  retrieving revision 1.1.1.1.2.1
  retrieving revision 1.1.1.1.2.2
  diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2
  --- ServerRequest.java	1999/10/25 22:46:41	1.1.1.1.2.1
  +++ ServerRequest.java	1999/10/30 03:18:18	1.1.1.1.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/server/ServerRequest.java,v
1.1.1.1.2.1 1999/10/25 22:46:41 costin Exp $
  - * $Revision: 1.1.1.1.2.1 $
  - * $Date: 1999/10/25 22:46:41 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/server/ServerRequest.java,v
1.1.1.1.2.2 1999/10/30 03:18:18 harishp Exp $
  + * $Revision: 1.1.1.1.2.2 $
  + * $Date: 1999/10/30 03:18:18 $
    *
    * ====================================================================
    *
  @@ -109,7 +109,17 @@
   	ServletInputStreamImpl sis = new ServletInputStreamImpl(this, sin);
   	this.in=sis;
   	
  -	processRequestLine(sis.readLine());
  +	try {
  +		processRequestLine(sis.readLine());
  +	}catch(IOException ioe) {
  +		// We cannot do much... but lets make sure atleast
  +		// that we send the right thing back to the
  +		// browser.
  +		if(response.getStatus() == HttpServletResponse.SC_OK) {
  +			response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  +			return;
  +		}
  +	}
   
   	// XXX
   	//    return if an error was detected in processing the
  
  
  

Mime
View raw message