buildbot failure in on tomcat-9.0.x

2021-06-24 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-9.0.x while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-9.0.x/builds/52

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

Buildslave for this Build: asf946_ubuntu

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

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



buildbot failure in on tomcat-10.0.x

2021-06-24 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-10.0.x while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-10.0.x/builds/71

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

Buildslave for this Build: asf946_ubuntu

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

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



buildbot failure in on tomcat-8.5.x

2021-06-24 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-8.5.x while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-8.5.x/builds/51

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

Buildslave for this Build: asf946_ubuntu

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

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[tomcat] branch 8.5.x updated: Remove unused file

2021-06-24 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 36e1976  Remove unused file
36e1976 is described below

commit 36e19763b65e59c4f3cb45544f732aefcecaf1d0
Author: Mark Thomas 
AuthorDate: Thu Jun 24 17:43:00 2021 +0100

Remove unused file
---
 test/webapp/bug6/bug64872b-timeunit.jsp | 29 -
 1 file changed, 29 deletions(-)

diff --git a/test/webapp/bug6/bug64872b-timeunit.jsp 
b/test/webapp/bug6/bug64872b-timeunit.jsp
deleted file mode 100644
index 679925f..000
--- a/test/webapp/bug6/bug64872b-timeunit.jsp
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- 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.
---%>
-<%@ taglib uri="http://tomcat.apache.org/tag-setters; prefix="ts" %>
-
-  Bug 64872b TimeUnit test case
-  
-  <%
-  for (int i=0; i < 10; i++) {
-  %>
-01 The value of foo is []
-  <%
-  }
-  %>
-  
-
\ No newline at end of file

-
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: Remove unused file

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 31f35f7  Remove unused file
31f35f7 is described below

commit 31f35f74e54e58a59765cc8c5d7ec1b85378622d
Author: Mark Thomas 
AuthorDate: Thu Jun 24 17:43:00 2021 +0100

Remove unused file
---
 test/webapp/bug6/bug64872b-timeunit.jsp | 29 -
 1 file changed, 29 deletions(-)

diff --git a/test/webapp/bug6/bug64872b-timeunit.jsp 
b/test/webapp/bug6/bug64872b-timeunit.jsp
deleted file mode 100644
index 679925f..000
--- a/test/webapp/bug6/bug64872b-timeunit.jsp
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- 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.
---%>
-<%@ taglib uri="http://tomcat.apache.org/tag-setters; prefix="ts" %>
-
-  Bug 64872b TimeUnit test case
-  
-  <%
-  for (int i=0; i < 10; i++) {
-  %>
-01 The value of foo is []
-  <%
-  }
-  %>
-  
-
\ No newline at end of file

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



[tomcat] branch 10.0.x updated: Remove unused file

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 216f8ca  Remove unused file
216f8ca is described below

commit 216f8ca46cff92ec909ff530d32f41642e8fd640
Author: Mark Thomas 
AuthorDate: Thu Jun 24 17:43:00 2021 +0100

Remove unused file
---
 test/webapp/bug6/bug64872b-timeunit.jsp | 29 -
 1 file changed, 29 deletions(-)

diff --git a/test/webapp/bug6/bug64872b-timeunit.jsp 
b/test/webapp/bug6/bug64872b-timeunit.jsp
deleted file mode 100644
index 679925f..000
--- a/test/webapp/bug6/bug64872b-timeunit.jsp
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- 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.
---%>
-<%@ taglib uri="http://tomcat.apache.org/tag-setters; prefix="ts" %>
-
-  Bug 64872b TimeUnit test case
-  
-  <%
-  for (int i=0; i < 10; i++) {
-  %>
-01 The value of foo is []
-  <%
-  }
-  %>
-  
-
\ No newline at end of file

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



[tomcat] branch main updated: Remove unused file

2021-06-24 Thread markt
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 0dee371  Remove unused file
0dee371 is described below

commit 0dee371b82bf2ed18a7316430db8c25bdb3644e3
Author: Mark Thomas 
AuthorDate: Thu Jun 24 17:43:00 2021 +0100

Remove unused file
---
 test/webapp/bug6/bug64872b-timeunit.jsp | 29 -
 1 file changed, 29 deletions(-)

diff --git a/test/webapp/bug6/bug64872b-timeunit.jsp 
b/test/webapp/bug6/bug64872b-timeunit.jsp
deleted file mode 100644
index 679925f..000
--- a/test/webapp/bug6/bug64872b-timeunit.jsp
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- 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.
---%>
-<%@ taglib uri="http://tomcat.apache.org/tag-setters; prefix="ts" %>
-
-  Bug 64872b TimeUnit test case
-  
-  <%
-  for (int i=0; i < 10; i++) {
-  %>
-01 The value of foo is []
-  <%
-  }
-  %>
-  
-
\ No newline at end of file

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



Tagging 10.1.0-M2 & 10.0.8

2021-06-24 Thread Mark Thomas

Hi all,

My current plan is:

- fix bz 65377
- check the tests pass locally
- tag

