[Bug 64771] Windows CPU processor always running by a thread reading request body from https connection

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64771

--- Comment #8 from Remy Maucherat  ---
That doesn't look good, it seems the state of the destination buffer is
changing concurrently (suddenly, no remaining bytes although the capacity is
still there), which then breaks the algorithm. Maybe this loop should be safer,
but it probably means there's missing sync somewhere else [given the report the
threading could be funky, async does not allow to do *anything*]. It could be a
good idea to add a safety check in unwrap, but then the data read is already
corrupted and that request is not going to end well.

--- a/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
+++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
@@ -600,6 +600,10 @@
 }
 if (capacity == 0) {
 break;
+} else if (idx == endOffset) {
+// Avoid loop which could be caused by an unexpected state
+// change of the destination buffers and report an error
+throw new IllegalArgumentException("BAAAD");
 } else if (pendingApp == 0) {
 pendingApp = pendingReadableBytesInSSL();
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 64771] Windows CPU processor always running by a thread reading request body from https connection

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64771

--- Comment #7 from pil...@yahoo.com ---
I believe I have hit this same issue.

I reported a bug against Spring as
https://github.com/spring-projects/spring-framework/issues/26407

I have created a standalone application that can be used to reproduce the
problem.  The app is linked from the description of the spring issue.

There is definitely a case where OpenSSLEngine.unwrap gets into an infinite
loop.  It would be great if someone familiar with OpenSSLEngine can take a
look.  It is not clear if the problem is in tomcat or spring.

Can this tomcat issue be reopened?  Or should I file a new issue?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



buildbot success in on tomcat-7-trunk

2021-01-20 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-7-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-7-trunk/builds/1840

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' 
triggered this build
Build Source Stamp: [branch 7.0.x] 7c3fb673f4f17a9c31ebb5be54d3017d50aa41e7
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[tomcat] branch 7.0.x updated: File separator, not path separator

2021-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 7c3fb67  File separator, not path separator
7c3fb67 is described below

commit 7c3fb673f4f17a9c31ebb5be54d3017d50aa41e7
Author: Mark Thomas 
AuthorDate: Wed Jan 20 16:38:32 2021 +

File separator, not path separator
---
 java/org/apache/catalina/util/FileUtil.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/util/FileUtil.java 
