[tomcat] 01/02: Fix some SpotBugs issues in the tests

2019-07-02 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

commit 8fcfb847a950f0bcc09a617faf0739826878247e
Author: Mark Thomas 
AuthorDate: Wed Nov 29 22:06:40 2017 +

Fix some SpotBugs issues in the tests

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1816655 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java  | 8 ++--
 .../authenticator/jaspic/TestPersistentProviderRegistrations.java | 4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java 
b/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java
index 5b8ce77..38fff7b 100644
--- 
a/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java
+++ 
b/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java
@@ -321,7 +321,9 @@ public class TestAuthConfigFactoryImpl {
 System.setProperty(Globals.CATALINA_BASE_PROP, "test");
 
 if (TEST_CONFIG_FILE.exists()) {
-TEST_CONFIG_FILE.delete();
+if (!TEST_CONFIG_FILE.delete()) {
+Assert.fail("Failed to delete " + TEST_CONFIG_FILE);
+}
 }
 }
 
@@ -335,7 +337,9 @@ public class TestAuthConfigFactoryImpl {
 }
 
 if (TEST_CONFIG_FILE.exists()) {
-TEST_CONFIG_FILE.delete();
+if (!TEST_CONFIG_FILE.delete()) {
+Assert.fail("Failed to delete " + TEST_CONFIG_FILE);
+}
 }
 }
 
diff --git 
a/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
 
b/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
index 43fcc61..d198777 100644
--- 
a/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
+++ 
b/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
@@ -126,7 +126,9 @@ public class TestPersistentProviderRegistrations {
 validateNoLayerAndAC(loadedProviders);
 } finally {
 if (f.exists()) {
-f.delete();
+if (!f.delete()) {
+Assert.fail("Failed to delete " + f);
+}
 }
 }
 }


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



[tomcat] 02/02: Fix some FindBugs warnings in the test cases

2019-07-02 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

commit 7f5c3844999f7669d438d1e0a52839f70a48e96f
Author: Mark Thomas 
AuthorDate: Fri Oct 13 12:01:23 2017 +

Fix some FindBugs warnings in the test cases

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1812119 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../TestPersistentProviderRegistrations.java   |  2 +-
 .../apache/catalina/connector/TestSendFile.java|  6 ++--
 .../apache/catalina/core/TestAsyncContextImpl.java |  2 +-
 .../apache/catalina/loader/TestVirtualContext.java |  2 +-
 .../TestWebappClassLoaderExecutorMemoryLeak.java   |  2 +-
 .../loader/TestWebappClassLoaderWeaving.java   |  2 +-
 .../startup/TestHostConfigAutomaticDeployment.java | 37 --
 .../apache/catalina/startup/TomcatBaseTest.java|  5 +--
 8 files changed, 32 insertions(+), 26 deletions(-)

diff --git 
a/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
 
b/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
index d198777..a767af2 100644
--- 
a/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
+++ 
b/test/org/apache/catalina/authenticator/jaspic/TestPersistentProviderRegistrations.java
@@ -81,7 +81,7 @@ public class TestPersistentProviderRegistrations {
 validateSimple(end);
 
 if (f.exists()) {
-f.delete();
+Assert.assertTrue("Failed to clean up [" + f + "]", f.delete());
 }
 }
 
diff --git a/test/org/apache/catalina/connector/TestSendFile.java 
b/test/org/apache/catalina/connector/TestSendFile.java
index e289941..a8aafbc 100644
--- a/test/org/apache/catalina/connector/TestSendFile.java
+++ b/test/org/apache/catalina/connector/TestSendFile.java
@@ -86,7 +86,7 @@ public class TestSendFile extends TomcatBaseTest {
 }
 } finally {
 for (File f : files) {
-f.delete();
+Assert.assertTrue("Failed to clean up [" + f + "]", 
f.delete());
 }
 }
 }
