tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request SecurityCheck.java
Date Wed, 16 Feb 2000 00:48:45 GMT
costin      00/02/15 16:48:45

  Modified:    src/share/org/apache/tomcat/context DefaultCMSetter.java
                        WorkDirInterceptor.java
               src/share/org/apache/tomcat/core ContextManager.java
               src/share/org/apache/tomcat/request SecurityCheck.java
  Log:
  Moved work-dir initialization in DefaultCMSetter. WorkDirInterceptor will only clean
  up the workdir if not persistent.
  
  Commented out the workdir removal - it's not part of the spec and it affects the
  performance ( by removing the jsp files). It is also a bad idea to clean it up
  all the time we start/shut down - it can be removed when we un-deploy or
  when we have a good reason for that, it is the only place where servlets can save files.
  
  Revision  Changes    Path
  1.15      +8 -1      jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java
  
  Index: DefaultCMSetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DefaultCMSetter.java	2000/02/16 00:30:28	1.14
  +++ DefaultCMSetter.java	2000/02/16 00:48:44	1.15
  @@ -96,7 +96,14 @@
   
   	if( ctx.getWorkDir() == null)
   	    setWorkDir(ctx);
  -	
  +
  +	if (! ctx.getWorkDir().exists()) {
  +	    //log  System.out.println("Creating work dir " + ctx.getWorkDir() );
  +	    ctx.getWorkDir().mkdirs();
  +	}
  +	ctx.setAttribute(Constants.ATTRIB_WORKDIR1, ctx.getWorkDir());
  +	ctx.setAttribute(Constants.ATTRIB_WORKDIR , ctx.getWorkDir());
  +
   	// Set default session manager if none set
   	if( ctx.getSessionManager() == null ) 
   	    ctx.setSessionManager(new org.apache.tomcat.session.StandardSessionManager());
  
  
  
  1.6       +6 -18     jakarta-tomcat/src/share/org/apache/tomcat/context/WorkDirInterceptor.java
  
  Index: WorkDirInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/WorkDirInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WorkDirInterceptor.java	2000/02/12 03:38:49	1.5
  +++ WorkDirInterceptor.java	2000/02/16 00:48:44	1.6
  @@ -80,27 +80,15 @@
       }
   	
       public void contextInit(Context ctx) {
  -	// never null !! ( it is set by default to ./work ! )
  -	//log	System.out.println("Preparing work dir " + ctx.getWorkDir() );
  -
  -	if (! ctx.isWorkDirPersistent()) {
  -	    clearDir(ctx.getWorkDir() );
  -        }
  -
  -	if (! ctx.getWorkDir().exists()) {
  -	    //log  System.out.println("Creating work dir " + ctx.getWorkDir() );
  -	    ctx.getWorkDir().mkdirs();
  -	}
  -
  -	ctx.setAttribute(Constants.ATTRIB_WORKDIR1, ctx.getWorkDir());
  -	ctx.setAttribute(Constants.ATTRIB_WORKDIR , ctx.getWorkDir());
  +	// 	if (! ctx.isWorkDirPersistent()) {
  +	// 	    clearDir(ctx.getWorkDir() );
  +	//         }
       }
   
       public void contextShutdown( Context ctx ) {
  -	
  -	if (! ctx.isWorkDirPersistent()) {
  -            clearDir(ctx.getWorkDir());
  -	}
  +	// 	if (! ctx.isWorkDirPersistent()) {
  +	//             clearDir(ctx.getWorkDir());
  +	// 	}
       }
   
       private void clearDir(File dir) {
  
  
  
  1.43      +6 -0      jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- ContextManager.java	2000/02/16 00:30:29	1.42
  +++ ContextManager.java	2000/02/16 00:48:45	1.43
  @@ -529,6 +529,12 @@
   
   	    int err=authorize( rrequest, rresponse );
   	    if( err != 0 ) {
  +		// redirect to the right servlet 
  +		Context ctx=req.getContext();
  +		String authMethod=ctx.getAuthMethod();
  +		ServletWrapper authWrapper=ctx.getServletByName( "authServlet" );
  +		req.setWrapper( authWrapper );
  +		
   		// unauthorized access, redirect to login page.
   		// XXX authorize will set request
   	    }
  
  
  
  1.3       +0 -5      jakarta-tomcat/src/share/org/apache/tomcat/request/SecurityCheck.java
  
  Index: SecurityCheck.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SecurityCheck.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SecurityCheck.java	2000/02/16 00:30:30	1.2
  +++ SecurityCheck.java	2000/02/16 00:48:45	1.3
  @@ -161,11 +161,6 @@
   	}
   
   	if( ctx.getDebug() > 0 ) ctx.log( "Unauthorized " );
  -	// redirect to the right servlet 
  -	// XXX hardcoded
  -	ServletWrapper authWrapper=ctx.getServletByName( "authServlet" );
  -	req.setWrapper( authWrapper );
  -	
    	return HttpServletResponse.SC_UNAUTHORIZED;
   	// XXX check transport
       }
  
  
  

Mime
View raw message