Commit b799ff58 authored by Emmanuel Bourg's avatar Emmanuel Bourg

New upstream version 9.0.21

parent dfc41934
......@@ -30,6 +30,8 @@ mvn.properties
.settings
.idea
*.iml
*.ipr
*.iws
*.asc
*.jj
*.tmp
......
......@@ -523,7 +523,7 @@ target. The command is:
NOTE: FindBugs is licensed under LGPL. Using Findbugs during Tomcat build is
optional and is off by default.
See http://findbugs.sourceforge.net/ for more information.
See https://spotbugs.github.io/ for more information.
To enable FindBugs, add the following property to build.properties file:
......@@ -545,15 +545,12 @@ The report file by default is written to
You usually would not need to run this check. You can skip this section.
Apache Tomcat project has convention that all of its textual source files,
stored in Subversion repository, are marked with Subversion property
"svn:eol-style" with value of "native". This convention makes the editing
of source code on different platforms easier.
stored in the Git repository, use Unix style LF line endings.
This test is used by developers to check that the source code adheres to
this convention. It verifies that the ends of lines in textual files are
appropriate for the operating system where it is run. The idea is to run
this check regularly on two different platforms and notify developers when
an inconsistency is detected.
appropriate. The idea is to run this check regularly and notify developers
when an inconsistency is detected.
The command to run this test is:
......
......@@ -228,7 +228,7 @@ fi
# Bugzilla 37848: When no TTY is available, don't output to console
have_tty=0
if [ "`tty`" != "not a tty" ]; then
if [ -t 1 ]; then
have_tty=1
fi
......
......@@ -25,7 +25,7 @@
# ----- Version Control Flags -----
version.major=9
version.minor=0
version.build=20
version.build=21
version.patch=0
version.suffix=
......@@ -264,13 +264,13 @@ cobertura.jar=${cobertura.home}/cobertura-${cobertura.version}.jar
cobertura.loc=${base-sf.loc}/cobertura/cobertura-2.1.1-bin.tar.gz
# ----- Findbugs -----
findbugs.version=3.0.1
findbugs.version=3.1.12
findbugs.checksum.enabled=true
findbugs.checksum.algorithm=MD5|SHA-1
findbugs.checksum.value=dec8828de8657910fcb258ce5383c168|59a24064ca6869e483ce9a04d3c50d14a227d5e6
findbugs.home=${base.path}/findbugs-${findbugs.version}
findbugs.jar=${findbugs.home}/lib/findbugs-ant.jar
findbugs.loc=${base-sf.loc}/project/findbugs/findbugs/${findbugs.version}/findbugs-${findbugs.version}.tar.gz
findbugs.checksum.value=8c54502a8e1b78ea6b173a186ce6f379|95114d9aaeeba7bd4ea5a3d6a2167cd6c87bb943
findbugs.home=${base.path}/spotbugs-${findbugs.version}
findbugs.jar=${findbugs.home}/lib/spotbugs-ant.jar
findbugs.loc=${base-maven.loc}/com/github/spotbugs/spotbugs/${findbugs.version}/spotbugs-${findbugs.version}.tgz
# ----- SAAJ API, used by Code Signing for releases -----
# ----- No longer part of JRE from Java 11 onwards -----
......
......@@ -625,7 +625,6 @@
source="${compile.source}"
target="${compile.target}"
release="${compile.release}"
excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<!-- Uncomment this to show unchecked warnings:
......@@ -638,7 +637,7 @@
classname="org.apache.tomcat.buildutil.CheckEol"
classpath="${tomcat.classes}" />
<checkeol>
<checkeol mode="LF">
<fileset dir="." >
<patternset refid="text.files" />
<include name="**/*.bat"/>
......@@ -681,7 +680,6 @@
source="${compile.source}"
target="${compile.target}"
release="${compile.release}"
excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<!-- Uncomment this to show unchecked warnings:
......@@ -1203,7 +1201,6 @@
target="${compile.target}"
release="${compile.release}"
classpath="${tomcat.classes}"
excludes="**/CVS/**,**/.svn/**"
encoding="ISO-8859-1"
includeantruntime="false">
</javac>
......@@ -1216,7 +1213,6 @@
target="${compile.target}"
release="${compile.release}"
classpath="${tomcat.classes}"
excludes="**/CVS/**,**/.svn/**"
encoding="ISO-8859-1"
includeantruntime="false">
</javac>
......@@ -1478,42 +1474,13 @@
<property name="junit.formatter.extension" value=".txt" />
<target name="test" description="Runs the JUnit test cases"
depends="test-nio,test-nio2,test-apr,cobertura-report" >
<fileset id="test.result.skippedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Skipped: 0" />
</not>
</fileset>
<fileset id="test.result.failedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Failures: 0, Errors: 0" />
</not>
</fileset>
<concat>
<header>Testsuites with skipped tests:${line.separator}</header>
<string>${toString:test.result.skippedtests}</string>
<filterchain>
<tokenfilter delimOutput="${line.separator}">
<stringtokenizer delims=";"/>
</tokenfilter>
</filterchain>
</concat>
<concat>
<header>Testsuites with failed tests:${line.separator}</header>
<string>${toString:test.result.failedtests}</string>
<filterchain>
<tokenfilter delimOutput="${line.separator}">
<stringtokenizer delims=";"/>
</tokenfilter>
</filterchain>
</concat>
<fail if="test.result.error" message='Some tests completed with an Error. See ${tomcat.build}/logs for details, search for "ERROR".' />
<fail if="test.result.failure" message='Some tests completed with a Failure. See ${tomcat.build}/logs for details, search for "FAILED".' />
</target>
depends="test-nio,test-nio2,test-apr,cobertura-report,test-status" />
<target name="test-only" description="Runs the JUnit test cases without additional processing"
depends="test-only-nio,test-only-nio2,test-only-apr" >
depends="test-only-nio,test-only-nio2,test-only-apr,test-status" />
<target name="test-status"
description="Analyses logs directory and reports on skipped tests, test failures and test errors">
<fileset id="test.result.skippedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Skipped: 0" />
......
......@@ -46,9 +46,13 @@
only if the new code is made subject to such option by the copyright
holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The Apache Software Foundation elects to include this software under the
CDDL license.
</xsd:documentation>
</xsd:annotation>
......
......@@ -47,9 +47,13 @@
only if the new code is made subject to such option by the copyright
holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The Apache Software Foundation elects to include this software under the
CDDL license.
</xsd:documentation>
</xsd:annotation>
......@@ -348,7 +352,7 @@
<xsd:annotation>
<xsd:documentation>
To be used with JAX-RPC based runtime only.
To be used with JAX-RPC based runtime only.
</xsd:documentation>
</xsd:annotation>
......@@ -360,7 +364,7 @@
<xsd:annotation>
<xsd:documentation>
To be used with JAX-WS based runtime only.
To be used with JAX-WS based runtime only.
</xsd:documentation>
</xsd:annotation>
......@@ -489,7 +493,7 @@
<xsd:documentation>
The jaxrpc-mapping-file element contains the name of a file that
describes the JAX-RPC mapping between the Java interaces used by
describes the JAX-RPC mapping between the Java interfaces used by
the application and the WSDL description in the wsdl-file. The
file name is a relative path within the module.
......@@ -534,17 +538,17 @@
<xsd:annotation>
<xsd:documentation>
<![CDATA[[
The port-component-name element specifies a port
component's name. This name is assigned by the module
producer to name the service implementation bean in the
module's deployment descriptor. The name must be unique
among the port component names defined in the same module.
The port-component-name element specifies a port
component's name. This name is assigned by the module
producer to name the service implementation bean in the
module's deployment descriptor. The name must be unique
among the port component names defined in the same module.
Used in: port-component
Used in: port-component
Example:
<port-component-name>EmployeeService
</port-component-name>
Example:
<port-component-name>EmployeeService
</port-component-name>
......
......@@ -47,9 +47,13 @@
only if the new code is made subject to such option by the copyright
holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The Apache Software Foundation elects to include this software under the
CDDL license.
</xsd:documentation>
</xsd:annotation>
......@@ -149,7 +153,7 @@
<xsd:documentation>
The jaxrpc-mapping-file element contains the name of a file that
describes the JAX-RPC mapping between the Java interaces used by
describes the JAX-RPC mapping between the Java interfaces used by
the application and the WSDL description in the wsdl-file. The
file name is a relative path within the module file.
......@@ -196,13 +200,13 @@
<xsd:annotation>
<xsd:documentation>
Declares the handler for a port-component. Handlers can
access the init-param name/value pairs using the
HandlerInfo interface. If port-name is not specified, the
handler is assumed to be associated with all ports of the
service.
Declares the handler for a port-component. Handlers can
access the init-param name/value pairs using the
HandlerInfo interface. If port-name is not specified, the
handler is assumed to be associated with all ports of the
service.
To be used with JAX-RPC based runtime only.
To be used with JAX-RPC based runtime only.
</xsd:documentation>
</xsd:annotation>
......@@ -214,7 +218,7 @@
<xsd:annotation>
<xsd:documentation>
To be used with JAX-WS based runtime only.
To be used with JAX-WS based runtime only.
</xsd:documentation>
</xsd:annotation>
......@@ -484,31 +488,31 @@
Exact Name: service-name-pattern="ns1:EchoService"
In this case, handlers specified in this
handler-chain element will apply to all ports with
this exact service name. The namespace prefix must
have been declared in a namespace declaration
attribute in either the start-tag of the element
where the prefix is used or in an an ancestor
element (i.e. an element in whose content the
prefixed markup occurs)
In this case, handlers specified in this
handler-chain element will apply to all ports with
this exact service name. The namespace prefix must
have been declared in a namespace declaration
attribute in either the start-tag of the element
where the prefix is used or in an an ancestor
element (i.e. an element in whose content the
prefixed markup occurs)
Pattern : service-name-pattern="ns1:EchoService*"
In this case, handlers specified in this
handler-chain element will apply to all ports whose
Service names are like EchoService1, EchoServiceFoo
etc. The namespace prefix must have been declared in
a namespace declaration attribute in either the
start-tag of the element where the prefix is used or
in an an ancestor element (i.e. an element in whose
content the prefixed markup occurs)
In this case, handlers specified in this
handler-chain element will apply to all ports whose
Service names are like EchoService1, EchoServiceFoo
etc. The namespace prefix must have been declared in
a namespace declaration attribute in either the
start-tag of the element where the prefix is used or
in an an ancestor element (i.e. an element in whose
content the prefixed markup occurs)
Wild Card : service-name-pattern="*"
In this case, handlers specified in this handler-chain
element will apply to ports of all service names.
In this case, handlers specified in this handler-chain
element will apply to ports of all service names.
The same can be applied to port-name attribute in
handler-chain element.
......
......@@ -47,9 +47,13 @@
only if the new code is made subject to such option by the copyright
holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The Apache Software Foundation elects to include this software under the
CDDL license.
</xsd:documentation>
</xsd:annotation>
......
......@@ -47,9 +47,13 @@
only if the new code is made subject to such option by the copyright
holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The Apache Software Foundation elects to include this software under the
CDDL license.
</xsd:documentation>
</xsd:annotation>
......
......@@ -47,9 +47,13 @@
only if the new code is made subject to such option by the copyright
holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The Apache Software Foundation elects to include this software under the
CDDL license.
</xsd:documentation>
</xsd:annotation>
......
......@@ -930,6 +930,14 @@ public interface Context extends Container, ContextBind {
public void addWrapperListener(String listener);
/**
* Factory method to create and return a new InstanceManager
* instance. This can be used for framework integration or easier
* configuration with custom Context implementations.
* @return the instance manager
*/
public InstanceManager createInstanceManager();
/**
* Factory method to create and return a new Wrapper instance, of
* the Java implementation class appropriate for this Context
......
......@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
authenticator.formlogin=Neplatná přímá reference na formulář přihlašovací stránky
authenticator.jaspicCleanSubjectFail=Chyba čištění JASPIC předmětu
authenticator.jaspicServerAuthContextFail=Získání instance JASPIC ServerAuthContext selhalo
authenticator.sessionExpired=Časový rámec pro přihlášení byl překročen. Pokud chcete pokrařovat, tak musíte kliknout dvakrát zpět a znovu kliknout na požadovaný link, nebo zavřít a znovu otevřít Váš prohlížeč
......
......@@ -816,7 +816,7 @@ public class CoyoteAdapter implements Adapter {
if (wrapper != null) {
String[] methods = wrapper.getServletMethods();
if (methods != null) {
for (int i=0; i<methods.length; i++) {
for (int i=0; i < methods.length; i++) {
if ("TRACE".equals(methods[i])) {
continue;
}
......@@ -828,7 +828,9 @@ public class CoyoteAdapter implements Adapter {
}
}
}
res.addHeader("Allow", header);
if (header != null) {
res.addHeader("Allow", header);
}
response.sendError(405, "TRACE method is not allowed");
// Safe to skip the remainder of this method.
return true;
......
......@@ -80,6 +80,7 @@ inputBuffer.streamClosed=Stream closed
outputBuffer.writeNull=The String argument to write(String,int,int) may not be null
request.asyncNotSupported=A filter or servlet of the current chain does not support asynchronous operations.
request.fragmentInDispatchPath=The fragment in dispatch path [{0}] has been removed
request.illegalWrap=The request wrapper must wrap the request obtained from getRequest()
request.notAsync=It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
......
......@@ -26,5 +26,6 @@ coyoteInputStream.nbNotready=V neblokujícím módu nelze číst ServletInputStr
coyoteRequest.filterAsyncSupportUnknown=Nelze určit, zda některý filtr nepodporuje asynchronní zpracování
coyoteRequest.gssLifetimeFail=Selhalo získání zbývající doby trvání pro uživatele [{0}]
coyoteRequest.noMultipartConfig=Nelze zpracovat částí, neboť multi-part konfigurace nebyla dodána
coyoteRequest.sessionEndAccessFail=Výjimka vyvolala ukončení přístupu k session během recykllování dotazu
responseFacade.nullResponse=Objekt odpovědi byl recyklován a již není asociován s touto fasádou
......@@ -13,12 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
coyoteAdapter.checkRecycled.response=Eine nicht recycelte Antwort wurde erkannt und recylet
coyoteAdapter.debug=Die Variable [{0}] hat den Wert [{1}]
coyoteAdapter.parsePathParam=Das Parsen der Pfadparameter ist schlug mit der Kodierung [{0}] fehl. Die Parameter im Pfad werden ignoriert
coyoteConnector.invalidEncoding=Das Encoding [{0}] wird von der JRE nicht erkannt. Der Konnektor wird weiterhin [{1}] nutzen
coyoteConnector.invalidPort=Der Konnektor kann nicht starten, da der als Port angegebene Wert [{0}] nicht gültig ist.
coyoteConnector.protocolHandlerStartFailed=Der Start des Protokoll-Handlers ist fehlgeschlagen
coyoteRequest.filterAsyncSupportUnknown=Es konnte nicht ermittelt werden ob einer der Filter asyncrone Bearbeitung nicht unterstützt
coyoteRequest.gssLifetimeFail=Die verbleibende Lebenzeit für den Principal [{0}] konnte nicht ermittelt werden.
responseFacade.nullResponse=Das Response Objekt ist wiederverwendet worden und nicht mehr mit der Facade verknüpft.
......@@ -1212,13 +1212,31 @@ public class Request implements HttpServletRequest {
(sm.getString("coyoteRequest.getReader.ise"));
}
// InputBuffer has no easily accessible reference chain to the Context
// to check for a default request character encoding at the Context.
// Therefore, if a Context default should be used, it is set explicitly
// here. Need to do this before setting usingReader.
if (coyoteRequest.getCharacterEncoding() == null) {
// Nothing currently set explicitly.
// Check the content
Context context = getContext();
if (context != null) {
String enc = context.getRequestCharacterEncoding();
if (enc != null) {
// Explicitly set the context default so it is visible to
// InputBuffer when creating the Reader.
setCharacterEncoding(enc);
}
}
}
usingReader = true;
inputBuffer.checkConverter();
if (reader == null) {
reader = new CoyoteReader(inputBuffer);
}
return reader;
}
......@@ -1353,10 +1371,18 @@ public class Request implements HttpServletRequest {
return null;
}
// If the path is already context-relative, just pass it through
if (path == null) {
return null;
} else if (path.startsWith("/")) {
}
int fragmentPos = path.indexOf('#');
if (fragmentPos > -1) {
log.warn(sm.getString("request.fragmentInDispatchPath", path));
path = path.substring(0, fragmentPos);
}
// If the path is already context-relative, just pass it through
if (path.startsWith("/")) {
return context.getServletContext().getRequestDispatcher(path);
}
......@@ -2974,11 +3000,9 @@ public class Request implements HttpServletRequest {
if (!create) {
return null;
}
if (response != null
&& context.getServletContext()
.getEffectiveSessionTrackingModes()
.contains(SessionTrackingMode.COOKIE)
&& response.getResponse().isCommitted()) {
boolean trackModesIncludesCookie =
context.getServletContext().getEffectiveSessionTrackingModes().contains(SessionTrackingMode.COOKIE);
if (trackModesIncludesCookie && response.getResponse().isCommitted()) {
throw new IllegalStateException(
sm.getString("coyoteRequest.sessionCreateCommitted"));
}
......@@ -3027,13 +3051,9 @@ public class Request implements HttpServletRequest {
session = manager.createSession(sessionId);
// Creating a new session cookie based on that session
if (session != null
&& context.getServletContext()
.getEffectiveSessionTrackingModes()
.contains(SessionTrackingMode.COOKIE)) {
Cookie cookie =
ApplicationSessionCookieConfig.createSessionCookie(
context, session.getIdInternal(), isSecure());
if (session != null && trackModesIncludesCookie) {
Cookie cookie = ApplicationSessionCookieConfig.createSessionCookie(
context, session.getIdInternal(), isSecure());
response.addSessionCookieInternal(cookie);
}
......
......@@ -34,7 +34,6 @@ import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Vector;
import java.util.function.Supplier;
import javax.servlet.ServletOutputStream;
......@@ -867,10 +866,9 @@ public class Response implements HttpServletResponse {
@Override
public Collection<String> getHeaderNames() {
MimeHeaders headers = getCoyoteResponse().getMimeHeaders();
int n = headers.size();
List<String> result = new ArrayList<>(n);
ArrayList<String> result = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
result.add(headers.getName(i).toString());
}
......@@ -881,12 +879,11 @@ public class Response implements HttpServletResponse {
@Override
public Collection<String> getHeaders(String name) {
Enumeration<String> enumeration =
getCoyoteResponse().getMimeHeaders().values(name);
Vector<String> result = new Vector<>();
ArrayList<String> result = new ArrayList<>();
while (enumeration.hasMoreElements()) {
result.addElement(enumeration.nextElement());
result.add(enumeration.nextElement());
}
return result;
}
......
......@@ -48,9 +48,11 @@ import org.apache.catalina.Session;
import org.apache.catalina.connector.RequestFacade;
import org.apache.catalina.util.ParameterMap;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.URLEncoder;
import org.apache.tomcat.util.buf.B2CConverter;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.Parameters;
import org.apache.tomcat.util.res.StringManager;
/**
......@@ -70,9 +72,7 @@ import org.apache.tomcat.util.http.Parameters;
*/
class ApplicationHttpRequest extends HttpServletRequestWrapper {
// ------------------------------------------------------- Static Variables
private static final StringManager sm = StringManager.getManager(ApplicationHttpRequest.class);
/**
* The set of attribute names that are special for request dispatchers.
......@@ -321,11 +321,20 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper {
if (context == null)
return null;
// If the path is already context-relative, just pass it through
if (path == null)
if (path == null) {
return null;
else if (path.startsWith("/"))
}
int fragmentPos = path.indexOf('#');
if (fragmentPos > -1) {
context.getLogger().warn(sm.getString("applicationHttpRequest.fragmentInDispatchPath", path));
path = path.substring(0, fragmentPos);
}
// If the path is already context-relative, just pass it through
if (path.startsWith("/")) {
return context.getServletContext().getRequestDispatcher(path);
}
// Convert a request-relative path to a context-relative one
String servletPath =
......@@ -345,10 +354,19 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper {
int pos = requestPath.lastIndexOf('/');
String relative = null;
if (pos >= 0) {
relative = requestPath.substring(0, pos + 1) + path;
if (context.getDispatchersUseEncodedPaths()) {
if (pos >= 0) {
relative = URLEncoder.DEFAULT.encode(
requestPath.substring(0, pos + 1), StandardCharsets.UTF_8) + path;
} else {
relative = URLEncoder.DEFAULT.encode(requestPath, StandardCharsets.UTF_8) + path;
}
} else {
relative = requestPath + path;
if (pos >= 0) {
relative = requestPath.substring(0, pos + 1) + path;
} else {
relative = requestPath + path;
}
}
return context.getServletContext().getRequestDispatcher(relative);
......
......@@ -693,8 +693,10 @@ public abstract class ContainerBase extends LifecycleMBeanBase
private void addChildInternal(Container child) {
if( log.isDebugEnabled() )
if (log.isDebugEnabled()) {
log.debug("Add child " + child + " " + this);
}
</