@@ -203,7 +203,9 @@ public class TestSendFile extends TomcatBaseTest {
 req.setAttribute(Globals.SENDFILE_FILENAME_ATTR, 
file.getAbsolutePath());
 req.setAttribute(Globals.SENDFILE_FILE_START_ATTR, 
Long.valueOf(0));
 req.setAttribute(Globals.SENDFILE_FILE_END_ATTR, 
Long.valueOf(file.length()));
-file.delete();
+if (!file.delete()) {
+throw new ServletException("Failed to delete [" + file + 
"]");
+}
 } else {
 byte[] c = new byte[1024];
 Random rd = new Random();
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index e6fb217..3712c97 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -2028,7 +2028,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
 
 private static final long serialVersionUID = 1L;
 
-private AsyncContext asyncContext;
+private transient AsyncContext asyncContext;
 
 @Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
diff --git a/test/org/apache/catalina/loader/TestVirtualContext.java 
b/test/org/apache/catalina/loader/TestVirtualContext.java
index 5c21df3..9db23e2 100644
--- a/test/org/apache/catalina/loader/TestVirtualContext.java
+++ b/test/org/apache/catalina/loader/TestVirtualContext.java
@@ -304,7 +304,7 @@ public class TestVirtualContext extends TomcatBaseTest {
 assertPageContains("/test/annotatedServlet", 
MyAnnotatedServlet.MESSAGE);
 tomcat.stop();
 FileUtils.deleteDirectory(additionWebInfClasses);
-tempFile.delete();
+Assert.assertTrue("Failed to clean up [" + tempFile + "]", 
tempFile.delete());
 }
 
 private void assertPageContains(String pageUrl, String expectedBody)
diff --git 
a/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java 
b/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java
index fe32cee..2fc7b0a 100644
--- 
a/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java
+++ 
b/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java
@@ -83,7 +83,7 @@ public class TestWebappClassLoaderExecutorMemoryLeak extends 
TomcatBaseTest {
 long n = 1000L;
 int tpSize = 10;
 
-public volatile ThreadPoolExecutor tpe;
+public transient volatile ThreadPoolExecutor tpe;
 
 @Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
diff --git 

[tomcat] branch 8.5.x updated (6090dcf -> 7f5c384)

2019-07-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 6090dcf  Expand i18n and update translations
 new 8fcfb84  Fix some SpotBugs issues in the tests
 new 7f5c384  Fix some FindBugs warnings in the test cases

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jaspic/TestAuthConfigFactoryImpl.java  |  8 +++--
 .../TestPersistentProviderRegistrations.java   |  6 ++--
 .../apache/catalina/connector/TestSendFile.java|  6 ++--
 .../apache/catalina/core/TestAsyncContextImpl.java |  2 +-
 .../apache/catalina/loader/TestVirtualContext.java |  2 +-
 .../TestWebappClassLoaderExecutorMemoryLeak.java   |  2 +-
 .../loader/TestWebappClassLoaderWeaving.java   |  2 +-
 .../startup/TestHostConfigAutomaticDeployment.java | 37 --
 .../apache/catalina/startup/TomcatBaseTest.java|  5 +--
 9 files changed, 41 insertions(+), 29 deletions(-)


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



[tomcat] branch 8.5.x updated (e5a7bc9 -> 6090dcf)

2019-07-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from e5a7bc9  SpotBugs. Remove unnecessary code.
 new 46940e0  Code clean-up
 new 8e204b9  Ensure HEAD response is consistent with GET response for 
HttpServlet
 new 6090dcf  Expand i18n and update translations

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/javax/servlet/http/HttpServlet.java   | 21 ++--
 java/javax/servlet/http/LocalStrings.properties|  5 +-
 java/javax/servlet/http/LocalStrings_es.properties |  2 +-
 java/javax/servlet/http/LocalStrings_fr.properties | 15 +++---
 java/javax/servlet/http/LocalStrings_ja.properties |  5 +-
 test/javax/el/TestArrayELResolver.java |  2 +-
 test/javax/el/TestBeanELResolver.java  |  2 +-
 test/javax/el/TestBeanNameELResolver.java  |  2 +-
 test/javax/el/TestImportHandler.java   |  4 +-
 test/javax/el/TestListELResolver.java  |  2 +-
 test/javax/el/TestMapELResolver.java   |  2 +-
 test/javax/el/TestResourceBundleELResolver.java|  2 +-
 test/javax/el/TestStaticFieldELResolver.java   |  2 +-
 test/javax/servlet/http/TestHttpServlet.java   | 62 ++
 webapps/docs/changelog.xml |  5 ++
 15 files changed, 109 insertions(+), 24 deletions(-)


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



[tomcat] 02/03: Ensure HEAD response is consistent with GET response for HttpServlet

2019-07-02 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

commit 8e204b92c45f2c2014af295b03c35cb1fab64878
Author: Mark Thomas 
AuthorDate: Tue Jul 2 21:15:56 2019 +0100

Ensure HEAD response is consistent with GET response for HttpServlet

Fix generation of the HEAD response when the GET response uses chunking
---
 java/javax/servlet/http/HttpServlet.java | 19 +++--
 test/javax/servlet/http/TestHttpServlet.java | 62 
 webapps/docs/changelog.xml   |  5 +++
 3 files changed, 82 insertions(+), 4 deletions(-)

diff --git a/java/javax/servlet/http/HttpServlet.java 
b/java/javax/servlet/http/HttpServlet.java
index f7ea58a..12a537a 100644
--- a/java/javax/servlet/http/HttpServlet.java
+++ b/java/javax/servlet/http/HttpServlet.java
@@ -758,7 +758,7 @@ class NoBodyResponse extends HttpServletResponseWrapper {
 // file private
 NoBodyResponse(HttpServletResponse r) {
 super(r);
-noBody = new NoBodyOutputStream();
+noBody = new NoBodyOutputStream(this);
 }
 
 // file private
@@ -847,11 +847,13 @@ class NoBodyOutputStream extends ServletOutputStream {
 private static final ResourceBundle lStrings =
 ResourceBundle.getBundle(LSTRING_FILE);
 
+private final HttpServletResponse response;
+private boolean flushed = false;
 private int contentLength = 0;
 
 // file private
-NoBodyOutputStream() {
-// NOOP
+NoBodyOutputStream(HttpServletResponse response) {
+this.response = response;
 }
 
 // file private
@@ -860,8 +862,9 @@ class NoBodyOutputStream extends ServletOutputStream {
 }
 
 @Override
-public void write(int b) {
+public void write(int b) throws IOException {
 contentLength++;
+checkCommit();
 }
 
 @Override
@@ -882,6 +885,7 @@ class NoBodyOutputStream extends ServletOutputStream {
 }
 
 contentLength += len;
+checkCommit();
 }
 
 @Override
@@ -894,4 +898,11 @@ class NoBodyOutputStream extends ServletOutputStream {
 public void setWriteListener(javax.servlet.WriteListener listener) {
 // TODO SERVLET 3.1
 }
+
+private void checkCommit() throws IOException {
+if (!flushed && contentLength > response.getBufferSize()) {
+response.flushBuffer();
+flushed = true;
+}
+}
 }
diff --git a/test/javax/servlet/http/TestHttpServlet.java 
b/test/javax/servlet/http/TestHttpServlet.java
index feca2c9..331a0f6 100644
--- a/test/javax/servlet/http/TestHttpServlet.java
+++ b/test/javax/servlet/http/TestHttpServlet.java
@@ -111,6 +111,51 @@ public class TestHttpServlet extends TomcatBaseTest {
 }
 
 
+@Test
+public void testChunkingWithHead() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+StandardContext ctx = (StandardContext) tomcat.addContext("", null);
+
+ChunkingServlet s = new ChunkingServlet();
+Tomcat.addServlet(ctx, "ChunkingServlet", s);
+ctx.addServletMappingDecoded("/chunking", "ChunkingServlet");
+
+tomcat.start();
+
+Map> getHeaders = new HashMap<>();
+String path = "http://localhost:; + getPort() + "/chunking";
+ByteChunk out = new ByteChunk();
+
+int rc = getUrl(path, out, getHeaders);
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+out.recycle();
+
+Map> headHeaders = new HashMap<>();
+rc = headUrl(path, out, headHeaders);
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+
+// Headers should be the same (apart from Date)
+Assert.assertEquals(getHeaders.size(), headHeaders.size());
+for (Map.Entry> getHeader : 
getHeaders.entrySet()) {
+String headerName = getHeader.getKey();
+if ("date".equalsIgnoreCase(headerName)) {
+continue;
+}
+Assert.assertTrue(headerName, headHeaders.containsKey(headerName));
+List getValues = getHeader.getValue();
+List headValues = headHeaders.get(headerName);
+Assert.assertEquals(getValues.size(), headValues.size());
+for (String value : getValues) {
+Assert.assertTrue(headValues.contains(value));
+}
+}
+
+tomcat.stop();
+}
+
+
 private static class Bug57602ServletOuter extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
@@ -141,4 +186,21 @@ public class TestHttpServlet extends TomcatBaseTest {
 pw.println("Included");
 }
 }
+
+
+private static class ChunkingServlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ 

[tomcat] 01/03: Code clean-up

2019-07-02 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

commit 46940e02675c631a48caa20554b84b59ffd1bbde
Author: Mark Thomas 
AuthorDate: Tue Jul 2 21:05:30 2019 +0100

Code clean-up
---
 test/javax/el/TestArrayELResolver.java  | 2 +-
 test/javax/el/TestBeanELResolver.java   | 2 +-
 test/javax/el/TestBeanNameELResolver.java   | 2 +-
 test/javax/el/TestImportHandler.java| 4 ++--
 test/javax/el/TestListELResolver.java   | 2 +-
 test/javax/el/TestMapELResolver.java| 2 +-
 test/javax/el/TestResourceBundleELResolver.java | 2 +-
 test/javax/el/TestStaticFieldELResolver.java| 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/test/javax/el/TestArrayELResolver.java 
b/test/javax/el/TestArrayELResolver.java
index ccad23e..cea9b97 100644
--- a/test/javax/el/TestArrayELResolver.java
+++ b/test/javax/el/TestArrayELResolver.java
@@ -385,7 +385,7 @@ public class TestArrayELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 
diff --git a/test/javax/el/TestBeanELResolver.java 
b/test/javax/el/TestBeanELResolver.java
index 6368ad5..7bd9bce 100644
--- a/test/javax/el/TestBeanELResolver.java
+++ b/test/javax/el/TestBeanELResolver.java
@@ -981,7 +981,7 @@ public class TestBeanELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE, INVOKE
 }
 
diff --git a/test/javax/el/TestBeanNameELResolver.java 
b/test/javax/el/TestBeanNameELResolver.java
index a7c90c6..f5ea30f 100644
--- a/test/javax/el/TestBeanNameELResolver.java
+++ b/test/javax/el/TestBeanNameELResolver.java
@@ -606,7 +606,7 @@ public class TestBeanNameELResolver {
 }
 
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE,
 SET_VALUE,
 GET_TYPE,
diff --git a/test/javax/el/TestImportHandler.java 
b/test/javax/el/TestImportHandler.java
index 0ddf708..537d80d 100644
--- a/test/javax/el/TestImportHandler.java
+++ b/test/javax/el/TestImportHandler.java
@@ -203,11 +203,11 @@ public class TestImportHandler {
 public void testImportStatic01() {
 ImportHandler handler = new ImportHandler();
 
-handler.importStatic("org.apache.tomcat.util.buf.Constants.Package");
+handler.importStatic("org.apache.tomcat.util.scan.Constants.Package");
 
 Class result = handler.resolveStatic("Package");
 
-Assert.assertEquals(org.apache.tomcat.util.buf.Constants.class, 
result);
+Assert.assertEquals(org.apache.tomcat.util.scan.Constants.class, 
result);
 }
 
 
diff --git a/test/javax/el/TestListELResolver.java 
b/test/javax/el/TestListELResolver.java
index cb9d574..60aea8c 100644
--- a/test/javax/el/TestListELResolver.java
+++ b/test/javax/el/TestListELResolver.java
@@ -381,7 +381,7 @@ public class TestListELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 
diff --git a/test/javax/el/TestMapELResolver.java 
b/test/javax/el/TestMapELResolver.java
index fa8bb63..1a87b7f 100644
--- a/test/javax/el/TestMapELResolver.java
+++ b/test/javax/el/TestMapELResolver.java
@@ -312,7 +312,7 @@ public class TestMapELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 }
diff --git a/test/javax/el/TestResourceBundleELResolver.java 
b/test/javax/el/TestResourceBundleELResolver.java
index 3f9ebc7..5acf029 100644
--- a/test/javax/el/TestResourceBundleELResolver.java
+++ b/test/javax/el/TestResourceBundleELResolver.java
@@ -321,7 +321,7 @@ public class TestResourceBundleELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 }
diff --git a/test/javax/el/TestStaticFieldELResolver.java 
b/test/javax/el/TestStaticFieldELResolver.java
index 7efa86d..3655865 100644
--- a/test/javax/el/TestStaticFieldELResolver.java
+++ b/test/javax/el/TestStaticFieldELResolver.java
@@ -483,7 +483,7 @@ public class TestStaticFieldELResolver {
 }
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE, INVOKE
 }
 }


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

