You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/03/13 11:19:19 UTC

[tomcat] branch master updated: Always process the docBase using absolute path during deployment

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new ad60947  Always process the docBase using absolute path during deployment
ad60947 is described below

commit ad60947e42e666dc9c9d77315787ea9bb567e3fd
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Mar 13 11:18:45 2019 +0000

    Always process the docBase using absolute path during deployment
    
    Use absolute path to determine the Context name, deployment type,
    whether the docBase is located within the appBase etc.
---
 java/org/apache/catalina/startup/ContextConfig.java | 4 ++--
 webapps/docs/changelog.xml                          | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java
index ebd3d82..0c67af3 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -582,9 +582,9 @@ public class ContextConfig implements LifecycleListener {
 
         File file = new File(docBase);
         if (!file.isAbsolute()) {
-            docBase = (new File(appBase, docBase)).getCanonicalPath();
+            docBase = (new File(appBase, docBase)).getAbsolutePath();
         } else {
-            docBase = file.getCanonicalPath();
+            docBase = file.getAbsolutePath();
         }
         file = new File(docBase);
         String origDocBase = docBase;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 43b6cfd..54c1739 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -92,6 +92,12 @@
         <bug>63246</bug>: Fix a potential <code>NullPointerException</code> when
         calling <code>AsyncContext.dispatch()</code>. (markt)
       </fix>
+      <fix>
+        Always use the absolute path of the <code>docBase</code> during the
+        deployment process to determine the Context name, deployment type,
+        whether the <code>docBase</code> is located within the
+        <code>appBase</code> etc. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org