This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new a6c857434a BZ 68054: Optimize IO calls a6c857434a is described below commit a6c857434a4e1fc27bebcd803cf9b8b186937fee Author: remm <r...@apache.org> AuthorDate: Thu Nov 2 15:14:44 2023 +0100 BZ 68054: Optimize IO calls Avoid some file canonicalization calls introduced by the fix for 65433. --- java/org/apache/catalina/webresources/DirResourceSet.java | 6 ++++-- webapps/docs/changelog.xml | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/webresources/DirResourceSet.java b/java/org/apache/catalina/webresources/DirResourceSet.java index 3bd0245f0a..a221c3f1c3 100644 --- a/java/org/apache/catalina/webresources/DirResourceSet.java +++ b/java/org/apache/catalina/webresources/DirResourceSet.java @@ -164,8 +164,10 @@ public class DirResourceSet extends AbstractFileResourceSet { // path that was contributed by 'f' and check // that what is left does not contain a symlink. absPath = entry.getAbsolutePath().substring(f.getAbsolutePath().length()); - if (entry.getCanonicalPath().length() >= f.getCanonicalPath().length()) { - canPath = entry.getCanonicalPath().substring(f.getCanonicalPath().length()); + String entryCanPath = entry.getCanonicalPath(); + String fCanPath = f.getCanonicalPath(); + if (entryCanPath.length() >= fCanPath.length()) { + canPath = entryCanPath.substring(fCanPath.length()); if (absPath.equals(canPath)) { symlink = false; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index bb5a18887f..e0d514313b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -141,6 +141,10 @@ <code>jakarta.servlet.error.exception</code> is not sufficient to trigger error handling for the current request and response. (markt) </fix> + <fix> + <bug>68054</bug>: Avoid some file canonicalization calls introduced + by the fix for <bug>65433</bug>. (remm) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org