[tomcat] 03/03: Expand i18n and update translations

2019-07-02 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

commit 6090dcf8571c0884ddcfd021d0180da32abb819d
Author: Mark Thomas 
AuthorDate: Tue Jul 2 21:17:29 2019 +0100

Expand i18n and update translations
---
 java/javax/servlet/http/HttpServlet.java   |  2 +-
 java/javax/servlet/http/LocalStrings.properties|  5 +++--
 java/javax/servlet/http/LocalStrings_es.properties |  2 +-
 java/javax/servlet/http/LocalStrings_fr.properties | 15 +--
 java/javax/servlet/http/LocalStrings_ja.properties |  5 -
 5 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/java/javax/servlet/http/HttpServlet.java 
b/java/javax/servlet/http/HttpServlet.java
index 12a537a..f28eac3 100644
--- a/java/javax/servlet/http/HttpServlet.java
+++ b/java/javax/servlet/http/HttpServlet.java
@@ -736,7 +736,7 @@ public abstract class HttpServlet extends GenericServlet {
 request = (HttpServletRequest) req;
 response = (HttpServletResponse) res;
 } catch (ClassCastException e) {
-throw new ServletException("non-HTTP request or response");
+throw new ServletException(lStrings.getString("http.non_http"));
 }
 service(request, response);
 }