Hopefully, this will mean tagging some time tomorrow which means a 
release around 30 June / 1 July.


Of course, the mere act of sending this email means a new bug report is 
going to arrive that is going to take days to debug :)


Mark

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



[tomcat] branch main updated: Fix BZ 65397 - skip symlinks in getResourcePaths() results

2021-06-24 Thread markt
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 494452e  Fix BZ 65397 - skip symlinks in getResourcePaths() results
494452e is described below

commit 494452e7eb6d506a24bbe105fd2f482c757fa674
Author: Mark Thomas 
AuthorDate: Thu Jun 24 16:00:21 2021 +0100

Fix BZ 65397 - skip symlinks in getResourcePaths() results

Calls to ServletContext.getResourcePaths() no longer include symbolic
links in the results unless allowLinking has been set to true. If a
resource is skipped because of this change, a warning will be logged as
this typically indicates a configuration issue.

https://bz.apache.org/bugzilla/show_bug.cgi?id=65397
---
 .../webresources/AbstractFileResourceSet.java  | 20 +++
 .../catalina/webresources/DirResourceSet.java  | 23 ++
 webapps/docs/changelog.xml |  8 
 3 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
index 59fc771..3930a90 100644
--- a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
@@ -136,14 +136,7 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 // Typically means symlinks are in use but being ignored. Given
 // the symlink was likely created for a reason, log a warning
 // that it was ignored.
-String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
-getRoot().getContext().getName(), absPath, canPath);
-// Log issues with configuration files at a higher level
-if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
-log.error(msg);
-} else {
-log.warn(msg);
-}
+logIgnoredSymlink(getRoot().getContext().getName(), absPath, 
canPath);
 }
 return null;
 }
