tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amy Roh <amy...@apache.org>
Subject ManagerServlet undeploy
Date Thu, 18 Sep 2003 20:28:14 GMT
Undeploy fails for any app that's not installed under webapps directory. 
  For example, an attempt to undeploy /admin will fail with "Cannot 
undeploy document base for path /admin" because of the following lines 
from ManagerServlet line 1384

             // Validate the docBase path of this application
             String deployedPath = deployed.getCanonicalPath();
             String docBase = context.getDocBase();
             File docBaseDir = new File(docBase);
             if (!docBaseDir.isAbsolute()) {
                 docBaseDir = new File(appBaseDir, docBase);
             }
             String docBasePath = docBaseDir.getCanonicalPath();
             if (!docBasePath.startsWith(deployedPath)) {
                 writer.println(sm.getString("managerServlet.noDocBase",
                                             displayPath));
                 return;
             }

Any app that's installed using context configuration file with docBase 
other than "../webapps" will not pass the condition since deployedPath 
is always ../webapps.

What is the reasoning behind this validation?

Thanks,
Amy



Mime
View raw message