diff --git a/java/javax/servlet/http/LocalStrings.properties 
b/java/javax/servlet/http/LocalStrings.properties
index aef4847..3ea5922 100644
--- a/java/javax/servlet/http/LocalStrings.properties
+++ b/java/javax/servlet/http/LocalStrings.properties
@@ -19,8 +19,9 @@ err.io.indexOutOfBounds=Invalid offset [{0}] and / or length 
[{1}] specified for
 err.io.nullArray=Null passed for byte array in write method
 err.io.short_read=Short Read
 
-http.method_delete_not_supported=Http method DELETE is not supported by this 
URL
+http.method_delete_not_supported=HTTP method DELETE is not supported by this 
URL
 http.method_get_not_supported=HTTP method GET is not supported by this URL
-http.method_not_implemented=Method [{0}] is not implemented by this servlet 
for this URI
+http.method_not_implemented=Method [{0}] is not implemented by this Servlet 
for this URI
 http.method_post_not_supported=HTTP method POST is not supported by this URL
 http.method_put_not_supported=HTTP method PUT is not supported by this URL
+http.non_http=Non HTTP request or response
diff --git a/java/javax/servlet/http/LocalStrings_es.properties 
b/java/javax/servlet/http/LocalStrings_es.properties
index c17c246..0b7972e 100644
--- a/java/javax/servlet/http/LocalStrings_es.properties
+++ b/java/javax/servlet/http/LocalStrings_es.properties
@@ -15,7 +15,7 @@
 
 err.cookie_name_blank=El nombre del Cookie no puede ser nulo o de longitud cero
 err.cookie_name_is_token=El nombre de Cookie [{0}] es una palabra reservada
-err.io.negativelength=Longitud Negativa en el metodo write
+err.io.nullArray=Se pasó un valor Null para el arreglo byte en el método de 
escritura
 err.io.short_read=Lectura Corta
 
 http.method_delete_not_supported=El Metodo HTTP DELETE no es soportado por 
esta URL
diff --git a/java/javax/servlet/http/LocalStrings_fr.properties 
b/java/javax/servlet/http/LocalStrings_fr.properties
index f7a07e7..cab2650 100644
--- a/java/javax/servlet/http/LocalStrings_fr.properties
+++ b/java/javax/servlet/http/LocalStrings_fr.properties
@@ -13,12 +13,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+err.cookie_name_blank=Le nom de cookie ne doit pas être null ou vide
 err.cookie_name_is_token=Le nom de cookie [{0}] est un "token" réservé
-err.io.negativelength=Taille négative donnée dans la méthode "write"
+err.io.indexOutOfBounds=L''offset [{0}] et/ou la longueur [{1}] spécifiés pour 
la taille du tableau [{2}] sont invalides
+err.io.nullArray=Null a été passée comme tableau d'octets à la méthode 
d'écriture
 err.io.short_read=Lecture partielle
 
-http.method_delete_not_supported=La méthode HTTP DELETE n''est pas supportée 
par cette URL
-http.method_get_not_supported=La méthode HTTP GET n''est pas supportée par 
cette URL
-http.method_not_implemented=Le méthode [{0}] n''est pas définie dans la RFC 
2068 et n''est pas supportée par l''API Servlet
-http.method_post_not_supported=La méthode HTTP POST n''est pas supportée par 
cette URL
-http.method_put_not_supported=La méthode HTTP PUT n''est pas supportée par 
cette URL
+http.method_delete_not_supported=La méthode HTTP DELETE n'est pas supportée 
par cette URL
+http.method_get_not_supported=La méthode HTTP GET n'est pas supportée par 
cette URL
+http.method_not_implemented=Le méthode [{0}] n''est pas implémentée par ce 
Servlet pour cette URI
+http.method_post_not_supported=La méthode HTTP POST n'est pas supportée par 
cette URL
+http.method_put_not_supported=La méthode HTTP PUT n'est pas supportée par 
cette URL
+http.non_http=Requête ou réponse non HTTP
diff --git 