@@ -152,6 +145,17 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 }
 
 
+protected void logIgnoredSymlink(String contextPath, String absPath, 
String canPath) {
+String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
+contextPath, absPath, canPath);
+// Log issues with configuration files at a higher level
+if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
+log.error(msg);
+} else {
+log.warn(msg);
+}
+}
+
 private boolean isInvalidWindowsFilename(String name) {
 final int len = name.length();
 if (len == 0) {
diff --git a/java/org/apache/catalina/webresources/DirResourceSet.java 
b/java/org/apache/catalina/webresources/DirResourceSet.java
index 234dc74..354ca90 100644
--- a/java/org/apache/catalina/webresources/DirResourceSet.java
+++ b/java/org/apache/catalina/webresources/DirResourceSet.java
@@ -157,6 +157,29 @@ public class DirResourceSet extends 
AbstractFileResourceSet {
 File[] list = f.listFiles();
 if (list != null) {
 for (File entry : list) {
+// f has already been validated so the following checks
+// can be much simpler than those in file()
+if (!getRoot().getAllowLinking()) {
+// allow linking is disabled so need to check for
+// symlinks
+boolean symlink = true;
+String absPath = null;
+String canPath = null;
+try {
+absPath = entry.getAbsolutePath();
+canPath = entry.getCanonicalPath();
+if (absPath.equals(canPath)) {
+symlink = false;
+}
+} catch (IOException ioe) {
+// Ignore the exception. Assume we have a 
symlink.
+canPath = "Unknown";
+}
+if (symlink) {
+
logIgnoredSymlink(getRoot().getContext().getName(), absPath, canPath);
+continue;
+}
+}
 StringBuilder sb = new StringBuilder(path);
 if (path.charAt(path.length() - 1) != 

[tomcat] branch 8.5.x updated: Fix BZ 65397 - skip symlinks in getResourcePaths() results

2021-06-24 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 e9480cd  Fix BZ 65397 - skip symlinks in getResourcePaths() results
e9480cd is described below

commit e9480cd8361f1dc60e89b5548202b33e334c0f44
Author: Mark Thomas 
AuthorDate: Thu Jun 24 16:00:21 2021 +0100

Fix BZ 65397 - skip symlinks in getResourcePaths() results

Calls to ServletContext.getResourcePaths() no longer include symbolic
links in the results unless allowLinking has been set to true. If a
resource is skipped because of this change, a warning will be logged as
this typically indicates a configuration issue.

https://bz.apache.org/bugzilla/show_bug.cgi?id=65397
---
 .../webresources/AbstractFileResourceSet.java  | 20 +++
 .../catalina/webresources/DirResourceSet.java  | 23 ++
 webapps/docs/changelog.xml |  8 
 3 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
index 59fc771..3930a90 100644
--- a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
@@ -136,14 +136,7 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 // Typically means symlinks are in use but being ignored. Given
 // the symlink was likely created for a reason, log a warning
 // that it was ignored.
-String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
-getRoot().getContext().getName(), absPath, canPath);
-// Log issues with configuration files at a higher level
-if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
-log.error(msg);
-} else {
-log.warn(msg);
-}
+logIgnoredSymlink(getRoot().getContext().getName(), absPath, 
canPath);
 }
 return null;
 }
@@ -152,6 +145,17 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 }
 
 
+protected void logIgnoredSymlink(String contextPath, String absPath, 
String canPath) {
+String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
+contextPath, absPath, canPath);
+// Log issues with configuration files at a higher level
+if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
+log.error(msg);
+} else {
+log.warn(msg);
+}
+}
+
 private boolean isInvalidWindowsFilename(String name) {
 final int len = name.length();
 if (len == 0) {
diff --git a/java/org/apache/catalina/webresources/DirResourceSet.java 
b/java/org/apache/catalina/webresources/DirResourceSet.java
index 234dc74..354ca90 100644
--- a/java/org/apache/catalina/webresources/DirResourceSet.java
+++ b/java/org/apache/catalina/webresources/DirResourceSet.java
@@ -157,6 +157,29 @@ public class DirResourceSet extends 
AbstractFileResourceSet {
 File[] list = f.listFiles();
 if (list != null) {
 for (File entry : list) {
+// f has already been validated so the following checks
+// can be much simpler than those in file()
+if (!getRoot().getAllowLinking()) {
+// allow linking is disabled so need to check for
+// symlinks
+boolean symlink = true;
+String absPath = null;
+String canPath = null;
+try {
+absPath = entry.getAbsolutePath();
+canPath = entry.getCanonicalPath();
+if (absPath.equals(canPath)) {
+symlink = false;
+}
+} catch (IOException ioe) {
+// Ignore the exception. Assume we have a 
symlink.
+canPath = "Unknown";
+}
+if (symlink) {
+
logIgnoredSymlink(getRoot().getContext().getName(), absPath, canPath);
+continue;
+}
+}
 StringBuilder sb = new StringBuilder(path);
 if (path.charAt(path.length() - 1) 

[tomcat] branch 9.0.x updated: Fix BZ 65397 - skip symlinks in getResourcePaths() results

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 8042384  Fix BZ 65397 - skip symlinks in getResourcePaths() results
8042384 is described below

commit 80423842aaaeb84973be0a397d70267a95728fab
Author: Mark Thomas 
AuthorDate: Thu Jun 24 16:00:21 2021 +0100

Fix BZ 65397 - skip symlinks in getResourcePaths() results

Calls to ServletContext.getResourcePaths() no longer include symbolic
links in the results unless allowLinking has been set to true. If a
resource is skipped because of this change, a warning will be logged as
this typically indicates a configuration issue.

https://bz.apache.org/bugzilla/show_bug.cgi?id=65397
---
 .../webresources/AbstractFileResourceSet.java  | 20 +++
 .../catalina/webresources/DirResourceSet.java  | 23 ++
 webapps/docs/changelog.xml |  8 
 3 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
index 59fc771..3930a90 100644
--- a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
@@ -136,14 +136,7 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 // Typically means symlinks are in use but being ignored. Given
 // the symlink was likely created for a reason, log a warning
 // that it was ignored.
-String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
-getRoot().getContext().getName(), absPath, canPath);
-// Log issues with configuration files at a higher level
-if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
-log.error(msg);
-} else {
-log.warn(msg);
-}
+logIgnoredSymlink(getRoot().getContext().getName(), absPath, 
canPath);
 }
 return null;
 }
@@ -152,6 +145,17 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 }
 
 
+protected void logIgnoredSymlink(String contextPath, String absPath, 
String canPath) {
+String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
+contextPath, absPath, canPath);
+// Log issues with configuration files at a higher level
+if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
+log.error(msg);
+} else {
+log.warn(msg);
+}
+}
+
 private boolean isInvalidWindowsFilename(String name) {
 final int len = name.length();
 if (len == 0) {
diff --git a/java/org/apache/catalina/webresources/DirResourceSet.java 
b/java/org/apache/catalina/webresources/DirResourceSet.java
index 234dc74..354ca90 100644
--- a/java/org/apache/catalina/webresources/DirResourceSet.java
+++ b/java/org/apache/catalina/webresources/DirResourceSet.java
@@ -157,6 +157,29 @@ public class DirResourceSet extends 
AbstractFileResourceSet {
 File[] list = f.listFiles();
 if (list != null) {
 for (File entry : list) {
+// f has already been validated so the following checks
+// can be much simpler than those in file()
+if (!getRoot().getAllowLinking()) {
+// allow linking is disabled so need to check for
+// symlinks
+boolean symlink = true;
+String absPath = null;
+String canPath = null;
+try {
+absPath = entry.getAbsolutePath();
+canPath = entry.getCanonicalPath();
+if (absPath.equals(canPath)) {
+symlink = false;
+}
+} catch (IOException ioe) {
+// Ignore the exception. Assume we have a 
symlink.
+canPath = "Unknown";
+}
+if (symlink) {
+
logIgnoredSymlink(getRoot().getContext().getName(), absPath, canPath);
+continue;
+}
+}
 StringBuilder sb = new StringBuilder(path);
 if (path.charAt(path.length() - 1) 

[tomcat] branch 10.0.x updated: Fix BZ 65397 - skip symlinks in getResourcePaths() results

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new d4dcd31  Fix BZ 65397 - skip symlinks in getResourcePaths() results
d4dcd31 is described below

commit d4dcd310879dc4301d29b92f8153f670848f2ba9
Author: Mark Thomas 
AuthorDate: Thu Jun 24 16:00:21 2021 +0100

Fix BZ 65397 - skip symlinks in getResourcePaths() results

Calls to ServletContext.getResourcePaths() no longer include symbolic
links in the results unless allowLinking has been set to true. If a
resource is skipped because of this change, a warning will be logged as
this typically indicates a configuration issue.

https://bz.apache.org/bugzilla/show_bug.cgi?id=65397
---
 .../webresources/AbstractFileResourceSet.java  | 20 +++
 .../catalina/webresources/DirResourceSet.java  | 23 ++
 webapps/docs/changelog.xml |  8 
 3 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
index 59fc771..3930a90 100644
--- a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
@@ -136,14 +136,7 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 // Typically means symlinks are in use but being ignored. Given
 // the symlink was likely created for a reason, log a warning
 // that it was ignored.
-String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
-getRoot().getContext().getName(), absPath, canPath);
-// Log issues with configuration files at a higher level
-if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
-log.error(msg);
-} else {
-log.warn(msg);
-}
+logIgnoredSymlink(getRoot().getContext().getName(), absPath, 
canPath);
 }
 return null;
 }
@@ -152,6 +145,17 @@ public abstract class AbstractFileResourceSet extends 
AbstractResourceSet {
 }
 
 
+protected void logIgnoredSymlink(String contextPath, String absPath, 
String canPath) {
+String msg = 
sm.getString("abstractFileResourceSet.canonicalfileCheckFailed",
+contextPath, absPath, canPath);
+// Log issues with configuration files at a higher level
+if(absPath.startsWith("/META-INF/") || 
absPath.startsWith("/WEB-INF/")) {
+log.error(msg);
+} else {
+log.warn(msg);
+}
+}
+
 private boolean isInvalidWindowsFilename(String name) {
 final int len = name.length();
 if (len == 0) {
diff --git a/java/org/apache/catalina/webresources/DirResourceSet.java 
b/java/org/apache/catalina/webresources/DirResourceSet.java
index 234dc74..354ca90 100644
--- a/java/org/apache/catalina/webresources/DirResourceSet.java
+++ b/java/org/apache/catalina/webresources/DirResourceSet.java
@@ -157,6 +157,29 @@ public class DirResourceSet extends 
AbstractFileResourceSet {
 File[] list = f.listFiles();
 if (list != null) {
 for (File entry : list) {
+// f has already been validated so the following checks
+// can be much simpler than those in file()
+if (!getRoot().getAllowLinking()) {
+// allow linking is disabled so need to check for
+// symlinks
+boolean symlink = true;
+String absPath = null;
+String canPath = null;
+try {
+absPath = entry.getAbsolutePath();
+canPath = entry.getCanonicalPath();
+if (absPath.equals(canPath)) {
+symlink = false;
+}
+} catch (IOException ioe) {
+// Ignore the exception. Assume we have a 
symlink.
+canPath = "Unknown";
+}
+if (symlink) {
+
logIgnoredSymlink(getRoot().getContext().getName(), absPath, canPath);
+continue;
+}
+}
 StringBuilder sb = new StringBuilder(path);
 if (path.charAt(path.length() - 1) 

[Bug 65397] NullPointerException during jar scanning with jar symlinked into WEB-INF/lib

2021-06-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65397

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Mark Thomas  ---
Thanks for the report.

Fixed in:
- 10.1.x for 10.1.0-M2 onwards
- 10.0.x for 10.0.8 onwards
- 9.0.x for 9.0.49 onwards
- 8.5.x for 8.5.69 onwards

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



Re: [tomcat] branch main updated: Simplify - identified by SpotBugs

2021-06-24 Thread Christopher Schultz

Mark,

On 6/24/21 03:59, Mark Thomas wrote:

On 23/06/2021 20:06, Christopher Schultz wrote:

Mark,

On 6/23/21 13:19, ma...@apache.org wrote:

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 b9bd126  Simplify - identified by SpotBugs
b9bd126 is described below

commit b9bd12608d3a14ed036a1602f39b148d91fb5489
Author: Mark Thomas 
AuthorDate: Wed Jun 23 18:18:37 2021 +0100

 Simplify - identified by SpotBugs > ---
  java/org/apache/jasper/runtime/PageContextImpl.java | 17 
+

  1 file changed, 1 insertion(+), 16 deletions(-)


Will this not end up flushing buffers potentially needlessly early, 
converting responses to Chunked and preventing errors from being 
reported by committing the response?


No. This flushes the JSPWriterImpl. That flushes any data buffered in 
the JSPWriterImpl to the Writer obtained from the HttpServletResponse 
but that Writer is not then flushed.


Great, thanks for the explanation.

I realize that THIS patch doesn't do that, but it looks like the 
history of the file (c.f. the "Old code" comment) has two different 
behaviors depending upon whether the file is being included.


The "Old code" has been commented out for more than 15 years. You'd need 
to go back to the 5.5.x svn archives to understand what was going on here.


Glad to see it go, then.

Thanks,
-chris

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



[Bug 65397] NullPointerException during jar scanning with jar symlinked into WEB-INF/lib

2021-06-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65397

Mark Thomas  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Mark Thomas  ---
I can confirm that linking any JAR does appear to trigger this.

My testing with both main (10.1.x) and 9.0.x is that adding:



to conf/context.xml does work around the issue. I don't recall any recent
changes to resource handling that would explain why this works for me but not
for you.

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



[Bug 65397] New: NullPointerException during jar scanning with jar symlinked into WEB-INF/lib

2021-06-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65397

Bug ID: 65397
   Summary: NullPointerException during jar scanning with jar
symlinked into WEB-INF/lib
   Product: Tomcat 9
   Version: 9.0.48
  Hardware: Macintosh
Status: NEW
  Severity: normal
  Priority: P2
 Component: Util
  Assignee: dev@tomcat.apache.org
  Reporter: awilkin...@pivotal.io
  Target Milestone: -

Symlinking a jar into WEB-INF/lib results in a NullPointerException during
scanning for web fragments:

Caused by: java.lang.NullPointerException
at
org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:382)
at
org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:195)
at
org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:2136)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1289)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:986)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 38 more


This behaviour can be reproduced with the following steps:

wget
https://apache.mirrors.nublue.co.uk/tomcat/tomcat-9/v9.0.48/bin/apache-tomcat-9.0.48.tar.gz
 
tar -xzf apache-tomcat-9.0.48.tar.gz
mkdir -p apache-tomcat-9.0.48/webapps/symlink-problem/WEB-INF/lib
wget
https://repo.spring.io/artifactory/libs-release-local/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
ln -s spring-cloud-bindings-1.7.1.jar
apache-tomcat-9.0.48/webapps/symlink-problem/WEB-INF/lib
apache-tomcat-9.0.48/bin/catalina.sh run

I don't believe that the specific jar that's symlinked is important, any jar
will reproduce the failure. The problem also occurs with  added to conf/context.xml.

We've also seen a similar problem with embedded Tomcat when scanning for tag
libraries. Please see
https://github.com/spring-projects/spring-boot/issues/27075 for some further
details.

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



[tomcat] branch 8.5.x updated: Add support for compiling JSPs for Java 17

2021-06-24 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 252bf1a  Add support for compiling JSPs for Java 17
252bf1a is described below

commit 252bf1a97027340bde7c312e91f772b8e6d42995
Author: Mark Thomas 
AuthorDate: Thu Jun 24 09:09:42 2021 +0100

Add support for compiling JSPs for Java 17
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 11 +++
 webapps/docs/changelog.xml   |  7 +++
 2 files changed, 18 insertions(+)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 3441cd6..304aafd 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -359,6 +359,11 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 // Java 7.
 // This is checked against the actual version below.
 settings.put(CompilerOptions.OPTION_Source, "16");
+} else if(opt.equals("17")) {
+// Constant not available in latest ECJ version that runs on
+// Java 7.
+// This is checked against the actual version below.
+settings.put(CompilerOptions.OPTION_Source, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_1_7);
@@ -438,6 +443,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 // This is checked against the actual version below.
 settings.put(CompilerOptions.OPTION_TargetPlatform, "16");
 settings.put(CompilerOptions.OPTION_Compliance, "16");
+} else if(opt.equals("17")) {
+// Constant not available in latest ECJ version that runs on
+// Java 7.
+// This is checked against the actual version below.
+settings.put(CompilerOptions.OPTION_TargetPlatform, "17");
+settings.put(CompilerOptions.OPTION_Compliance, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_1_7);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0a22cae..c088a2f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -188,6 +188,13 @@
 and restore code that was removed in error leading to JSP compilation
 failures in some circumstances. (markt)
   
+  
+Add support for specifying Java 17 (with the value 17) as
+the compiler source and/or compiler target for JSP compilation. If used
+with an Eclipse JDT compiler version that does not support these 
values,
+a warning will be logged and the latest supported version will used.
+(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: Add support for compiling JSPs for Java 17

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 2d082c2  Add support for compiling JSPs for Java 17
2d082c2 is described below

commit 2d082c25226da5553e84ae43a949fcf3d544efd5
Author: Mark Thomas 
AuthorDate: Thu Jun 24 09:09:42 2021 +0100

Add support for compiling JSPs for Java 17
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 11 ---
 webapps/docs/changelog.xml   |  7 +++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 7e3e4de..10d80e0 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -310,10 +310,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 } else if(opt.equals("15")) {
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_15);
 } else if(opt.equals("16")) {
+settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_16);
+} else if(opt.equals("17")) {
 // Constant not available in latest ECJ version shipped with
 // Tomcat. May be supported in a snapshot build.
 // This is checked against the actual version below.
-settings.put(CompilerOptions.OPTION_Source, "16");
+settings.put(CompilerOptions.OPTION_Source, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_1_8);
@@ -370,11 +372,14 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_15);
 settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_15);
 } else if(opt.equals("16")) {
+settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_16);
+settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_16);
+} else if(opt.equals("17")) {
 // Constant not available in latest ECJ version shipped with
 // Tomcat. May be supported in a snapshot build.
 // This is checked against the actual version below.
-settings.put(CompilerOptions.OPTION_TargetPlatform, "16");
-settings.put(CompilerOptions.OPTION_Compliance, "16");
+settings.put(CompilerOptions.OPTION_TargetPlatform, "17");
+settings.put(CompilerOptions.OPTION_Compliance, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_1_8);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 78dbdcf..906977f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -195,6 +195,13 @@
   
 Update to the Eclipse JDT compiler 4.20. (markt)
   
+  
+Add support for specifying Java 17 (with the value 17) as
+the compiler source and/or compiler target for JSP compilation. If used
+with an Eclipse JDT compiler version that does not support these 
values,
+a warning will be logged and the latest supported version will used.
+(markt)
+  
 
   
   

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



[tomcat] branch 10.0.x updated: Add support for compiling JSPs for Java 17

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new be39a52  Add support for compiling JSPs for Java 17
be39a52 is described below

commit be39a52922d71b747206a82dd4d4ba2b8fea563f
Author: Mark Thomas 
AuthorDate: Thu Jun 24 09:09:42 2021 +0100

Add support for compiling JSPs for Java 17
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 11 ---
 webapps/docs/changelog.xml   |  7 +++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 7e3e4de..10d80e0 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -310,10 +310,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 } else if(opt.equals("15")) {
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_15);
 } else if(opt.equals("16")) {
+settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_16);
+} else if(opt.equals("17")) {
 // Constant not available in latest ECJ version shipped with
 // Tomcat. May be supported in a snapshot build.
 // This is checked against the actual version below.
-settings.put(CompilerOptions.OPTION_Source, "16");
+settings.put(CompilerOptions.OPTION_Source, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_1_8);
@@ -370,11 +372,14 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_15);
 settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_15);
 } else if(opt.equals("16")) {
+settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_16);
+settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_16);
+} else if(opt.equals("17")) {
 // Constant not available in latest ECJ version shipped with
 // Tomcat. May be supported in a snapshot build.
 // This is checked against the actual version below.
-settings.put(CompilerOptions.OPTION_TargetPlatform, "16");
-settings.put(CompilerOptions.OPTION_Compliance, "16");
+settings.put(CompilerOptions.OPTION_TargetPlatform, "17");
+settings.put(CompilerOptions.OPTION_Compliance, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_1_8);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 12b672a..0fbf632 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -200,6 +200,13 @@
   
 Update to the Eclipse JDT compiler 4.20. (markt)
   
+  
+Add support for specifying Java 17 (with the value 17) as
+the compiler source and/or compiler target for JSP compilation. If used
+with an Eclipse JDT compiler version that does not support these 
values,
+a warning will be logged and the latest supported version will used.
+(markt)
+  
 
   
   

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



[tomcat] branch main updated: Add support for compiling JSPs for Java 17

2021-06-24 Thread markt
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 a8741c3  Add support for compiling JSPs for Java 17
a8741c3 is described below

commit a8741c347713ebb4c065db469cdbcf01311eeb42
Author: Mark Thomas 
AuthorDate: Thu Jun 24 09:09:42 2021 +0100

Add support for compiling JSPs for Java 17
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 11 ---
 webapps/docs/changelog.xml   |  7 +++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 7e3e4de..10d80e0 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -310,10 +310,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 } else if(opt.equals("15")) {
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_15);
 } else if(opt.equals("16")) {
+settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_16);
+} else if(opt.equals("17")) {
 // Constant not available in latest ECJ version shipped with
 // Tomcat. May be supported in a snapshot build.
 // This is checked against the actual version below.
-settings.put(CompilerOptions.OPTION_Source, "16");
+settings.put(CompilerOptions.OPTION_Source, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_1_8);
@@ -370,11 +372,14 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_15);
 settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_15);
 } else if(opt.equals("16")) {
+settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_16);
+settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_16);
+} else if(opt.equals("17")) {
 // Constant not available in latest ECJ version shipped with
 // Tomcat. May be supported in a snapshot build.
 // This is checked against the actual version below.
-settings.put(CompilerOptions.OPTION_TargetPlatform, "16");
-settings.put(CompilerOptions.OPTION_Compliance, "16");
+settings.put(CompilerOptions.OPTION_TargetPlatform, "17");
+settings.put(CompilerOptions.OPTION_Compliance, "17");
 } else {
 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_1_8);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4287ea4..b45ed6e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -200,6 +200,13 @@
   
 Update to the Eclipse JDT compiler 4.20. (markt)
   
