Re: Very sporadic test failures in org.apache.catalina.core.TestAsyncContextImpl for TC 8.5 and 9
Thanks again, I will keep an eye on it. Am 15.03.24 um 20:43 schrieb Mark Thomas: On 08/03/2024 20:28, Rainer Jung wrote: Again, this is not a new failure and it happens extremely infrequent. Observed with JSSE on various Linux distributions and with various JVM versions and vendors. Only observed for TC 8.5 and 9, but for 10.1 and 11 the unit tests are run with much fewer JVM combinations so I can not exclude the problem might happen there as well. Looks like a timing issue when we have a non-container thread still accessing the AsyncContext (it shouldn't do that). The test acknowledged the problem but you found another fisalure mode that wasn't handled. It now is. Hopefully, these tests should be more reliable going forwards. Mark This info is not intended to prevent a release. The typical situation is: Testcase: testBug49567 took 21.162 sec FAILED expected:<...alse2true3true4true5[false]> but was:<...alse2true3true4true5[]> junit.framework.AssertionFailedError: expected:<...alse2true3true4true5[false]> but was:<...alse2true3true4true5[]> at org.apache.catalina.core.TestAsyncContextImpl.testBug49567(TestAsyncContextImpl.java:163) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) The execution log contains: 22-Feb-2024 11:19:03.617 INFO [main] org.apache.catalina.startup.LoggingBaseTest.setUp Starting test case [testBug49567] 22-Feb-2024 11:19:03.626 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-127.0.0.1-auto-11"] 22-Feb-2024 11:19:03.627 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Tomcat] 22-Feb-2024 11:19:03.627 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.86] 22-Feb-2024 11:19:03.640 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] Exception in thread "Thread-9" java.lang.NullPointerException: Cannot invoke "org.apache.catalina.connector.Request.getCoyoteRequest()" because "this.request" is null at org.apache.catalina.core.AsyncContextImpl.isStarted(AsyncContextImpl.java:295) at org.apache.catalina.connector.Request.isAsyncStarted(Request.java:1715) at org.apache.catalina.connector.RequestFacade.isAsyncStarted(RequestFacade.java:749) at org.apache.catalina.core.TestAsyncContextImpl$Bug49567Servlet$1$1.run(TestAsyncContextImpl.java:383) at java.base/java.lang.Thread.run(Thread.java:1583) 22-Feb-2024 11:19:24.685 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] 22-Feb-2024 11:19:24.693 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Tomcat] 22-Feb-2024 11:19:24.729 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] 22-Feb-2024 11:19:24.739 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] or as a variation: 08-Mar-2024 14:44:59.132 INFO [main] org.apache.catalina.startup.LoggingBaseTest.setUp Starting test case [testBug49528] 08-Mar-2024 14:44:59.141 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio2-127.0.0.1-auto-10"] 08-Mar-2024 14:44:59.151 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Tomcat] 08-Mar-2024 14:44:59.151 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.86sp1] 08-Mar-2024 14:44:59.170 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio2-127.0.0.1-auto-10-37101"] java.lang.NullPointerException: Cannot invoke "org.apache.catalina.connector.Request.getCoyoteRequest()" because "this.request" is null at org.apache.catalina.core.AsyncContextImpl.isStarted(AsyncContextImpl.java:295) at org.apache.catalina.connector.Request.isAsyncStarted(Request.java:1715) at org.apache.catalina.connector.RequestFacade.isAsyncStarted(RequestFacade.java:749) at org.apache.catalina.core.TestAsyncContextImpl$Bug49528Servlet$1.run(TestAsyncContextImpl.java:303) at org.apache.catalina.core.AsyncContextImpl$RunnableWrapper.run(AsyncContextImpl.java:543) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) at java.base/java.lang.Thread.run(Thread.java:1583) 08-Mar-2024 14:45:00.196 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio2-127.0.0.1-auto-10-37101"]
Buildbot success in on tomcat-9.0.x
Build status: Build succeeded! Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/37/builds/893 Blamelist: Christopher Schultz , Mark Thomas Build Text: build successful Status Detected: restored build Build Source Stamp: [branch 9.0.x] e788d61e00a9363a04fbc5c54a0a043637eceef4 Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 compile: 1 shell_6: 0 shell_7: 0 shell_8: 0 shell_9: 0 Rsync docs to nightlies.apache.org: 0 shell_10: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 1 shell_11: 0 Rsync Logs to nightlies.apache.org: 0 -- ASF Buildbot - 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: Update comment
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 b0dc6092ad Update comment b0dc6092ad is described below commit b0dc6092ad749c6b40d0e4b0cbe4cb710d9477e6 Author: Mark Thomas AuthorDate: Fri Mar 15 19:09:54 2024 + Update comment --- test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java index af239aca9c..6e18a2b1f7 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImpl.java +++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java @@ -376,7 +376,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest { // may be recycled at any point. Normally // there is enough time for this call to // complete but not always. If this call -// fails in Tomcat an NPE will result so +// fails in Tomcat an ISE will result so // handle this here with a hack. What we are // really checking here is that it does not // return true. - 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: Update comment
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 931998fdd1 Update comment 931998fdd1 is described below commit 931998fdd1d80dd7d0b6406d11729f672a63d031 Author: Mark Thomas AuthorDate: Fri Mar 15 19:09:54 2024 + Update comment --- test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java index 781ad73454..fe938dc155 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImpl.java +++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java @@ -376,7 +376,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest { // may be recycled at any point. Normally // there is enough time for this call to // complete but not always. If this call -// fails in Tomcat an NPE will result so +// fails in Tomcat an ISE will result so // handle this here with a hack. What we are // really checking here is that it does not // return true. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Very sporadic test failures in org.apache.catalina.core.TestAsyncContextImpl for TC 8.5 and 9
On 08/03/2024 20:28, Rainer Jung wrote: Again, this is not a new failure and it happens extremely infrequent. Observed with JSSE on various Linux distributions and with various JVM versions and vendors. Only observed for TC 8.5 and 9, but for 10.1 and 11 the unit tests are run with much fewer JVM combinations so I can not exclude the problem might happen there as well. Looks like a timing issue when we have a non-container thread still accessing the AsyncContext (it shouldn't do that). The test acknowledged the problem but you found another fisalure mode that wasn't handled. It now is. Hopefully, these tests should be more reliable going forwards. Mark This info is not intended to prevent a release. The typical situation is: Testcase: testBug49567 took 21.162 sec FAILED expected:<...alse2true3true4true5[false]> but was:<...alse2true3true4true5[]> junit.framework.AssertionFailedError: expected:<...alse2true3true4true5[false]> but was:<...alse2true3true4true5[]> at org.apache.catalina.core.TestAsyncContextImpl.testBug49567(TestAsyncContextImpl.java:163) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) The execution log contains: 22-Feb-2024 11:19:03.617 INFO [main] org.apache.catalina.startup.LoggingBaseTest.setUp Starting test case [testBug49567] 22-Feb-2024 11:19:03.626 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-127.0.0.1-auto-11"] 22-Feb-2024 11:19:03.627 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Tomcat] 22-Feb-2024 11:19:03.627 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.86] 22-Feb-2024 11:19:03.640 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] Exception in thread "Thread-9" java.lang.NullPointerException: Cannot invoke "org.apache.catalina.connector.Request.getCoyoteRequest()" because "this.request" is null at org.apache.catalina.core.AsyncContextImpl.isStarted(AsyncContextImpl.java:295) at org.apache.catalina.connector.Request.isAsyncStarted(Request.java:1715) at org.apache.catalina.connector.RequestFacade.isAsyncStarted(RequestFacade.java:749) at org.apache.catalina.core.TestAsyncContextImpl$Bug49567Servlet$1$1.run(TestAsyncContextImpl.java:383) at java.base/java.lang.Thread.run(Thread.java:1583) 22-Feb-2024 11:19:24.685 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] 22-Feb-2024 11:19:24.693 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Tomcat] 22-Feb-2024 11:19:24.729 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] 22-Feb-2024 11:19:24.739 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-127.0.0.1-auto-11-46529"] or as a variation: 08-Mar-2024 14:44:59.132 INFO [main] org.apache.catalina.startup.LoggingBaseTest.setUp Starting test case [testBug49528] 08-Mar-2024 14:44:59.141 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio2-127.0.0.1-auto-10"] 08-Mar-2024 14:44:59.151 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Tomcat] 08-Mar-2024 14:44:59.151 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.86sp1] 08-Mar-2024 14:44:59.170 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio2-127.0.0.1-auto-10-37101"] java.lang.NullPointerException: Cannot invoke "org.apache.catalina.connector.Request.getCoyoteRequest()" because "this.request" is null at org.apache.catalina.core.AsyncContextImpl.isStarted(AsyncContextImpl.java:295) at org.apache.catalina.connector.Request.isAsyncStarted(Request.java:1715) at org.apache.catalina.connector.RequestFacade.isAsyncStarted(RequestFacade.java:749) at org.apache.catalina.core.TestAsyncContextImpl$Bug49528Servlet$1.run(TestAsyncContextImpl.java:303) at org.apache.catalina.core.AsyncContextImpl$RunnableWrapper.run(AsyncContextImpl.java:543) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) at java.base/java.lang.Thread.run(Thread.java:1583) 08-Mar-2024 14:45:00.196 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio2-127.0.0.1-auto-10-37101"] 08-Mar-2024 14:45:00.198 INFO [main]
(tomcat) branch 8.5.x updated: Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled
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 2b0ef3ca6b Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled 2b0ef3ca6b is described below commit 2b0ef3ca6beda6f4b9633aebcd7532fa23e60c84 Author: Mark Thomas AuthorDate: Fri Mar 15 19:37:48 2024 + Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled Note: test failure is intermittent --- java/org/apache/catalina/core/AsyncContextImpl.java | 2 ++ webapps/docs/changelog.xml | 6 ++ 2 files changed, 8 insertions(+) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index a61ed7c0f2..34970a7c77 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -292,6 +292,8 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { public boolean isStarted() { AtomicBoolean result = new AtomicBoolean(false); +Request request = this.request; +check(); request.getCoyoteRequest().action(ActionCode.ASYNC_IS_STARTED, result); return result.get(); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index bf466d1113..b9c69bc6a4 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -139,6 +139,12 @@ build-date to the SecurityListener, and log a warning if the server is old. (schultz) + +When using the AsyncContext, throw an +IllegalStateException, rather than allowing an +NullPointerException, if an attempt is made to use the +AsyncContext after it has been recycled. (markt) + - 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: Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled
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 9af43f9980 Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled 9af43f9980 is described below commit 9af43f9980ad9e1f6f21afdee712ee26474d44fa Author: Mark Thomas AuthorDate: Fri Mar 15 19:37:48 2024 + Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled Note: test failure is intermittent --- java/org/apache/catalina/core/AsyncContextImpl.java | 2 ++ webapps/docs/changelog.xml | 6 ++ 2 files changed, 8 insertions(+) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 21a832bc13..52bddba3b9 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -292,6 +292,8 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { public boolean isStarted() { AtomicBoolean result = new AtomicBoolean(false); +Request request = this.request; +check(); request.getCoyoteRequest().action(ActionCode.ASYNC_IS_STARTED, result); return result.get(); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index c79852f6ea..538bd09ad0 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -118,6 +118,12 @@ build-date to the SecurityListener, and log a warning if the server is old. (schultz) + +When using the AsyncContext, throw an +IllegalStateException, rather than allowing an +NullPointerException, if an attempt is made to use the +AsyncContext after it has been recycled. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 63aea1057ed68d74e12a0e340a88b99036ecfc47 Author: Mark Thomas AuthorDate: Fri Mar 15 19:37:48 2024 + Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled Note: test failure is intermittent --- java/org/apache/catalina/core/AsyncContextImpl.java | 2 ++ webapps/docs/changelog.xml | 6 ++ 2 files changed, 8 insertions(+) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 0840b7a61e..210d29a356 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -293,6 +293,8 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { public boolean isStarted() { AtomicBoolean result = new AtomicBoolean(false); +Request request = this.request; +check(); request.getCoyoteRequest().action(ActionCode.ASYNC_IS_STARTED, result); return result.get(); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index d26fdd6813..96e1e9ef1a 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -161,6 +161,12 @@ build-date to the SecurityListener, and log a warning if the server is old. (schultz) + +When using the AsyncContext, throw an +IllegalStateException, rather than allowing an +NullPointerException, if an attempt is made to use the +AsyncContext after it has been recycled. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated (4380bc0078 -> 63aea1057e)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 4380bc0078 Add ignores for vi swap files. new 38df16c3b9 Update comment new 63aea1057e Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled 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/core/AsyncContextImpl.java | 2 ++ test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +- webapps/docs/changelog.xml | 6 ++ 3 files changed, 9 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: Update comment
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 38df16c3b9bd72aafa809349b6c7bee77286a475 Author: Mark Thomas AuthorDate: Fri Mar 15 19:09:54 2024 + Update comment --- test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java index df97ff592f..fa89a1bf7c 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImpl.java +++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java @@ -376,7 +376,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest { // may be recycled at any point. Normally // there is enough time for this call to // complete but not always. If this call -// fails in Tomcat an NPE will result so +// fails in Tomcat an ISE will result so // handle this here with a hack. What we are // really checking here is that it does not // return true. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled
This is an automated email from the ASF dual-hosted git repository. markt 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 a4f27a6509 Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled a4f27a6509 is described below commit a4f27a65094bfcec8ed8c757b531a41cfc08c7f4 Author: Mark Thomas AuthorDate: Fri Mar 15 19:37:48 2024 + Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled Note: test failure is intermittent --- java/org/apache/catalina/core/AsyncContextImpl.java | 2 ++ webapps/docs/changelog.xml | 6 ++ 2 files changed, 8 insertions(+) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 832e9b61bc..f2a1a3487e 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -292,6 +292,8 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { public boolean isStarted() { AtomicBoolean result = new AtomicBoolean(false); +Request request = this.request; +check(); request.getCoyoteRequest().action(ActionCode.ASYNC_IS_STARTED, result); return result.get(); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 981ae76a04..07f1af22c5 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -118,6 +118,12 @@ build-date to the SecurityListener, and log a warning if the server is old. (schultz) + +When using the AsyncContext, throw an +IllegalStateException, rather than allowing an +NullPointerException, if an attempt is made to use the +AsyncContext after it has been recycled. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Update comment
This is an automated email from the ASF dual-hosted git repository. markt 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 c0cb9b3b00 Update comment c0cb9b3b00 is described below commit c0cb9b3b008b4729661118fc6146e0521976e4da Author: Mark Thomas AuthorDate: Fri Mar 15 19:09:54 2024 + Update comment --- test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java index db6289e79f..c22321e803 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImpl.java +++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java @@ -376,7 +376,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest { // may be recycled at any point. Normally // there is enough time for this call to // complete but not always. If this call -// fails in Tomcat an NPE will result so +// fails in Tomcat an ISE will result so // handle this here with a hack. What we are // really checking here is that it does not // return true. - 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: Correct section title
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 e788d61e00 Correct section title e788d61e00 is described below commit e788d61e00a9363a04fbc5c54a0a043637eceef4 Author: Mark Thomas AuthorDate: Fri Mar 15 17:01:47 2024 + Correct section title --- webapps/docs/changelog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 2fca56cc59..c79852f6ea 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -120,7 +120,7 @@ - + Add threadsMaxIdleTime attribute to the endpoint, - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/04: Refactor the internal representation of the HttpOnly and Secure
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 4ca2a66d6203ce7843fbaa9fd47be82cba477781 Author: Mark Thomas AuthorDate: Fri Mar 15 17:15:03 2024 + Refactor the internal representation of the HttpOnly and Secure Use the empty string as the value This is for consistency with the recent changes to Set-Cookie header generation --- java/jakarta/servlet/http/Cookie.java | 10 ++ webapps/docs/changelog.xml| 6 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/java/jakarta/servlet/http/Cookie.java b/java/jakarta/servlet/http/Cookie.java index 22ddc5d3ff..5c52a59d47 100644 --- a/java/jakarta/servlet/http/Cookie.java +++ b/java/jakarta/servlet/http/Cookie.java @@ -54,6 +54,8 @@ public class Cookie implements Cloneable, Serializable { private static final CookieNameValidator validation = new RFC6265Validator(); +private static final String EMPTY_STRING = ""; + private static final long serialVersionUID = 2L; /** @@ -238,7 +240,7 @@ public class Cookie implements Cloneable, Serializable { * @see #getSecure */ public void setSecure(boolean flag) { -setAttributeInternal(SECURE, Boolean.toString(flag)); +setAttributeInternal(SECURE, EMPTY_STRING); } @@ -251,7 +253,7 @@ public class Cookie implements Cloneable, Serializable { * @see #setSecure */ public boolean getSecure() { -return Boolean.parseBoolean(getAttribute(SECURE)); +return EMPTY_STRING.equals(getAttribute(SECURE)); } @@ -347,7 +349,7 @@ public class Cookie implements Cloneable, Serializable { * @since Servlet 3.0 */ public void setHttpOnly(boolean httpOnly) { -setAttributeInternal(HTTP_ONLY, Boolean.toString(httpOnly)); +setAttributeInternal(HTTP_ONLY, EMPTY_STRING); } @@ -359,7 +361,7 @@ public class Cookie implements Cloneable, Serializable { * @since Servlet 3.0 */ public boolean isHttpOnly() { -return Boolean.parseBoolean(getAttribute(HTTP_ONLY)); +return EMPTY_STRING.equals(getAttribute(HTTP_ONLY)); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 042b5376d7..d8b9343f15 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -135,6 +135,12 @@ equals sign or value. This will simplify future support for similar new attributes by removing the need for special handling. (markt) + +Refactor the internal representation of the HttpOnly and +Secure attributes to use the empty string as the value for +consistency with the recent changes to Set-Cookie header +generation. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/04: Output cookie attributes with the value "" as bare attribute names
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 8b766b3ce2d3942a1a3027a8902df010eb9589d5 Author: Mark Thomas AuthorDate: Fri Mar 15 17:12:20 2024 + Output cookie attributes with the value "" as bare attribute names e.g. ...; Partitioned; Secure; HttpOnly; SomeNewAttribute;... This will simplify future support for similar new attributes by removing the need for special handling. --- java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java | 10 +++--- webapps/docs/changelog.xml | 7 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java index 05a712ecb5..acdec29e78 100644 --- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java +++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java @@ -41,6 +41,8 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase { private static final StringManager sm = StringManager.getManager(Rfc6265CookieProcessor.class.getPackage().getName()); +private static final String EMPTY_STRING = ""; + private static final BitSet domainValid = new BitSet(128); static { @@ -183,7 +185,7 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase { header.append("; Partitioned"); } } else { -if (Boolean.parseBoolean(cookiePartitioned)) { +if (EMPTY_STRING.equals(cookiePartitioned)) { header.append("; Partitioned"); } } @@ -206,8 +208,10 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase { validateAttribute(entry.getKey(), entry.getValue()); header.append("; "); header.append(entry.getKey()); -header.append('='); -header.append(entry.getValue()); +if (!EMPTY_STRING.equals(entry.getValue())) { +header.append('='); +header.append(entry.getValue()); +} } } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 1f7c2bf776..042b5376d7 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -128,6 +128,13 @@ will scale back to the configured minSpareThreads size. (remm) + +Adjust the Set-Cookie header generated by the +Rfc6265CookieProcessor so that attributes with a value of +the empty string will be output as bare attribute names without an +equals sign or value. This will simplify future support for similar new +attributes by removing the need for special handling. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 04/04: Don't use Max-Age=0 in Set-Cookie headers
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d16e846c4538ea9d4904cd2d74db41f0a7bcf3a6 Author: Mark Thomas AuthorDate: Fri Mar 15 17:18:31 2024 + Don't use Max-Age=0 in Set-Cookie headers --- .../tomcat/util/http/Rfc6265CookieProcessor.java | 26 +++--- .../util/http/TestCookieProcessorGeneration.java | 13 +-- webapps/docs/changelog.xml | 6 + 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java index acdec29e78..e8227a6d0d 100644 --- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java +++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java @@ -121,28 +121,28 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase { header.append(value); } -// RFC 6265 prefers Max-Age to Expires but... (see below) +/* + * RFC 6265 prefers Max-Age to Expires but some browsers including Microsoft IE and Microsoft Edge don't + * understand Max-Age so send expires as well. Without this, persistent cookies fail with those browsers. + */ int maxAge = cookie.getMaxAge(); -if (maxAge > -1) { -// Negative Max-Age is equivalent to no Max-Age -header.append("; Max-Age="); -header.append(maxAge); - -// Microsoft IE and Microsoft Edge don't understand Max-Age so send -// expires as well. Without this, persistent cookies fail with those -// browsers. See http://tomcat.markmail.org/thread/g6sipbofsjossacn -// Wdy, DD-Mon-YY HH:MM:SS GMT ( Expires Netscape format ) +// Negative Max-Age is equivalent to no Max-Age +if (maxAge > -1) { header.append("; Expires="); -// To expire immediately we need to set the time in past if (maxAge == 0) { +// To expire immediately we need to set the time in past header.append(ANCIENT_DATE); } else { -COOKIE_DATE_FORMAT.get().format(new Date(System.currentTimeMillis() + maxAge * 1000L), header, -new FieldPosition(0)); +COOKIE_DATE_FORMAT.get().format( +new Date(System.currentTimeMillis() + maxAge * 1000L), header, new FieldPosition(0)); + +header.append("; Max-Age="); +header.append(maxAge); } } + String domain = cookie.getDomain(); if (domain != null && domain.length() > 0) { validateDomain(domain); diff --git a/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java b/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java index 3079f423f8..e56a5aa675 100644 --- a/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java +++ b/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java @@ -110,7 +110,7 @@ public class TestCookieProcessorGeneration { @Test public void testMaxAgeZero() { -doTestMaxAge(0, "foo=bar; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT"); +doTestMaxAge(0, "foo=bar; Expires=Thu, 01 Jan 1970 00:00:10 GMT"); } @Test @@ -267,7 +267,16 @@ public class TestCookieProcessorGeneration { cookie.getMaxAge() > 0) { // Expires attribute will depend on time cookie is generated so // use a modified test -Assert.assertTrue(cookieProcessor.generateHeader(cookie, null).startsWith(expected)); +String result = cookieProcessor.generateHeader(cookie, null); +int posExpiresStart = result.indexOf("Expires"); +if (posExpiresStart > -1) { +int posExpiresEnd = result.indexOf(';', posExpiresStart); +if (posExpiresEnd > -1) { +// Expires was not at the end of the header - remove it +result = result.substring(0, posExpiresStart -1) + result.substring(posExpiresEnd + 1); +} +} +Assert.assertTrue(result.startsWith(expected)); } else { Assert.assertEquals(expected, cookieProcessor.generateHeader(cookie, null)); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index d8b9343f15..981ae76a04 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -141,6 +141,12 @@ consistency with the recent changes to Set-Cookie header generation. (markt) + +Do not generate the Max-Age attribute for +Set-Cookie headers associated with cookies that have been +
(tomcat) 01/04: Correct section title
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 3e1113dcf764f90bf1720c752667641a6a972e1e Author: Mark Thomas AuthorDate: Fri Mar 15 17:01:47 2024 + Correct section title --- webapps/docs/changelog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index f945649b0c..1f7c2bf776 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -120,7 +120,7 @@ - + Add threadsMaxIdleTime attribute to the endpoint, - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated (0fc30f2434 -> d16e846c45)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git from 0fc30f2434 Add ignores for vi swap files. new 3e1113dcf7 Correct section title new 8b766b3ce2 Output cookie attributes with the value "" as bare attribute names new 4ca2a66d62 Refactor the internal representation of the HttpOnly and Secure new d16e846c45 Don't use Max-Age=0 in Set-Cookie headers The 4 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/jakarta/servlet/http/Cookie.java | 10 +++--- .../tomcat/util/http/Rfc6265CookieProcessor.java | 36 -- .../util/http/TestCookieProcessorGeneration.java | 13 ++-- webapps/docs/changelog.xml | 21 - 4 files changed, 57 insertions(+), 23 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [PR] Unify comma-separated-value code and optimize the implementation [tomcat]
Mark, On 3/15/24 13:27, markt-asf (via GitHub) wrote: markt-asf commented on code in PR #707: URL: https://github.com/apache/tomcat/pull/707#discussion_r1526610303 ## java/org/apache/catalina/realm/JNDIRealm.java: ## @@ -966,7 +967,7 @@ private String[] getCipherSuitesArray() { containerLog.warn(sm.getString("jndiRealm.emptyCipherSuites")); this.cipherSuitesArray = null; } else { -this.cipherSuitesArray = cipherSuites.trim().split("\\s*,\\s*"); +this.cipherSuitesArray = StringUtils.splitCommaSeparated(cipherSuites.trim()); if (containerLog.isTraceEnabled()) { Review Comment: Is this trim necessary here? I know it was there before but it looks redundant. Looking back, it does make sense to remove this. I was thinking that as I wrote it, but the trim was technically necessary before the change from regex to split-then-trim. I'll shave off this sharp edge. ## java/org/apache/tomcat/util/buf/StringUtils.java: ## @@ -94,4 +94,28 @@ public static void join(Iterable iterable, char separator, Function Checkstyle was happy enough. :) I'll get that corrected. -chris - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [PR] Unify comma-separated-value code and optimize the implementation [tomcat]
markt-asf commented on code in PR #707: URL: https://github.com/apache/tomcat/pull/707#discussion_r1526610303 ## java/org/apache/catalina/realm/JNDIRealm.java: ## @@ -966,7 +967,7 @@ private String[] getCipherSuitesArray() { containerLog.warn(sm.getString("jndiRealm.emptyCipherSuites")); this.cipherSuitesArray = null; } else { -this.cipherSuitesArray = cipherSuites.trim().split("\\s*,\\s*"); +this.cipherSuitesArray = StringUtils.splitCommaSeparated(cipherSuites.trim()); if (containerLog.isTraceEnabled()) { Review Comment: Is this trim necessary here? I know it was there before but it looks redundant. ## java/org/apache/tomcat/util/buf/StringUtils.java: ## @@ -94,4 +94,28 @@ public static void join(Iterable iterable, char separator, Function
Buildbot failure in on tomcat-9.0.x
Build status: BUILD FAILED: failed compile (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/37/builds/892 Blamelist: Christopher Schultz Build Text: failed compile (failure) Status Detected: new failure Build Source Stamp: [branch 9.0.x] 912a5e14112b104ab38d26c66971a7f6b19fe251 Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 compile: 1 shell_6: 0 shell_7: 0 shell_8: 0 shell_9: 0 Rsync docs to nightlies.apache.org: 0 shell_10: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 2 shell_11: 0 Rsync Logs to nightlies.apache.org: 0 -- ASF Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[PR] Unify comma-separated-value code and optimize the implementation [tomcat]
ChristopherSchultz opened a new pull request, #707: URL: https://github.com/apache/tomcat/pull/707 There was repeated code in various places in the source tree to spit simple comma-separated strings using the regular expression pattern `\s*,\s*`. This PR gathers those together into a single utility method and re-implements that method without using a regular expression which improves performance. Given that this method is often used on request headers, the aggregate performance improvement over many requests is measurable especially for long strings, strings with many components, etc. Implementation note: there is a subtle change to the behavior of this utility method relative to the original: this _new_ method results in the first and last strings being "trimmed" of whitespace while the _old_ implementation would have preserved leading whitespace in the first string value returned and trailing whitespace in the last string returned. Reviewing the uses of this method, I do not believe this will have any negative effects on the operation of Tomcat. -- 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. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - 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 (662c3ca71e -> 912a5e1411)
This is an automated email from the ASF dual-hosted git repository. schultz pushed a change to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 662c3ca71e Remove temporary file. new 07e07b9d1f Remove another temporary file. new 912a5e1411 Add ignores for vi swap files. 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: .gitignore | 1 + .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100644 java/org/apache/catalina/security/.SecurityListener.java.swp - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Remove another temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit dc340dd861b6d843d60c9716718bda96b1a5a590 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:42:33 2024 -0400 Remove another temporary file. --- .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp deleted file mode 100644 index 5d9801fde0..00 Binary files a/java/org/apache/catalina/security/.SecurityListener.java.swp and /dev/null differ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Add ignores for vi swap files.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 912a5e14112b104ab38d26c66971a7f6b19fe251 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:46:47 2024 -0400 Add ignores for vi swap files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f98bf12697..41cd573f4f 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ mvn.properties *.asc *.jj *.tmp +.*.s[a-w][a-z] maven-resolver-ant-tasks-*.jar thumbs.db Thumbs.db - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Add ignores for vi swap files.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 4380bc0078efb371393d7e770bd7c73fbb4750d3 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:46:47 2024 -0400 Add ignores for vi swap files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f98bf12697..41cd573f4f 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ mvn.properties *.asc *.jj *.tmp +.*.s[a-w][a-z] maven-resolver-ant-tasks-*.jar thumbs.db Thumbs.db - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Remove another temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 07e07b9d1f0fd23722277aceb00faefd7d070296 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:42:33 2024 -0400 Remove another temporary file. --- .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp deleted file mode 100644 index 5d9801fde0..00 Binary files a/java/org/apache/catalina/security/.SecurityListener.java.swp and /dev/null differ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated (eb96a7c943 -> 4380bc0078)
This is an automated email from the ASF dual-hosted git repository. schultz pushed a change to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from eb96a7c943 Remove temporary file. new dc340dd861 Remove another temporary file. new 4380bc0078 Add ignores for vi swap files. 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: .gitignore | 1 + .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100644 java/org/apache/catalina/security/.SecurityListener.java.swp - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Remove another temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit a5ed54fe2086a07fe44bbdcb2ba3fcaddcf9cc64 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:42:33 2024 -0400 Remove another temporary file. --- .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp deleted file mode 100644 index 5d9801fde0..00 Binary files a/java/org/apache/catalina/security/.SecurityListener.java.swp and /dev/null differ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Add ignores for vi swap files.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 0fc30f2434861d410097415baecaa02ed70938b7 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:46:47 2024 -0400 Add ignores for vi swap files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ba6d197deb..3e0daf152d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ mvn.properties *.iws *.jj *.tmp +.*.s[a-w][a-z] maven-resolver-ant-tasks-*.jar thumbs.db Thumbs.db - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated (d0209ec703 -> 0fc30f2434)
This is an automated email from the ASF dual-hosted git repository. schultz pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git from d0209ec703 Remove temporary file. new a5ed54fe20 Remove another temporary file. new 0fc30f2434 Add ignores for vi swap files. 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: .gitignore | 1 + .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100644 java/org/apache/catalina/security/.SecurityListener.java.swp - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/03: Remove temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit f360a47502df9639e20cff96996357c4349be70a Author: Christopher Schultz AuthorDate: Fri Mar 15 09:38:42 2024 -0400 Remove temporary file. --- webapps/docs/config/.listeners.xml.swp | Bin 45056 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/webapps/docs/config/.listeners.xml.swp b/webapps/docs/config/.listeners.xml.swp deleted file mode 100644 index 1640f231dd..00 Binary files a/webapps/docs/config/.listeners.xml.swp and /dev/null differ - 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 (0675222e36 -> d1bb3ae1b8)
This is an automated email from the ASF dual-hosted git repository. schultz pushed a change to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 0675222e36 Correctly handle tag libraries packaged in JARs in a WAR deployment new 5ff54bf7aa Allow build-age check to be disabled, and disable it by default. new f360a47502 Remove temporary file. new d1bb3ae1b8 Change default build-age warning from (disabled) to 180 days for final 8.5.x releases. 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: .../apache/catalina/security/SecurityListener.java | 28 +- .../backend/Sender.java => util/StringUtil.java} | 34 +++--- webapps/docs/config/listeners.xml | 1 + 3 files changed, 33 insertions(+), 30 deletions(-) copy java/org/apache/catalina/{ha/backend/Sender.java => util/StringUtil.java} (54%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/03: Change default build-age warning from (disabled) to 180 days for final 8.5.x releases.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d1bb3ae1b876814b7e87134b407d1b37beb83b1a Author: Christopher Schultz AuthorDate: Fri Mar 15 09:41:52 2024 -0400 Change default build-age warning from (disabled) to 180 days for final 8.5.x releases. --- .../apache/catalina/security/.SecurityListener.java.swp | Bin 20480 -> 0 bytes java/org/apache/catalina/security/SecurityListener.java | 2 +- webapps/docs/config/listeners.xml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp deleted file mode 100644 index 5d9801fde0..00 Binary files a/java/org/apache/catalina/security/.SecurityListener.java.swp and /dev/null differ diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java index 7917b9a6a4..a2b418ebd2 100644 --- a/java/org/apache/catalina/security/SecurityListener.java +++ b/java/org/apache/catalina/security/SecurityListener.java @@ -47,7 +47,7 @@ public class SecurityListener implements LifecycleListener { private static final String UMASK_FORMAT = "%04o"; -private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = -1; +private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = 180; /** * The list of operating system users not permitted to run Tomcat. diff --git a/webapps/docs/config/listeners.xml b/webapps/docs/config/listeners.xml index 99877fa160..5d17e0425f 100644 --- a/webapps/docs/config/listeners.xml +++ b/webapps/docs/config/listeners.xml @@ -468,7 +468,7 @@ The maximim number of days between the build-date of this instance of Tomcat and its startup date can be before warnings will be logged. Set to anything less than 0 (e.g. -1) to disable this check. -If not specified, the default value of -1 is used. +If not specified, the default value of 180 is used. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/03: Allow build-age check to be disabled, and disable it by default.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 5ff54bf7aa01f29ec2d0ed15be1259bbdf576aa0 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:37:27 2024 -0400 Allow build-age check to be disabled, and disable it by default. --- .../catalina/security/.SecurityListener.java.swp | Bin 0 -> 20480 bytes .../apache/catalina/security/SecurityListener.java | 30 +++--- java/org/apache/catalina/util/StringUtil.java | 43 + webapps/docs/config/.listeners.xml.swp | Bin 0 -> 45056 bytes webapps/docs/config/listeners.xml | 3 +- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp new file mode 100644 index 00..5d9801fde0 Binary files /dev/null and b/java/org/apache/catalina/security/.SecurityListener.java.swp differ diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java index e92f7fbbc4..7917b9a6a4 100644 --- a/java/org/apache/catalina/security/SecurityListener.java +++ b/java/org/apache/catalina/security/SecurityListener.java @@ -47,7 +47,7 @@ public class SecurityListener implements LifecycleListener { private static final String UMASK_FORMAT = "%04o"; -private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = 180; +private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = -1; /** * The list of operating system users not permitted to run Tomcat. @@ -221,24 +221,26 @@ public class SecurityListener implements LifecycleListener { } protected void checkServerBuildAge() { -String buildDateString = ServerInfo.getServerBuiltISO(); +int allowedAgeDays = getBuildDateWarningAgeDays(); -if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); -} else { -try { -Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); +if (allowedAgeDays >= 0) { +String buildDateString = ServerInfo.getServerBuiltISO(); -int allowedAgeDays = getBuildDateWarningAgeDays(); +if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { +log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); +} else { +try { +Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); -Calendar old = Calendar.getInstance(); -old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today +Calendar old = Calendar.getInstance(); +old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today -if (buildDate.before(old.getTime())) { -log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +if (buildDate.before(old.getTime())) { + log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +} +} catch (ParseException pe) { + log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } -} catch (ParseException pe) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } } } diff --git a/java/org/apache/catalina/util/StringUtil.java b/java/org/apache/catalina/util/StringUtil.java new file mode 100644 index 00..41062af232 --- /dev/null +++ b/java/org/apache/catalina/util/StringUtil.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.util; +
(tomcat) branch 9.0.x updated (3f7bc2369b -> 662c3ca71e)
This is an automated email from the ASF dual-hosted git repository. schultz pushed a change to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 3f7bc2369b Add release date new 91e3e6b865 Allow build-age check to be disabled, and disable it by default. new 662c3ca71e Remove temporary file. 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: .../catalina/security/.SecurityListener.java.swp | Bin 0 -> 20480 bytes .../apache/catalina/security/SecurityListener.java | 30 +- .../backend/Sender.java => util/StringUtil.java} | 34 ++--- webapps/docs/config/listeners.xml | 3 +- 4 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 java/org/apache/catalina/security/.SecurityListener.java.swp copy java/org/apache/catalina/{ha/backend/Sender.java => util/StringUtil.java} (54%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Remove temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 662c3ca71eccc40084340fd8db8c0ca82fa1cadd Author: Christopher Schultz AuthorDate: Fri Mar 15 09:38:42 2024 -0400 Remove temporary file. --- webapps/docs/config/.listeners.xml.swp | Bin 45056 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/webapps/docs/config/.listeners.xml.swp b/webapps/docs/config/.listeners.xml.swp deleted file mode 100644 index 1640f231dd..00 Binary files a/webapps/docs/config/.listeners.xml.swp and /dev/null differ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Allow build-age check to be disabled, and disable it by default.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 91e3e6b865f6d1c661a01a0f517b6f91b0d9d747 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:37:27 2024 -0400 Allow build-age check to be disabled, and disable it by default. --- .../catalina/security/.SecurityListener.java.swp | Bin 0 -> 20480 bytes .../apache/catalina/security/SecurityListener.java | 30 +++--- java/org/apache/catalina/util/StringUtil.java | 43 + webapps/docs/config/.listeners.xml.swp | Bin 0 -> 45056 bytes webapps/docs/config/listeners.xml | 3 +- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp new file mode 100644 index 00..5d9801fde0 Binary files /dev/null and b/java/org/apache/catalina/security/.SecurityListener.java.swp differ diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java index e92f7fbbc4..7917b9a6a4 100644 --- a/java/org/apache/catalina/security/SecurityListener.java +++ b/java/org/apache/catalina/security/SecurityListener.java @@ -47,7 +47,7 @@ public class SecurityListener implements LifecycleListener { private static final String UMASK_FORMAT = "%04o"; -private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = 180; +private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = -1; /** * The list of operating system users not permitted to run Tomcat. @@ -221,24 +221,26 @@ public class SecurityListener implements LifecycleListener { } protected void checkServerBuildAge() { -String buildDateString = ServerInfo.getServerBuiltISO(); +int allowedAgeDays = getBuildDateWarningAgeDays(); -if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); -} else { -try { -Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); +if (allowedAgeDays >= 0) { +String buildDateString = ServerInfo.getServerBuiltISO(); -int allowedAgeDays = getBuildDateWarningAgeDays(); +if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { +log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); +} else { +try { +Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); -Calendar old = Calendar.getInstance(); -old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today +Calendar old = Calendar.getInstance(); +old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today -if (buildDate.before(old.getTime())) { -log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +if (buildDate.before(old.getTime())) { + log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +} +} catch (ParseException pe) { + log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } -} catch (ParseException pe) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } } } diff --git a/java/org/apache/catalina/util/StringUtil.java b/java/org/apache/catalina/util/StringUtil.java new file mode 100644 index 00..41062af232 --- /dev/null +++ b/java/org/apache/catalina/util/StringUtil.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.util; +
(tomcat) 02/02: Remove temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit eb96a7c9431148e16179793861984e52ddb1b164 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:38:42 2024 -0400 Remove temporary file. --- webapps/docs/config/.listeners.xml.swp | Bin 45056 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/webapps/docs/config/.listeners.xml.swp b/webapps/docs/config/.listeners.xml.swp deleted file mode 100644 index 1640f231dd..00 Binary files a/webapps/docs/config/.listeners.xml.swp and /dev/null differ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated (f159cd54c1 -> eb96a7c943)
This is an automated email from the ASF dual-hosted git repository. schultz pushed a change to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from f159cd54c1 Correctly handle tag libraries packaged in JARs in a WAR deployment new 3f10b0840a Allow build-age check to be disabled, and disable it by default. new eb96a7c943 Remove temporary file. 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: .../catalina/security/.SecurityListener.java.swp | Bin 0 -> 20480 bytes .../apache/catalina/security/SecurityListener.java | 30 +- .../backend/Sender.java => util/StringUtil.java} | 34 ++--- webapps/docs/config/listeners.xml | 3 +- 4 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 java/org/apache/catalina/security/.SecurityListener.java.swp copy java/org/apache/catalina/{ha/backend/Sender.java => util/StringUtil.java} (54%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Allow build-age check to be disabled, and disable it by default.
This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 3f10b0840adf63290b4ac80596dc57efd1234988 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:37:27 2024 -0400 Allow build-age check to be disabled, and disable it by default. --- .../catalina/security/.SecurityListener.java.swp | Bin 0 -> 20480 bytes .../apache/catalina/security/SecurityListener.java | 30 +++--- java/org/apache/catalina/util/StringUtil.java | 43 + webapps/docs/config/.listeners.xml.swp | Bin 0 -> 45056 bytes webapps/docs/config/listeners.xml | 3 +- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp new file mode 100644 index 00..5d9801fde0 Binary files /dev/null and b/java/org/apache/catalina/security/.SecurityListener.java.swp differ diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java index e92f7fbbc4..7917b9a6a4 100644 --- a/java/org/apache/catalina/security/SecurityListener.java +++ b/java/org/apache/catalina/security/SecurityListener.java @@ -47,7 +47,7 @@ public class SecurityListener implements LifecycleListener { private static final String UMASK_FORMAT = "%04o"; -private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = 180; +private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = -1; /** * The list of operating system users not permitted to run Tomcat. @@ -221,24 +221,26 @@ public class SecurityListener implements LifecycleListener { } protected void checkServerBuildAge() { -String buildDateString = ServerInfo.getServerBuiltISO(); +int allowedAgeDays = getBuildDateWarningAgeDays(); -if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); -} else { -try { -Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); +if (allowedAgeDays >= 0) { +String buildDateString = ServerInfo.getServerBuiltISO(); -int allowedAgeDays = getBuildDateWarningAgeDays(); +if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { +log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); +} else { +try { +Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); -Calendar old = Calendar.getInstance(); -old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today +Calendar old = Calendar.getInstance(); +old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today -if (buildDate.before(old.getTime())) { -log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +if (buildDate.before(old.getTime())) { + log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +} +} catch (ParseException pe) { + log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } -} catch (ParseException pe) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } } } diff --git a/java/org/apache/catalina/util/StringUtil.java b/java/org/apache/catalina/util/StringUtil.java new file mode 100644 index 00..41062af232 --- /dev/null +++ b/java/org/apache/catalina/util/StringUtil.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.util; +
(tomcat) branch main updated: Remove temporary file.
This is an automated email from the ASF dual-hosted git repository. schultz 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 d0209ec703 Remove temporary file. d0209ec703 is described below commit d0209ec7032aab069286c45ce2d788e033f0e498 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:38:42 2024 -0400 Remove temporary file. --- webapps/docs/config/.listeners.xml.swp | Bin 45056 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/webapps/docs/config/.listeners.xml.swp b/webapps/docs/config/.listeners.xml.swp deleted file mode 100644 index 1640f231dd..00 Binary files a/webapps/docs/config/.listeners.xml.swp and /dev/null differ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Allow build-age check to be disabled, and disable it by default.
This is an automated email from the ASF dual-hosted git repository. schultz 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 cbe8769f28 Allow build-age check to be disabled, and disable it by default. cbe8769f28 is described below commit cbe8769f28cbd1f9f4eaaa5e1bc47fc09f974833 Author: Christopher Schultz AuthorDate: Fri Mar 15 09:37:27 2024 -0400 Allow build-age check to be disabled, and disable it by default. --- .../catalina/security/.SecurityListener.java.swp | Bin 0 -> 20480 bytes .../apache/catalina/security/SecurityListener.java | 30 +++--- java/org/apache/catalina/util/StringUtil.java | 43 + webapps/docs/config/.listeners.xml.swp | Bin 0 -> 45056 bytes webapps/docs/config/listeners.xml | 3 +- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/java/org/apache/catalina/security/.SecurityListener.java.swp b/java/org/apache/catalina/security/.SecurityListener.java.swp new file mode 100644 index 00..5d9801fde0 Binary files /dev/null and b/java/org/apache/catalina/security/.SecurityListener.java.swp differ diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java index e92f7fbbc4..7917b9a6a4 100644 --- a/java/org/apache/catalina/security/SecurityListener.java +++ b/java/org/apache/catalina/security/SecurityListener.java @@ -47,7 +47,7 @@ public class SecurityListener implements LifecycleListener { private static final String UMASK_FORMAT = "%04o"; -private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = 180; +private static final int DEFAULT_BUILD_DATE_WARNING_AGE_DAYS = -1; /** * The list of operating system users not permitted to run Tomcat. @@ -221,24 +221,26 @@ public class SecurityListener implements LifecycleListener { } protected void checkServerBuildAge() { -String buildDateString = ServerInfo.getServerBuiltISO(); +int allowedAgeDays = getBuildDateWarningAgeDays(); -if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); -} else { -try { -Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); +if (allowedAgeDays >= 0) { +String buildDateString = ServerInfo.getServerBuiltISO(); -int allowedAgeDays = getBuildDateWarningAgeDays(); +if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) { +log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); +} else { +try { +Date buildDate = new SimpleDateFormat("-MM-dd").parse(buildDateString); -Calendar old = Calendar.getInstance(); -old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today +Calendar old = Calendar.getInstance(); +old.add(Calendar.DATE, -allowedAgeDays); // Subtract X days from today -if (buildDate.before(old.getTime())) { -log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +if (buildDate.before(old.getTime())) { + log.warn(sm.getString("SecurityListener.buildDateIsOld", String.valueOf(allowedAgeDays))); +} +} catch (ParseException pe) { + log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } -} catch (ParseException pe) { -log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString)); } } } diff --git a/java/org/apache/catalina/util/StringUtil.java b/java/org/apache/catalina/util/StringUtil.java new file mode 100644 index 00..41062af232 --- /dev/null +++ b/java/org/apache/catalina/util/StringUtil.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY
Re: (tomcat) 02/02: Add checking for the age of the Tomcat version running and warn if it's getting old.
Mark and Rémy, On 3/13/24 10:53, Mark Thomas wrote: On 13/03/2024 14:38, Rémy Maucherat wrote: wrote: 1. A longer default nag-duration That's a good start. If it is meant to be enabled by default, I would like a value that is long enough so that it is almost certain there's an issue. 2 years ? Rémy 2. Add an explicit "disable" (e.g. -1) I was thinking yes to this and setting it to -1 by default. 3. Disable the feature by default 4. Remove this feature entirely The target for this was really 8.5 which will immediately go out-of-support once 8.5.100 is released. So really the default for 8.5.100 should be "nag immediately", but we can't expect that anybody really uses the out-of-the-box server.xml without any customizations, so specifically setting the duration to some small number of days in server.xml isn't going to have any effect. The more I think about this the more I wonder if some further tweaks are required. This check only runs at startup. There are some (very) long running Tomcat instances out there. Is on startup enough? Should this check be periodic? If yes, how periodic? Once a day? Probably whatever frequency we went for with the TLS reload warnings would be about right. I'm going to make these changes immediately: 1. Implement -1 = disabled 2. Set default to -1 instead of 180 for main/10.1/9 3. Set default to 180 for 8.5.x It would be "easy" to configure this for periodic checking, but I'm not going to do that quite yet. -chris - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Plans for 10.1.x and 8.5.x release?
Mark, On 3/15/24 07:52, Mark Thomas wrote: Just wondering what your thinking was for the March releases of 10.1.x and 8.5.x I definitely want to make the changes discussed on dev@ for the Tomcat age-nagging, plus one more thing to round-off before cutting 8.5.final. I was planning to do both releases at the same time, which is why I haven't done either, yet. I could have a release build by the end of the day, I'd imagine. -chris - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Plans for 10.1.x and 8.5.x release?
On 15/03/2024 12:08, Koteswararao Gundapaneni wrote: Hi Innovations are on the way for both 10.1.x and 8.5.x OK. I'll bite. What innovations? Mark regards, Koti On Fri, Mar 15, 2024 at 4:53 AM Mark Thomas wrote: Chris, Just wondering what your thinking was for the March releases of 10.1.x and 8.5.x Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Plans for 10.1.x and 8.5.x release?
Hi Innovations are on the way for both 10.1.x and 8.5.x regards, Koti On Fri, Mar 15, 2024 at 4:53 AM Mark Thomas wrote: > Chris, > > Just wondering what your thinking was for the March releases of 10.1.x > and 8.5.x > > Mark > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
Plans for 10.1.x and 8.5.x release?
Chris, Just wondering what your thinking was for the March releases of 10.1.x and 8.5.x Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Welcome note
Hi I will be act from now onwards as a good contributor with the new mailing address provided. regards, Koti
Re: Requesting as I had been agreed to commit from a contributor role
On 15/03/2024 01:41, koteswara Rao Gundapaneni wrote: Ok let me know I can use the below email as the future mailing address apache.tomcat.k...@gmail.com Something like that Unsubscribe your old address. Subscribe your new address. Full instructions can be found at https://tomcat.apache.org/lists.html Mark Regards Koti On Fri, 15 Mar 2024, 00:35 Christopher Schultz, < ch...@christopherschultz.net> wrote: Koteswararao, On 3/14/24 14:21, Mark Thomas wrote: On 14/03/2024 13:43, koteswara Rao Gundapaneni wrote: On Thu, 14 Mar 2024, 00:28 koteswara Rao Gundapaneni, mailto:koti.gundapan...@gmail.com>> wrote: HI Tomcat PMC, Please ensure I had showing my interest as a committer as I have been passed my contribution status from a range of having said that few contributions Simply saying I have been showing my interest to work as committer Please approve my icla There is nothing to approve. You submitted your ICLA. It has been filed by the ASF secretary. I'll note that: - no-one asked you to file an ICLA - there was no need for you to file an ICLA - the only thing filing an ICLA achieved was wasting the precious resource of volunteer time I *strongly* urge you to read the advice (including the references to how the ASF works) you have been given on and off list, stop wasting precious volunteer time and think very carefully before you post anything else to a Tomcat mailing list. Definitely read ASF How It Works, specifically the section on Meritocracy[1]. You cannot simply ask to become a committer on a project. Instead, you have to demonstrate to the existing project participants that you *deserve* to be /invited/ as a committer. So far, the weird series of PRs and emails you have sent are not making you look good. I'm not trying to be mean. I'm trying to be honest and use simple language. -chris [1] https://www.apache.org/foundation/how-it-works/#meritocracy - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org