This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 719fc92e50 BZ 68054: Optimize IO calls 719fc92e50 is described below commit 719fc92e50251d730507f596ff7bc793d97b7eae 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 4abe4978db..286697900e 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -136,6 +136,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