b/java/org/apache/catalina/util/FileUtil.java
index d25bde7..c8a69cb 100644
--- a/java/org/apache/catalina/util/FileUtil.java
+++ b/java/org/apache/catalina/util/FileUtil.java
@@ -26,8 +26,8 @@ public class FileUtil {
 
 public FileUtil(File f) throws IOException {
 String path = f.getCanonicalPath();
-if (!path.endsWith(File.pathSeparator)) {
-path += File.pathSeparatorChar;
+if (!path.endsWith(File.separator)) {
+path += File.separatorChar;
 }
 
 canonicalPath = path;


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



Re: buildbot failure in on tomcat-7-trunk

2021-01-20 Thread Mark Thomas
On 20/01/2021 16:16, build...@apache.org wrote:
> The Buildbot has detected a new failure on builder tomcat-7-trunk while 
> building tomcat. Full details are available at:
> https://ci.apache.org/builders/tomcat-7-trunk/builds/1839
> 
> Buildbot URL: https://ci.apache.org/
> 
> Buildslave for this Build: asf946_ubuntu
> 
> Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' 
> triggered this build
> Build Source Stamp: [branch 7.0.x] 74b105657ffbd1d1de80455f03446c3bbf30d1f5
> Blamelist: Mark Thomas 
> 
> BUILD FAILED: failed compile_1

   [concat] Testsuites with failed tests:
   [concat]
TEST-org.apache.catalina.startup.TestHostConfigAutomaticDeployment.APR.txt
   [concat]
TEST-org.apache.catalina.startup.TestHostConfigAutomaticDeployment.BIO.txt
   [concat]
TEST-org.apache.catalina.startup.TestHostConfigAutomaticDeployment.NIO.txt
   [concat] TEST-org.apache.catalina.startup.TestTomcat.APR.txt
   [concat] TEST-org.apache.catalina.startup.TestTomcat.BIO.txt
   [concat] TEST-org.apache.catalina.startup.TestTomcat.NIO.txt


Almost certainly my fault. Looking now...

Mark

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



buildbot failure in on tomcat-7-trunk

2021-01-20 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-7-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-7-trunk/builds/1839

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' 
triggered this build
Build Source Stamp: [branch 7.0.x] 74b105657ffbd1d1de80455f03446c3bbf30d1f5
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[tomcat] branch 9.0.x updated: Start using more general AOT acronym instead of Graal

2021-01-20 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new c2870cc  Start using more general AOT acronym instead of Graal
c2870cc is described below

commit c2870cc2b2c9453448f3a0f84497d05e83b78542
Author: remm 
AuthorDate: Wed Jan 20 16:58:38 2021 +0100

Start using more general AOT acronym instead of Graal

AOT compilation support could also come from OpenJDK eventually.
---
 webapps/docs/graal.xml   | 2 +-
 webapps/docs/project.xml | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 24943d7..f079197 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -23,7 +23,7 @@
 &project;
 
   
-GraalVM support
+Ahead of Time compilation support
   
 
 
diff --git a/webapps/docs/project.xml b/webapps/docs/project.xml
index e57c670..2331d1a 100644
--- a/webapps/docs/project.xml
+++ b/webapps/docs/project.xml
@@ -75,7 +75,8 @@
 
 
 
-
+
 
 
 


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



[tomcat] branch master updated: Start using more general AOT acronym instead of Graal

2021-01-20 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 0fe5c6f  Start using more general AOT acronym instead of Graal
0fe5c6f is described below

commit 0fe5c6fab78178cdc80bfebc7a5ffc5c26d58a43
Author: remm 
AuthorDate: Wed Jan 20 16:58:38 2021 +0100

Start using more general AOT acronym instead of Graal

AOT compilation support could also come from OpenJDK eventually.
---
 webapps/docs/graal.xml   | 2 +-
 webapps/docs/project.xml | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 67c5d83..f751d03 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -23,7 +23,7 @@
 &project;
 
   
-GraalVM support
+Ahead of Time compilation support
   
 
 
diff --git a/webapps/docs/project.xml b/webapps/docs/project.xml
index eb1355c..6d79e69 100644
--- a/webapps/docs/project.xml
+++ b/webapps/docs/project.xml
@@ -75,7 +75,8 @@
 
 
 
-
+
 
 
 


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



[tomcat] branch 7.0.x updated: Use consistent approach for sub-directory checking

2021-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 74b1056  Use consistent approach for sub-directory checking
74b1056 is described below

commit 74b105657ffbd1d1de80455f03446c3bbf30d1f5
Author: Mark Thomas 
AuthorDate: Wed Jan 20 13:28:57 2021 +

Use consistent approach for sub-directory checking
---
 .../apache/catalina/servlets/DefaultServlet.java   |  3 +-
 java/org/apache/catalina/session/FileStore.java|  4 +-
 .../org/apache/catalina/startup/ContextConfig.java |  3 +-
 java/org/apache/catalina/startup/ExpandWar.java| 21 +++--
 java/org/apache/catalina/startup/HostConfig.java   |  5 ++-
 java/org/apache/catalina/util/FileUtil.java| 50 ++
 webapps/docs/changelog.xml |  4 ++
 7 files changed, 71 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index a34b2ac..e9e6332 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -67,6 +67,7 @@ import javax.xml.transform.stream.StreamSource;
 import org.apache.catalina.Globals;
 import org.apache.catalina.connector.RequestFacade;
 import org.apache.catalina.connector.ResponseFacade;
+import org.apache.catalina.util.FileUtil;
 import org.apache.catalina.util.IOTools;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.ServerInfo;
@@ -1811,7 +1812,7 @@ public class DefaultServlet extends HttpServlet {
 
 // First check that the resulting path is under the provided base
 try {
-if 
(!candidate.getCanonicalPath().startsWith(base.getCanonicalPath())) {
+if (!(new FileUtil(base)).isParentOf(candidate)) {
 return null;
 }
 } catch (IOException ioe) {
diff --git a/java/org/apache/catalina/session/FileStore.java 
b/java/org/apache/catalina/session/FileStore.java
index 08a02c3..4468f27 100644
--- a/java/org/apache/catalina/session/FileStore.java
+++ b/java/org/apache/catalina/session/FileStore.java
@@ -32,6 +32,7 @@ import javax.servlet.ServletContext;
 import org.apache.catalina.Context;
 import org.apache.catalina.Loader;
 import org.apache.catalina.Session;
+import org.apache.catalina.util.FileUtil;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
@@ -402,9 +403,10 @@ public final class FileStore extends StoreBase {
 
 String filename = id + FILE_EXT;
 File file = new File(storageDir, filename);
+FileUtil storageDirUtil = new FileUtil(storageDir);
 
 // Check the file is within the storage directory
-if 
(!file.getCanonicalPath().startsWith(storageDir.getCanonicalPath())) {
+if (!storageDirUtil.isParentOf(file)) {
 log.warn(sm.getString("fileStore.invalid", file.getPath(), id));
 return null;
 }
diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index aff9a02..27b4a26 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -75,6 +75,7 @@ import org.apache.catalina.deploy.SecurityConstraint;
 import org.apache.catalina.deploy.ServletDef;
 import org.apache.catalina.deploy.WebXml;
 import org.apache.catalina.util.ContextName;
+import org.apache.catalina.util.FileUtil;
 import org.apache.catalina.util.Introspection;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -761,7 +762,7 @@ public class ContextConfig implements LifecycleListener {
 }
 }
 
-if (docBase.startsWith(canonicalAppBase.getPath() + 
File.separatorChar)) {
+if ((new FileUtil(canonicalAppBase)).isParentOf(docBase)) {
 docBase = docBase.substring(canonicalAppBase.getPath().length());
 docBase = docBase.replace(File.separatorChar, '/');
 if (docBase.startsWith("/")) {
diff --git a/java/org/apache/catalina/startup/ExpandWar.java 
b/java/org/apache/catalina/startup/ExpandWar.java
index a672e79..723940e 100644
--- a/java/org/apache/catalina/startup/ExpandWar.java
+++ b/java/org/apache/catalina/startup/ExpandWar.java
@@ -34,6 +34,7 @@ import java.util.zip.ZipException;
 
 import org.apache.catalina.Globals;
 import org.apache.catalina.Host;
+import org.apache.catalina.util.FileUtil;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -98,10 +99,7 @@ public class ExpandWar {
 throw new IOException(sm.getString("expandWar.createFailed", 
docBase));
 
 // Expand the WAR into th

[tomcat] branch 8.5.x updated: Use java.nio.file.Path for consistent sub-directory checking

2021-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 93f0cc4  Use java.nio.file.Path for consistent sub-directory checking
93f0cc4 is described below

commit 93f0cc403a9210d469afc2bd9cf03ab3251c6f35
Author: Mark Thomas 
AuthorDate: Wed Jan 20 13:28:57 2021 +

Use java.nio.file.Path for consistent sub-directory checking
---
 .../apache/catalina/servlets/DefaultServlet.java|  2 +-
 java/org/apache/catalina/session/FileStore.java |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  3 ++-
 java/org/apache/catalina/startup/ExpandWar.java | 21 +++--
 java/org/apache/catalina/startup/HostConfig.java|  3 +--
 webapps/docs/changelog.xml  |  4 
 6 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index bd72e21..862f2d1 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2216,7 +2216,7 @@ public class DefaultServlet extends HttpServlet {
 
 // First check that the resulting path is under the provided base
 try {
-if 
(!candidate.getCanonicalPath().startsWith(base.getCanonicalPath())) {
+if 
(!candidate.getCanonicalFile().toPath().startsWith(base.getCanonicalFile().toPath()))
 {
 return null;
 }
 } catch (IOException ioe) {
diff --git a/java/org/apache/catalina/session/FileStore.java 
b/java/org/apache/catalina/session/FileStore.java
index cf3ea88..cac6027 100644
--- a/java/org/apache/catalina/session/FileStore.java
+++ b/java/org/apache/catalina/session/FileStore.java
@@ -351,7 +351,7 @@ public final class FileStore extends StoreBase {
 File file = new File(storageDir, filename);
 
 // Check the file is within the storage directory
-if 
(!file.getCanonicalPath().startsWith(storageDir.getCanonicalPath())) {
+if 
(!file.getCanonicalFile().toPath().startsWith(storageDir.getCanonicalFile().toPath()))
 {
 log.warn(sm.getString("fileStore.invalid", file.getPath(), id));
 return null;
 }
diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index 73a5937..dd980a6 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -654,7 +654,8 @@ public class ContextConfig implements LifecycleListener {
 String docBaseCanonical = docBaseAbsoluteFile.getCanonicalPath();
 
 // Re-calculate now docBase is a canonical path
-boolean docBaseCanonicalInAppBase = 
docBaseCanonical.startsWith(appBase.getPath() + File.separatorChar);
+boolean docBaseCanonicalInAppBase =
+
docBaseAbsoluteFile.getCanonicalFile().toPath().startsWith(appBase.toPath());
 String docBase;
 if (docBaseCanonicalInAppBase) {
 docBase = docBaseCanonical.substring(appBase.getPath().length());
diff --git a/java/org/apache/catalina/startup/ExpandWar.java 
b/java/org/apache/catalina/startup/ExpandWar.java
index 4e4a95c..8118beb 100644
--- a/java/org/apache/catalina/startup/ExpandWar.java
+++ b/java/org/apache/catalina/startup/ExpandWar.java
@@ -26,6 +26,7 @@ import java.net.JarURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
 import java.nio.channels.FileChannel;
+import java.nio.file.Path;
 import java.util.Enumeration;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
@@ -116,10 +117,7 @@ public class ExpandWar {
 }
 
 // Expand the WAR into the new document base directory
-String canonicalDocBasePrefix = docBase.getCanonicalPath();
-if (!canonicalDocBasePrefix.endsWith(File.separator)) {
-canonicalDocBasePrefix += File.separator;
-}
+Path canonicalDocBasePath = docBase.getCanonicalFile().toPath();
 
 // Creating war tracker parent (normally META-INF)
 File warTrackerParent = warTracker.getParentFile();
@@ -134,14 +132,13 @@ public class ExpandWar {
 JarEntry jarEntry = jarEntries.nextElement();
 String name = jarEntry.getName();
 File expandedFile = new File(docBase, name);
-if (!expandedFile.getCanonicalPath().startsWith(
-canonicalDocBasePrefix)) {
+if 
(!expandedFile.getCanonicalFile().toPath().startsWith(canonicalDocBasePath)) {
 // Trying to expand outside the docBase
 // Throw an exception to stop the deployment
 throw new IllegalArgumentException(
 sm.getStri

[tomcat] branch 9.0.x updated: Use java.nio.file.Path for consistent sub-directory checking

2021-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 4785433  Use java.nio.file.Path for consistent sub-directory checking
4785433 is described below

commit 4785433a226a20df6acbea49296e1ce7e23de453
Author: Mark Thomas 
AuthorDate: Wed Jan 20 13:28:57 2021 +

Use java.nio.file.Path for consistent sub-directory checking
---
 .../apache/catalina/servlets/DefaultServlet.java|  2 +-
 java/org/apache/catalina/session/FileStore.java |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  3 ++-
 java/org/apache/catalina/startup/ExpandWar.java | 21 +++--
 java/org/apache/catalina/startup/HostConfig.java|  3 +--
 webapps/docs/changelog.xml  |  4 
 6 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 2aca1b2..e0b6711 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2137,7 +2137,7 @@ public class DefaultServlet extends HttpServlet {
 
 // First check that the resulting path is under the provided base
 try {
-if 
(!candidate.getCanonicalPath().startsWith(base.getCanonicalPath())) {
+if 
(!candidate.getCanonicalFile().toPath().startsWith(base.getCanonicalFile().toPath()))
 {
 return null;
 }
 } catch (IOException ioe) {
diff --git a/java/org/apache/catalina/session/FileStore.java 
b/java/org/apache/catalina/session/FileStore.java
index cf3ea88..cac6027 100644
--- a/java/org/apache/catalina/session/FileStore.java
+++ b/java/org/apache/catalina/session/FileStore.java
@@ -351,7 +351,7 @@ public final class FileStore extends StoreBase {
 File file = new File(storageDir, filename);
 
 // Check the file is within the storage directory
-if 
(!file.getCanonicalPath().startsWith(storageDir.getCanonicalPath())) {
+if 
(!file.getCanonicalFile().toPath().startsWith(storageDir.getCanonicalFile().toPath()))
 {
 log.warn(sm.getString("fileStore.invalid", file.getPath(), id));
 return null;
 }
diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index 2e02b7f..5926bfc 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -858,7 +858,8 @@ public class ContextConfig implements LifecycleListener {
 String docBaseCanonical = docBaseAbsoluteFile.getCanonicalPath();
 
 // Re-calculate now docBase is a canonical path
-boolean docBaseCanonicalInAppBase = 
docBaseCanonical.startsWith(appBase.getPath() + File.separatorChar);
+boolean docBaseCanonicalInAppBase =
+
docBaseAbsoluteFile.getCanonicalFile().toPath().startsWith(appBase.toPath());
 String docBase;
 if (docBaseCanonicalInAppBase) {
 docBase = docBaseCanonical.substring(appBase.getPath().length());
diff --git a/java/org/apache/catalina/startup/ExpandWar.java 
b/java/org/apache/catalina/startup/ExpandWar.java
index a76acc2..ebc3e46 100644
--- a/java/org/apache/catalina/startup/ExpandWar.java
+++ b/java/org/apache/catalina/startup/ExpandWar.java
@@ -26,6 +26,7 @@ import java.net.JarURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
 import java.nio.channels.FileChannel;
+import java.nio.file.Path;
 import java.util.Enumeration;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
@@ -116,10 +117,7 @@ public class ExpandWar {
 }
 
 // Expand the WAR into the new document base directory
-String canonicalDocBasePrefix = docBase.getCanonicalPath();
-if (!canonicalDocBasePrefix.endsWith(File.separator)) {
-canonicalDocBasePrefix += File.separator;
-}
+Path canonicalDocBasePath = docBase.getCanonicalFile().toPath();
 
 // Creating war tracker parent (normally META-INF)
 File warTrackerParent = warTracker.getParentFile();
@@ -134,14 +132,13 @@ public class ExpandWar {
 JarEntry jarEntry = jarEntries.nextElement();
 String name = jarEntry.getName();
 File expandedFile = new File(docBase, name);
-if (!expandedFile.getCanonicalPath().startsWith(
-canonicalDocBasePrefix)) {
+if 
(!expandedFile.getCanonicalFile().toPath().startsWith(canonicalDocBasePath)) {
 // Trying to expand outside the docBase
 // Throw an exception to stop the deployment
 throw new IllegalArgumentException(
 sm.getStri

[tomcat] branch master updated (f5af457 -> 6d66e99)

2021-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from f5af457  Remove reference to (now) unnecessary JAR
 add 3c3fabe  Remove unnecessary code
 add 6d66e99  Use java.nio.file.Path for consistent sub-directory checking

No new revisions were added by this update.

Summary of changes:
 .../apache/catalina/servlets/DefaultServlet.java|  2 +-
 java/org/apache/catalina/session/FileStore.java |  2 +-
 .../apache/catalina/startup/ClassLoaderFactory.java |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  3 ++-
 java/org/apache/catalina/startup/ExpandWar.java | 21 +++--
 java/org/apache/catalina/startup/HostConfig.java|  3 +--
 webapps/docs/changelog.xml  |  4 
 7 files changed, 17 insertions(+), 20 deletions(-)


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



[Bug 65094] Typo on russian localization

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65094

--- Comment #4 from Polina  ---
Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65094] Typo on russian localization

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65094

--- Comment #3 from Remy Maucherat  ---
You can read the documentation in the wiki for the full details on how to
participate:
https://cwiki.apache.org/confluence/x/vIPzBQ

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65094] Typo on russian localization

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65094

--- Comment #2 from Polina  ---
Ok. But I suppose I don't have permission to do this in POEditor. When I click
on the link, I get a 404 error.. What am I doing wrong?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65094] Typo on russian localization

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65094

Remy Maucherat  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|NEW |RESOLVED

--- Comment #1 from Remy Maucherat  ---
Thanks. However, we cannot accept localization fixes as BZs or PRs, as there is
a much more efficient tool to do it. Fixes should be made in poeditor here:
https://poeditor.com/projects/view?id=221603

The poeditor strings are then regularly synced with Tomcat. This usually
happens before any new release.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65094] New: Typo on russian localization

2021-01-20 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65094

Bug ID: 65094
   Summary: Typo on russian localization
   Product: Tomcat 9
   Version: 9.0.41
  Hardware: All
OS: Linux
Status: NEW
  Severity: trivial
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: borisovapaul...@gmail.com
  Target Milestone: -

Hello!

I found a small typo in russian localization:
https://github.com/apache/tomcat/blob/f5af4571837553eeb76a7b3b8d79dcb9664847ca/java/org/apache/catalina/manager/LocalStrings_ru.properties#L121
 
Instead of "контекстом" should be "контекстном".
As a result: "Не удалось развернуть приложение на контекстном пути [{0}]".

Also you can translate this line
https://github.com/apache/tomcat/blob/f5af4571837553eeb76a7b3b8d79dcb9664847ca/java/org/apache/catalina/manager/LocalStrings_ru.properties#L161
as "ОШИБКА - Приложение по контекстному пути [{0}] не запустилось"

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org