You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2023/11/02 14:18:54 UTC
(tomcat) branch 8.5.x updated: BZ 68054: Optimize IO calls
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new f218c9aaf4 BZ 68054: Optimize IO calls
f218c9aaf4 is described below
commit f218c9aaf4a9c4f38aa3bfceba294e09743faa0c
Author: remm <re...@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 4f32b549d0..8033523350 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org