[tomcat] branch 8.5.x updated: SpotBugs. Remove unnecessary code.

2019-07-02 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 e5a7bc9  SpotBugs. Remove unnecessary code.
e5a7bc9 is described below

commit e5a7bc93200f27b96fa31cc3e2f0476bf52d16ad
Author: Mark Thomas 
AuthorDate: Tue Jul 2 20:57:01 2019 +0100

SpotBugs. Remove unnecessary code.
---
 test/org/apache/catalina/startup/TestTomcat.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestTomcat.java 
b/test/org/apache/catalina/startup/TestTomcat.java
index 4c2330b..f4d89b1 100644
--- a/test/org/apache/catalina/startup/TestTomcat.java
+++ b/test/org/apache/catalina/startup/TestTomcat.java
@@ -31,7 +31,6 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -78,8 +77,7 @@ public class TestTomcat extends TomcatBaseTest {
 @Override
 public void doGet(HttpServletRequest req, HttpServletResponse res)
 throws IOException {
-HttpSession s = req.getSession(true);
-s.getId();
+req.getSession(true);
 res.getWriter().write("Hello world");
 }
 }


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



[tomcat] branch 8.5.x updated: Back-port Range, Content-Range and partial PUT improvements

2019-07-02 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 46ede0a  Back-port Range, Content-Range and partial PUT improvements
46ede0a is described below

commit 46ede0a876475e70ed341987e22e864b222b01bd
Author: Mark Thomas 
AuthorDate: Tue Jul 2 20:13:05 2019 +0100

Back-port Range, Content-Range and partial PUT improvements
---
 .../apache/catalina/servlets/DefaultServlet.java   | 195 ++---
 .../tomcat/util/http/parser/ContentRange.java  | 108 
 .../apache/tomcat/util/http/parser/HttpParser.java |  37 
 .../org/apache/tomcat/util/http/parser/Ranges.java | 124 +
 .../catalina/servlets/TestDefaultServletPut.java   | 185 +++
 .../servlets/TestDefaultServletRangeRequests.java  | 146 +++
 .../apache/catalina/startup/SimpleHttpClient.java  |  12 +-
 webapps/docs/changelog.xml |  21 +++
 8 files changed, 723 insertions(+), 105 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 87a9dcb..22f6058 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -80,6 +80,8 @@ import org.apache.catalina.util.URLEncoder;
 import org.apache.catalina.webresources.CachedResource;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.http.ResponseUtil;
+import org.apache.tomcat.util.http.parser.ContentRange;
+import org.apache.tomcat.util.http.parser.Ranges;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.Escape;
 import org.apache.tomcat.util.security.PrivilegedGetTccl;