+  
+Add support for specifying Java 17 (with the value 17) as
+the compiler source and/or compiler target for JSP compilation. If used
+with an Eclipse JDT compiler version that does not support these 
values,
+a warning will be logged and the latest supported version will used.
+(markt)
+  
 
   
   

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



Re: [tomcat] branch main updated: Simplify - identified by SpotBugs

2021-06-24 Thread Mark Thomas

On 23/06/2021 20:06, Christopher Schultz wrote:

Mark,

On 6/23/21 13:19, ma...@apache.org wrote:

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 b9bd126  Simplify - identified by SpotBugs
b9bd126 is described below

commit b9bd12608d3a14ed036a1602f39b148d91fb5489
Author: Mark Thomas 
AuthorDate: Wed Jun 23 18:18:37 2021 +0100

 Simplify - identified by SpotBugs > ---
  java/org/apache/jasper/runtime/PageContextImpl.java | 17 
+

  1 file changed, 1 insertion(+), 16 deletions(-)


Will this not end up flushing buffers potentially needlessly early, 
converting responses to Chunked and preventing errors from being 
reported by committing the response?


No. This flushes the JSPWriterImpl. That flushes any data buffered in 
the JSPWriterImpl to the Writer obtained from the HttpServletResponse 
but that Writer is not then flushed.