@@ -150,6 +152,8 @@ public class DefaultServlet extends HttpServlet {
  */
 protected static final ArrayList FULL = new ArrayList<>();
 
+private static final Range IGNORE = new Range();
+
 /**
  * MIME multipart separation string
  */
@@ -277,6 +281,12 @@ public class DefaultServlet extends HttpServlet {
  */
 protected transient SortManager sortManager;
 
+/**
+ * Flag that indicates whether partial PUTs are permitted.
+ */
+private boolean allowPartialPut = true;
+
+
 // - Public Methods
 
 /**
@@ -377,6 +387,10 @@ public class DefaultServlet extends HttpServlet {
 sortManager = new SortManager(sortDirectoriesFirst);
 }
 }
+
+if (getServletConfig().getInitParameter("allowPartialPut") != null) {
+allowPartialPut = 
Boolean.parseBoolean(getServletConfig().getInitParameter("allowPartialPut"));
+}
 }
 
 private CompressionFormat[] parseCompressionFormats(String precompressed, 
String gzip) {
@@ -608,6 +622,11 @@ public class DefaultServlet extends HttpServlet {
 
 Range range = parseContentRange(req, resp);
 
+if (range == null) {
+// Processing error. parseContentRange() set the error code
+return;
+}
+
 InputStream resourceInputStream = null;
 
 try {
@@ -615,11 +634,11 @@ public class DefaultServlet extends HttpServlet {
 // resource - create a temp. file on the local filesystem to
 // perform this operation
 // Assume just one range is specified for now
-if (range != null) {
+if (range == IGNORE) {
+resourceInputStream = req.getInputStream();
+} else {
 File contentFile = executePartialPut(req, range, path);
 resourceInputStream = new FileInputStream(contentFile);
-} else {
-resourceInputStream = req.getInputStream();
 }
 
 if (resources.write(path, resourceInputStream, true)) {
@@ -915,7 +934,7 @@ public class DefaultServlet extends HttpServlet {
 }
 }
 
-ArrayList ranges = null;
+ArrayList ranges = FULL;
 long contentLength = -1L;
 
 if (resource.isDirectory()) {
@@ -941,6 +960,9 @@ public class DefaultServlet extends HttpServlet {
 
 // Parse range specifier
 ranges = parseRange(request, response, resource);
+if (ranges == null) {
+return;
+}
 
 // ETag header
 response.setHeader("ETag", eTag);
@@ -1019,12 +1041,7 @@ public class DefaultServlet extends HttpServlet {
 conversionRequired = false;
 }
 
-if (resource.isDirectory() ||
-isError ||
-( (ranges == null || ranges.isEmpty())
-&& request.getHeader("Range") == null ) ||
-ranges == FULL ) {
-
+if 

[GitHub] [tomcat] markt-asf commented on issue #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
markt-asf commented on issue #176: CoyoteAdapter: fix out-of-bounds read in 
checkNormalize
URL: https://github.com/apache/tomcat/pull/176#issuecomment-507753421
 
 
   Many thanks for raising this issue. I think we have tracked down the root 
cause and fixed it. Note that 7.0.x was not affected. I am, therefore, closing 
this PR. If we have missed something please feel free to re-open it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] markt-asf closed pull request #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
markt-asf closed pull request #176: CoyoteAdapter: fix out-of-bounds read in 
checkNormalize
URL: https://github.com/apache/tomcat/pull/176
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[tomcat] branch 8.5.x updated: Once a URI is identified as invalid don't attempt to process it further.

2019-07-02 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 64c2524  Once a URI is identified as invalid don't attempt to process 
it further.
64c2524 is described below

commit 64c25246996fd974953156113d990c2b4b92421e
Author: Mark Thomas 
AuthorDate: Tue Jul 2 17:27:20 2019 +0100

Once a URI is identified as invalid don't attempt to process it further.

Based on a PR by Alex Repert.
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 15 ---
 webapps/docs/changelog.xml|  4 
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index e94a3d7..ef7bfb9 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -637,13 +637,14 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI: " + ioe.getMessage());
 }
 // Normalization
-if (!normalize(req.decodedURI())) {
-response.sendError(400, "Invalid URI");
-}
-// Character decoding
-convertURI(decodedURI, request);
-// Check that the URI is still normalized
-if (!checkNormalize(req.decodedURI())) {
+if (normalize(req.decodedURI())) {
+// Character decoding
+convertURI(decodedURI, request);
+// Check that the URI is still normalized
+if (!checkNormalize(req.decodedURI())) {
+response.sendError(400, "Invalid URI");
+}
+} else {
 response.sendError(400, "Invalid URI");
 }
 } else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c0fcc2a..cc15118 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -89,6 +89,10 @@
 HTTPS connector configured to use NIO or NIO with OpenSSL 1.1.1 or
 later. (markt)
   
+  
+Once a URI is identified as invalid don't attempt to process it 
further.
+Based on a PR by Alex Repert. (markt)
+  
 
   
   


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



[tomcat] 01/02: Fix format

2019-07-02 Thread markt
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

commit 7836d4369c7f327341d957d78348fc20bd7f509c
Author: Mark Thomas 
AuthorDate: Tue Jul 2 17:25:18 2019 +0100

Fix format
---
 webapps/docs/changelog.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e8a582c..4764c97 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -81,7 +81,8 @@
 63523: Restore SSLUtilBase methods as protected to preserve
 compatibility. (remm)
   
-  Fix typo in UTF-32LE charset name. Patch by zhanhb vi Github.
+  
+Fix typo in UTF-32LE charset name. Patch by zhanhb vi Github.
 (fschumacher)
   
 


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



[tomcat] 02/02: Once a URI is identified as invalid don't attempt to process it further.

2019-07-02 Thread markt
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

commit c4136dfe2b71dc58b120591857ff21beee7e9c10
Author: Mark Thomas 
AuthorDate: Tue Jul 2 17:27:20 2019 +0100

Once a URI is identified as invalid don't attempt to process it further.

Based on a PR by Alex Repert.
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 15 ---
 webapps/docs/changelog.xml|  4 
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index c996803..3c28c13 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -637,13 +637,14 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI: " + ioe.getMessage());
 }
 // Normalization
-if (!normalize(req.decodedURI())) {
-response.sendError(400, "Invalid URI");
-}
-// Character decoding
-convertURI(decodedURI, request);
-// Check that the URI is still normalized
-if (!checkNormalize(req.decodedURI())) {
+if (normalize(req.decodedURI())) {
+// Character decoding
+convertURI(decodedURI, request);
+// Check that the URI is still normalized
+if (!checkNormalize(req.decodedURI())) {
+response.sendError(400, "Invalid URI");
+}
+} else {
 response.sendError(400, "Invalid URI");
 }
 } else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4764c97..bcce219 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -85,6 +85,10 @@
 Fix typo in UTF-32LE charset name. Patch by zhanhb vi Github.
 (fschumacher)
   
+  
+Once a URI is identified as invalid don't attempt to process it 
further.
+Based on a PR by Alex Repert. (markt)
+  
 
   
   


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



[tomcat] branch master updated (d1f5800 -> c4136df)

2019-07-02 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 d1f5800  Improve parsing of Content-Range headers
 new 7836d43  Fix format
 new c4136df  Once a URI is identified as invalid don't attempt to process 
it further.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/catalina/connector/CoyoteAdapter.java | 15 ---
 webapps/docs/changelog.xml|  7 ++-
 2 files changed, 14 insertions(+), 8 deletions(-)


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



[GitHub] [tomcat] markt-asf commented on a change in pull request #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
markt-asf commented on a change in pull request #176: CoyoteAdapter: fix 
out-of-bounds read in checkNormalize
URL: https://github.com/apache/tomcat/pull/176#discussion_r299572216
 
 

 ##
 File path: java/org/apache/catalina/connector/CoyoteAdapter.java
 ##
 @@ -1271,6 +1276,11 @@ public static boolean checkNormalize(MessageBytes 
uriMB) {
 }
 }
 
+// The URL must start with '/'
+if (c[start] != '/') {
+return false;
+}
+
 // Check for ending with "/." or "/.."
 
 Review comment:
   Agreed. I reached the same conclusion. I'll get that fixed shortly. Thanks 
for highlighting this.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] markt-asf commented on a change in pull request #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
markt-asf commented on a change in pull request #176: CoyoteAdapter: fix 
out-of-bounds read in checkNormalize
URL: https://github.com/apache/tomcat/pull/176#discussion_r299500242
 
 

 ##
 File path: java/org/apache/catalina/connector/CoyoteAdapter.java
 ##
 @@ -1271,6 +1276,11 @@ public static boolean checkNormalize(MessageBytes 
uriMB) {
 }
 }
 
+// The URL must start with '/'
+if (c[start] != '/') {
+return false;
+}
+
 // Check for ending with "/." or "/.."
 
 Review comment:
   Thanks. That is what I needed. That should be caught and rejected earlier. I 
wonder what is going wrong.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] alpire commented on a change in pull request #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
alpire commented on a change in pull request #176: CoyoteAdapter: fix 
out-of-bounds read in checkNormalize
URL: https://github.com/apache/tomcat/pull/176#discussion_r299503403
 
 

 ##
 File path: java/org/apache/catalina/connector/CoyoteAdapter.java
 ##
 @@ -1271,6 +1276,11 @@ public static boolean checkNormalize(MessageBytes 
uriMB) {
 }
 }
 
+// The URL must start with '/'
+if (c[start] != '/') {
+return false;
+}
+
 // Check for ending with "/." or "/.."
 
 Review comment:
   I was surprised to see that `checkNormalize` was still called when 
`normalize` returns false in postParseRequest. Maybe that'd be a better fix?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] alpire commented on a change in pull request #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
alpire commented on a change in pull request #176: CoyoteAdapter: fix 
out-of-bounds read in checkNormalize
URL: https://github.com/apache/tomcat/pull/176#discussion_r299498714
 
 

 ##
 File path: java/org/apache/catalina/connector/CoyoteAdapter.java
 ##
 @@ -1271,6 +1276,11 @@ public static boolean checkNormalize(MessageBytes 
uriMB) {
 }
 }
 
+// The URL must start with '/'
+if (c[start] != '/') {
+return false;
+}
+
 // Check for ending with "/." or "/.."
 
 Review comment:
   Sorry for the confusion. What I posted was the entire query, i.e. you can 
reproduce the issue with:
   ```
   $ echo -ne "\x20\x2e\x2e\x20\x30\x20\x0a" | nc localhost 8081
   HTTP/1.1 500
   Date: Tue, 02 Jul 2019 13:55:20 GMT
   Connection: close
   ```
   
   Looking more into it, you can also be reproduced with a normal looking HTTP 
query:
   ```
   $ echo -ne "GET .. HTTP/1.1\r\n\r\n" | nc localhost 8081
   ```
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



svn commit: r34731 - /dev/tomcat/tomcat-connectors/native/1.2.23/ /release/tomcat/tomcat-connectors/native/1.2.23/ /release/tomcat/tomcat-connectors/native/README.html

2019-07-02 Thread markt
Author: markt
Date: Tue Jul  2 13:59:15 2019
New Revision: 34731

Log:
Release Apache Tomcat Native 1.2.23

Added:
release/tomcat/tomcat-connectors/native/1.2.23/
  - copied from r34730, dev/tomcat/tomcat-connectors/native/1.2.23/
Removed:
dev/tomcat/tomcat-connectors/native/1.2.23/
Modified:
release/tomcat/tomcat-connectors/native/README.html

Modified: release/tomcat/tomcat-connectors/native/README.html
==
--- release/tomcat/tomcat-connectors/native/README.html (original)
+++ release/tomcat/tomcat-connectors/native/README.html Tue Jul  2 13:59:15 2019
@@ -1,4 +1,4 @@
 The Apache Tomcat Native
 
-The latest release version is 1.2.19
+The latest release version is 1.2.23
 



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



[GitHub] [tomcat] markt-asf commented on a change in pull request #176: CoyoteAdapter: fix out-of-bounds read in checkNormalize

2019-07-02 Thread GitBox
markt-asf commented on a change in pull request #176: CoyoteAdapter: fix 
out-of-bounds read in checkNormalize
URL: https://github.com/apache/tomcat/pull/176#discussion_r299493101
 
 

 ##
 File path: java/org/apache/catalina/connector/CoyoteAdapter.java
 ##
 @@ -1271,6 +1276,11 @@ public static boolean checkNormalize(MessageBytes 
uriMB) {
 }
 }
 
+// The URL must start with '/'
+if (c[start] != '/') {
+return false;
+}
+
 // Check for ending with "/." or "/.."
 
 Review comment:
   I don't see how that can trigger a 500. The request line:
   `GET  %20%2e%2e%20%30%20%0a HTTP/1.1`
   is going to result in a 400 response in all current Tomcat versions.
   Please provide a request line example that triggers the exception in the 
original report.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



Re: [VOTE][RESULT] Release Apache Tomcat Native 1.2.23

2019-07-02 Thread Mark Thomas
The following votes were cast:

Binding:
+1: markt, isapir, remm

No other votes were cast.

The vote therefore passes.

Thanks to everyone who contributed to this release.

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



[tomcat] 02/02: Fix a couple of Litmus test suite failures

2019-07-02 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

commit 0c1db4105cc577fca61d2e6f39e4d634bcaab57f
Author: Mark Thomas 
AuthorDate: Tue Jul 2 14:12:55 2019 +0100

Fix a couple of Litmus test suite failures
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +
 webapps/docs/changelog.xml   | 4 
 2 files changed, 9 insertions(+)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index bcc795d..1f477cb 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1825,6 +1825,11 @@ public class WebdavServlet extends DefaultServlet {
 } else {
 
 if (object instanceof Resource) {
+// WebDAV Litmus test attempts to copy/move a file over a 
collection
+// Need to remove trailing / from destination to enable test 
to pass
+if (dest.endsWith("/") && dest.length() > 1) {
+dest = dest.substring(0, dest.length() - 1);
+}
 try {
 dirContext.bind(dest, object);
 } catch (NamingException e) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0284199..46d3c79 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -135,6 +135,10 @@
 Allow header and a method listed in the Allow
 header will not return a 405 status code. (markt)
   
+  
+Correct two failing tests from the Litmus test suite for WebDAV when
+copying/moving a file over a collection. (markt)
+  
 
   
   


-
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 (07b0f95 -> 0c1db41)

2019-07-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 07b0f95  Align with 8.5.x. Remove unused keys, update/add translations
 new d2f21d5  Align with 8.5.x. Use i18n.
 new 0c1db41  Fix a couple of Litmus test suite failures

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/catalina/servlets/DefaultServlet.java| 2 +-
 java/org/apache/catalina/servlets/LocalStrings.properties| 1 +
 java/org/apache/catalina/servlets/LocalStrings_fr.properties | 1 +
 java/org/apache/catalina/servlets/LocalStrings_ja.properties | 1 +
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +
 webapps/docs/changelog.xml   | 4 
 6 files changed, 13 insertions(+), 1 deletion(-)


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



[tomcat] 01/02: Align with 8.5.x. Use i18n.

2019-07-02 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

commit d2f21d52a6d10f711e685aaae577c1663bd3d661
Author: Mark Thomas 
AuthorDate: Tue Jul 2 13:52:04 2019 +0100

Align with 8.5.x. Use i18n.
---
 java/org/apache/catalina/servlets/DefaultServlet.java| 2 +-
 java/org/apache/catalina/servlets/LocalStrings.properties| 1 +
 java/org/apache/catalina/servlets/LocalStrings_fr.properties | 1 +
 java/org/apache/catalina/servlets/LocalStrings_ja.properties | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 6821f66..5a5eddd 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1449,7 +1449,7 @@ public class DefaultServlet extends HttpServlet {
 osWriter.flush();
 return new ByteArrayInputStream(stream.toByteArray());
 } catch (TransformerException e) {
-throw new ServletException("XSL transformer error", e);
+throw new 
ServletException(sm.getString("defaultServlet.xslError"), e);
 } finally {
 if (Globals.IS_SECURITY_ENABLED) {
 PrivilegedSetTccl pa = new PrivilegedSetTccl(original);
diff --git a/java/org/apache/catalina/servlets/LocalStrings.properties 
b/java/org/apache/catalina/servlets/LocalStrings.properties
index 22adaa8..13a9d40 100644
--- a/java/org/apache/catalina/servlets/LocalStrings.properties
+++ b/java/org/apache/catalina/servlets/LocalStrings.properties
@@ -41,6 +41,7 @@ defaultServlet.blockExternalSubset=Blocked access to external 
subset with name [
 defaultServlet.missingResource=The requested resource [{0}] is not available
 defaultServlet.noResources=No static resources were found
 defaultServlet.skipfail=Read failed because only [{0}] bytes were available 
but needed to skip [{1}] bytes to reach the start of the requested range
+defaultServlet.xslError=XSL transformer error
 
 directory.filename=Filename
 directory.lastModified=Last Modified
diff --git a/java/org/apache/catalina/servlets/LocalStrings_fr.properties 
b/java/org/apache/catalina/servlets/LocalStrings_fr.properties
index 4ee5781..fdcb2ec 100644
--- a/java/org/apache/catalina/servlets/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/servlets/LocalStrings_fr.properties
@@ -41,6 +41,7 @@ defaultServlet.blockExternalSubset=L''accès au sous-ensemble 
externe de nom [{0
 defaultServlet.missingResource=La ressource demandée [{0}] n''est pas 
disponible
 defaultServlet.noResources=Pas de ressources statiques
 defaultServlet.skipfail=La lecture a échouée parce que seuls [{0}] octets 
étaient disponibles alors qu''il était nécessaire d''en sauter [{1}] pour 
atteindre le début de la plage demandée
+defaultServlet.xslError=Erreur de transformation XSL
 
 directory.filename=Nom de fichier
 directory.lastModified=Dernière modification
diff --git a/java/org/apache/catalina/servlets/LocalStrings_ja.properties 
b/java/org/apache/catalina/servlets/LocalStrings_ja.properties
index 7105faf..e3a35af 100644
--- a/java/org/apache/catalina/servlets/LocalStrings_ja.properties
+++ b/java/org/apache/catalina/servlets/LocalStrings_ja.properties
@@ -39,6 +39,7 @@ defaultServlet.blockExternalSubset=名前[{0}]およびベースURI [{1}]を持
 defaultServlet.missingResource=要求されたリソース [{0}] は利用できません。
 defaultServlet.noResources=静的リソースが見つかりません。
 
defaultServlet.skipfail=[{0}]バイトしか利用できなかったため、[{1}]バイトをスキップして要求された範囲の先頭に到達する必要があったため、読み取りに失敗しました。
+defaultServlet.xslError=XSL変換エラー
 
 directory.filename=ファイル名
 directory.lastModified=最終更新


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