I realize that THIS patch doesn't do that, but it looks like the history 
of the file (c.f. the "Old code" comment) has two different behaviors 
depending upon whether the file is being included.


The "Old code" has been commented out for more than 15 years. You'd need 
to go back to the 5.5.x svn archives to understand what was going on here.


Mark




-chris

diff --git a/java/org/apache/jasper/runtime/PageContextImpl.java 
b/java/org/apache/jasper/runtime/PageContextImpl.java

index f732273..1477013 100644
--- a/java/org/apache/jasper/runtime/PageContextImpl.java
+++ b/java/org/apache/jasper/runtime/PageContextImpl.java
@@ -97,8 +97,6 @@ public class PageContextImpl extends PageContext {
  private transient ELContextImpl elContext;
-    private boolean isIncluded;
-
  // initial output stream
  private transient JspWriter out;
@@ -170,26 +168,13 @@ public class PageContextImpl extends PageContext {
  setAttribute(CONFIG, config);
  setAttribute(PAGECONTEXT, this);
  setAttribute(APPLICATION, context);
-
-    isIncluded = request.getAttribute(
-    RequestDispatcher.INCLUDE_SERVLET_PATH) != null;
  }
  @Override
  public void release() {
  out = baseOut;
  try {
-    if (isIncluded) {
-    ((JspWriterImpl) out).flushBuffer();
-    // push it into the including jspWriter
-    } else {
-    // Old code:
-    // out.flush();
-    // Do not flush the buffer even if we're not included 
(i.e.
-    // we are the main page. The servlet will flush it 
and close

-    // the stream.
-    ((JspWriterImpl) out).flushBuffer();
-    }
+    ((JspWriterImpl) out).flushBuffer();
  } catch (IOException ex) {
  IllegalStateException ise = new 
IllegalStateException(Localizer.getMessage("jsp.error.flush"), ex);

  throw ise;

-
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




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



Re: mod_headers as a Filter

2021-06-24 Thread Rémy Maucherat
On Wed, Jun 23, 2021 at 8:43 PM Mark Thomas  wrote:
>
> On 07/05/2021 09:33, Rémy Maucherat wrote:
> > On Wed, Apr 28, 2021 at 10:45 AM Rémy Maucherat  wrote:
> >
> >> On Wed, Apr 28, 2021 at 9:07 AM Mark Thomas  wrote:
> >>
> >>> I'm wondering if there is merit in a Valve-like mechanism for Coyote.
> >>> Name TBD but would look something like:
> >>> - callbacks
> >>> - after request headers are parsed / before the request is prepared
> >>> - after the request is prepared
> >>> - before response headers are prepared
> >>> - after response headers are prepared / before they are written
> >>> - allow multiple "Valves" to be configured
> >>> - provide a "default" that doesn't require explicit config
> >>> - explicit config can add custom "valves", the default "valve" or any
> >>> combination
> >>>
> >>
> >> I thought about it quite a bit in the past, an interceptor [resurrecting
> >> the old name] could be a solution to a lot of problems here. So why not.
> >>
> >
> > Thinking about it some more, I would propose investigating either:
> > - Adding a new interface in addition to ActionHook to coyote.Request, maybe
> > called EventHook (gets a code and the request object).
> > - Allowing more than one ActionHook [the codes include plenty of the
> > interesting events already especially commit, flush]. User configured hooks
> > would be added and called *before* the main coyote hook (obviously).
> > Although this sounds easier to implement, this is tricker and error prone
> > as the call patterns are funky (also the hook field is duplicated between
> > request and response likely for no good reason); basically I would say all
> > hook action calls would now go through a helper method on the Request.
> > - Something else ;)
>
> I think a new interface would be cleaner. Some sort of CoyoteListener
> configured as elements nested under the Connector.
>
> Looking into the history of ActionHook, it looks like the intention was
> to enable support for custom actions for custom Connectors. I don't
> think that was ever used. I switched it to an Enum ages ago mainly as I
> was concerned that, with the growing numbers of actions, some Processors
> may not be implementing all the actions they needed to.
>
> Given that we can now define default method implementations in an
> interface, I think I prefer an interface with one method per event type
> rather than a single method with a parameter that indicates the event type.

Ok, no problem with that plan.

>
> Your email also got me wondering whether it was time to refactor the
> Coyote code to remove ActionHook entirely.

Ok, otoh that's probably not going to bring much value.

Rémy

>
> I think I have some experimenting to do.
>
> 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



[Bug 65385] Link to Maven Central is not valid

2021-06-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65385

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|REOPENED|RESOLVED

--- Comment #4 from Mark Thomas  ---
URL updated. Fixed versions unchanged.

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



[tomcat] branch 8.5.x updated: Update the URL to Maven Central to the one under an ASF domain

2021-06-24 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 033b9b1  Update the URL to Maven Central to the one under an ASF domain
033b9b1 is described below

commit 033b9b1c659d28a56fcd41cefce63a81da368053
Author: Mark Thomas 
AuthorDate: Thu Jun 24 08:43:40 2021 +0100

Update the URL to Maven Central to the one under an ASF domain
---
 webapps/docs/maven-jars.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/maven-jars.xml b/webapps/docs/maven-jars.xml
index d8fb897..7320452 100644
--- a/webapps/docs/maven-jars.xml
+++ b/webapps/docs/maven-jars.xml
@@ -46,10 +46,10 @@
 
   
 Stable releases are published to the
-https://repo1.maven.org/maven2/org/apache/tomcat/;>Maven
+https://repo.maven.apache.org/maven2/org/apache/tomcat/;>Maven
 Central Repository. The URL for this is
   
-  https://repo1.maven.org/maven2/org/apache/tomcat/
+  https://repo.maven.apache.org/maven2/org/apache/tomcat/
 
 
 

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



[tomcat] branch 10.0.x updated: Update the URL to Maven Central to the one under an ASF domain

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 4bc3579  Update the URL to Maven Central to the one under an ASF domain
4bc3579 is described below

commit 4bc35799679c4660eb53f975d6169d8bfc797249
Author: Mark Thomas 
AuthorDate: Thu Jun 24 08:43:40 2021 +0100

Update the URL to Maven Central to the one under an ASF domain
---
 webapps/docs/maven-jars.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/maven-jars.xml b/webapps/docs/maven-jars.xml
index d8fb897..7320452 100644
--- a/webapps/docs/maven-jars.xml
+++ b/webapps/docs/maven-jars.xml
@@ -46,10 +46,10 @@
 
   
 Stable releases are published to the
-https://repo1.maven.org/maven2/org/apache/tomcat/;>Maven
+https://repo.maven.apache.org/maven2/org/apache/tomcat/;>Maven
 Central Repository. The URL for this is
   
-  https://repo1.maven.org/maven2/org/apache/tomcat/
+  https://repo.maven.apache.org/maven2/org/apache/tomcat/
 
 
 

-
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 the URL to Maven Central to the one under an ASF domain

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 3bdc171  Update the URL to Maven Central to the one under an ASF domain
3bdc171 is described below

commit 3bdc1717bb050645b8e8d8d9503b40679997a5b9
Author: Mark Thomas 
AuthorDate: Thu Jun 24 08:43:40 2021 +0100

Update the URL to Maven Central to the one under an ASF domain
---
 webapps/docs/maven-jars.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/maven-jars.xml b/webapps/docs/maven-jars.xml
index d8fb897..7320452 100644
--- a/webapps/docs/maven-jars.xml
+++ b/webapps/docs/maven-jars.xml
@@ -46,10 +46,10 @@
 
   
 Stable releases are published to the
-https://repo1.maven.org/maven2/org/apache/tomcat/;>Maven
+https://repo.maven.apache.org/maven2/org/apache/tomcat/;>Maven
 Central Repository. The URL for this is
   
-  https://repo1.maven.org/maven2/org/apache/tomcat/
+  https://repo.maven.apache.org/maven2/org/apache/tomcat/
 
 
 

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



[tomcat] branch main updated: Update the URL to Maven Central to the one under an ASF domain

2021-06-24 Thread markt
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 d1682cf  Update the URL to Maven Central to the one under an ASF domain
d1682cf is described below

commit d1682cf8e19c44424416c27d0999abc669d18515
Author: Mark Thomas 
AuthorDate: Thu Jun 24 08:43:40 2021 +0100

Update the URL to Maven Central to the one under an ASF domain
---
 webapps/docs/maven-jars.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/maven-jars.xml b/webapps/docs/maven-jars.xml
index d8fb897..7320452 100644
--- a/webapps/docs/maven-jars.xml
+++ b/webapps/docs/maven-jars.xml
@@ -46,10 +46,10 @@
 
   
 Stable releases are published to the
-https://repo1.maven.org/maven2/org/apache/tomcat/;>Maven
+https://repo.maven.apache.org/maven2/org/apache/tomcat/;>Maven
 Central Repository. The URL for this is
   
-  https://repo1.maven.org/maven2/org/apache/tomcat/
+  https://repo.maven.apache.org/maven2/org/apache/tomcat/
 
 
 

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