Re: PooledConnection#connectUsingDriver, Thread.currentThread().getContextClassLoader() is null

2019-07-29 Thread Romain Manni-Bucau
Can you give a try on a more recent tomcat version? Seems it works with
master version since the tomcat-jdbc module classloader is tried first
before the tccl?
Tested with:

public class PooledConnectionTest {
@Test
public void avoidNPEWhenTcclIsNull() throws SQLException {
final PoolProperties poolProperties = new PoolProperties();
poolProperties.setDriverClassName("org.h2.Driver");
poolProperties.setUsername("sa");
poolProperties.setPassword("");

poolProperties.setUrl("jdbc:h2:mem:PooledConnectionTest_avoidNPEWhenTcclIsNull");
poolProperties.setMaxIdle(1);
poolProperties.setMinIdle(1);
poolProperties.setInitialSize(1);
poolProperties.setMaxActive(1);

ensureDataSourceIsValid(poolProperties);

final Thread thread = Thread.currentThread();
final ClassLoader testLoader = thread.getContextClassLoader();
thread.setContextClassLoader(null);
try {
ensureDataSourceIsValid(poolProperties);
} finally {
thread.setContextClassLoader(testLoader);
}
}

private void ensureDataSourceIsValid(final PoolProperties
poolProperties) throws SQLException {
final DataSource dataSource = new DataSource(poolProperties);
try (final Connection connection = dataSource.getConnection()) {
assertTrue(connection.isValid(5));
} finally {
dataSource.close();
}
}
}


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le lun. 29 juil. 2019 à 07:36, Clemens Wyss DEV  a
écrit :

> https://bz.apache.org/bugzilla/show_bug.cgi?id=63612
>
>
> > with a small project reproducing it?
>
> Unfortunately not easily extractable/reproducible
>
> Maybe :
>
> th = new Thread() {
> @Override
>
> public void run() {
> « do something that requires a connection from the pool »
>
> }
> } ;
> th.set getContextClassLoader( null ) ;
> th.run() ;
>
>
>
> *Von:* Romain Manni-Bucau 
> *Gesendet:* Donnerstag, 25. Juli 2019 08:06
> *An:* Tomcat Developers List 
> *Betreff:* Re: PooledConnection#connectUsingDriver,
> Thread.currentThread().getContextClassLoader() is null
>
>
>
>
>
> Le jeu. 25 juil. 2019 à 07:46, Clemens Wyss DEV  a
> écrit :
>
> < mais c'était rapide 😉 >
> >+1
> should/can I file a bug?
>
>
>
> Guess so, with a small project reproducing it?
>
>
>
>
> > init at bootstrap the pool (initial size) to ensure it is in one tomcat
> classloader
> how would you achieve this? By setting «initialSize» to «maxSize» in
> PoolProperties?
>
>
>
> 1 should be sufficient, however tomcat-jdbc (vs dbcp2 for instance) loads
> it per connection and not once for all the pool (
> https://github.com/apache/tomcat/blob/master/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java#L196)
> which is likely 1. Bad for perf but moreover 2. Buggy if the classloader
> changes between usages of a connection in apps. Loader, driver should be
> loaded once and potentially the datasource be duplicated per app if needed
> (driver in the app) IMHO. This would also fix your NPE transitively ;).
>
>
>
>
>
>
>
>
> --
> Von: Romain Manni-Bucau 
> Gesendet: Donnerstag, 25. Juli 2019 07:30
> An: Tomcat Developers List 
> Betreff: Re: PooledConnection#connectUsingDriver,
> Thread.currentThread().getContextClassLoader() is null
>
> +1, there is no real other option AFAIK until you init at bootstrap the
> pool (initial size) to ensure it is in one tomcat classloader.
>
> Le jeu. 25 juil. 2019 à 07:08, Clemens Wyss DEV  clemens...@mysign.ch> a écrit :
> I tried posting this in the tomcat-users-ml, but I guess it rather fits
> here:
> --
> Context:
> Debian GNU/Linux 9 \n \l
> java version 1.8.0_162
> Tomcat 8.5.35
>
> From time to time we are facing the follwing exception (call stack):
> ...
> Caused by: java.sql.SQLException: Unable to load class:
> org.mariadb.jdbc.Driver from ClassLoader:http://java.net
> .URLClassLoader@4c873330;ClassLoader:null
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:292)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:736)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:668)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:198)
> at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:132)
> at org.apache

Re: [VOTE] Release Apache Tomcat 7.0.96

2019-07-29 Thread Violeta Georgieva
На сб, 27.07.2019 г. в 1:06 ч. Rainer Jung  написа:
>
>
>
> Am 26.07.2019 um 22:57 schrieb Rainer Jung:
> > Am 24.07.2019 um 15:56 schrieb Violeta Georgieva:
> >> The proposed Apache Tomcat 7.0.96 release is now available for voting.
> >>
> >> For full details, see the changelog:
> >> https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
> >>
> >> It can be obtained from:
> >> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.96/
> >> The Maven staging repo is:
> >>
https://repository.apache.org/content/repositories/orgapachetomcat-1224/
> >> The git tag is:
> >> https://github.com/apache/tomcat/tree/7.0.96
> >> 5277b175db2e575022672856797240976ad23bcf
> >>
> >> The proposed 7.0.96 release is:
> >> [ ] Broken - do not release
> >> [ ] Stable - go ahead and release as 7.0.96 Stable
> >
> > I observed the same hang on three different Linux systems when using
> > OpenJDK 13-ea+29. Surely early access. The hang is always in
> > TestAbstractAjpProcessor for NIO in test testKeepAlive. The hanging JVM
> > process only shows the AJP client:
> >
> > "main" #1 prio=5 os_prio=0 cpu=1497.40ms elapsed=18779.47s
> > tid=0x7ff040017800 nid=0x7ea3 runnable  [0x7ff046b74000]
> > java.lang.Thread.State: RUNNABLE
> >  at sun.nio.ch.SocketDispatcher.read0(java.base@13-ea/Native
> > Method)
> >  at
> > sun.nio.ch.SocketDispatcher.read(java.base@13-ea
/SocketDispatcher.java:47)
> >  at
> > sun.nio.ch.NioSocketImpl.tryRead(java.base@13-ea/NioSocketImpl.java:262)
> >  at
> > sun.nio.ch.NioSocketImpl.implRead(java.base@13-ea
/NioSocketImpl.java:313)
> >  at
> > sun.nio.ch.NioSocketImpl.read(java.base@13-ea/NioSocketImpl.java:351)
> >  at
> > sun.nio.ch.NioSocketImpl$1.read(java.base@13-ea/NioSocketImpl.java:802)
> >  at
> > java.net.Socket$SocketInputStream.read(java.base@13-ea/Socket.java:919)
> >  at
> > org.apache.coyote.ajp.SimpleAjpClient.read(SimpleAjpClient.java:390)
> >  at
> >
org.apache.coyote.ajp.SimpleAjpClient.readMessage(SimpleAjpClient.java:365)
> >  at
> > org.apache.coyote.ajp.SimpleAjpClient.cping(SimpleAjpClient.java:350)
> >  at
> >
org.apache.coyote.ajp.TestAbstractAjpProcessor.testKeepAlive(TestAbstractAjpProcessor.java:526)
> >
> > ...
> >
> > but the log indicates a problem:
> >
> > INFO: Starting test case [testKeepAlive]
> > Jul 26, 2019 5:20:37 PM org.apache.coyote.AbstractProtocol init
> > INFO: Initializing ProtocolHandler ["ajp-nio-127.0.0.1-auto-6"]
> > Jul 26, 2019 5:20:37 PM org.apache.coyote.AbstractProtocol init
> > SEVERE: Failed to initialize end point associated with ProtocolHandler
> > ["ajp-nio-127.0.0.1-auto-6-34726"]
> > java.lang.IllegalArgumentException: timeout < 0
> >  at
> >
java.base/sun.nio.ch.ServerSocketAdaptor.setSoTimeout(ServerSocketAdaptor.java:153)
> >
> >  at
> > org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:477)
> >  at
> >
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:728)
> >  at
> > org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:452)
> >  at
> > org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
> >  at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >  at
> >
org.apache.catalina.core.StandardService.initInternal(StandardService.java:560)
> >
> >  at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >  at
> >
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:840)
> >
> >  at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
> >  at
> > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:135)
> >  at org.apache.catalina.startup.Tomcat.start(Tomcat.java:449)
> >  at
> >
org.apache.catalina.startup.TomcatBaseTest$TomcatWithFastSessionIDs.start(TomcatBaseTest.java:808)
> >
> >  at
> >
org.apache.coyote.ajp.TestAbstractAjpProcessor.testKeepAlive(TestAbstractAjpProcessor.java:513)
> >
> >  at
> > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >  at
> >
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >
> >  at
> >
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >
> >  at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> >  at
> >
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> >
> >  at
> >
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> >
> >  at
> >
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> >
> >  at
> >
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> >
> >  at
> >
org.junit.internal.ru

Re: [VOTE] Release Apache Tomcat 7.0.96

2019-07-29 Thread Mark Thomas
On 29/07/2019 09:57, Violeta Georgieva wrote:
> На сб, 27.07.2019 г. в 1:06 ч. Rainer Jung 

>> The test seems to set a socket timeout to -1, which is no longer allowed
>> by the following change:
>>
>>
> https://github.com/unofficial-openjdk/openjdk/commit/3a77350f194df226cb6d618589a59d36fae9dc9c
>>
>> in JDK 13+.
>>
>> The magic value -1 for timeouts are mor efrequent in our code, but I
>> don't know which of these might end up in a setSoTimeout() call.
> 
> I don't think this is a showstopper for Tomcat 7 and I'm thinking about
> promoting this release candidate.

+1

Mark

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



Re: [VOTE] Release Apache Tomcat 7.0.96

2019-07-29 Thread Violeta Georgieva
Hi,

На ср, 24.07.2019 г. в 16:56 ч. Violeta Georgieva 
написа:
>
> The proposed Apache Tomcat 7.0.96 release is now available for voting.
>
> For full details, see the changelog:
> https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.96/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1224/
> The git tag is:
> https://github.com/apache/tomcat/tree/7.0.96
> 5277b175db2e575022672856797240976ad23bcf
>
> The proposed 7.0.96 release is:
> [ ] Broken - do not release
> [ ] Stable - go ahead and release as 7.0.96 Stable

We still need at least one more vote here.

Thanks in advance,
Violeta

>


Re: [VOTE] Release Apache Tomcat 7.0.96

2019-07-29 Thread Felix Schumacher



Am 24. Juli 2019 15:56:53 MESZ schrieb Violeta Georgieva :
>The proposed Apache Tomcat 7.0.96 release is now available for voting.
>
>For full details, see the changelog:
>https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
>
>It can be obtained from:
>https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.96/
>The Maven staging repo is:
>https://repository.apache.org/content/repositories/orgapachetomcat-1224/
>The git tag is:
>https://github.com/apache/tomcat/tree/7.0.96
>5277b175db2e575022672856797240976ad23bcf
>
>The proposed 7.0.96 release is:
>[ ] Broken - do not release
>[x] Stable - go ahead and release as 7.0.96 Stable

Regards
 Felix 

>
>Regards,
>Violeta

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



[tomcat] branch master updated: Fix typo in error message

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 6c2969f  Fix typo in error message
6c2969f is described below

commit 6c2969f8f80588e8f5a1427a7980b1c6e6625499
Author: Mark Thomas 
AuthorDate: Mon Jul 29 10:24:04 2019 +0100

Fix typo in error message
---
 res/tomcat.nsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/tomcat.nsi b/res/tomcat.nsi
index 173932d..6f9304f 100644
--- a/res/tomcat.nsi
+++ b/res/tomcat.nsi
@@ -374,7 +374,7 @@ Section -post
   StrCmp $0 "0" SetPermissionsOk
 FileWrite $ServiceInstallLog "Install failed (setting file permissions): 
$0 $1$\r$\n"
 MessageBox MB_YESNO|MB_ICONSTOP \
-  "Failed to set file permisisons.$\r$\nCheck your settings and 
permissions.$\r$\nIgnore and continue anyway (not recommended)?" \
+  "Failed to set file permissions.$\r$\nCheck your settings and 
permissions.$\r$\nIgnore and continue anyway (not recommended)?" \
   /SD IDNO IDYES SetPermissionsOk
   Quit
   SetPermissionsOk:


-
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: Fix typo in error message

2019-07-29 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 eb3c52f  Fix typo in error message
eb3c52f is described below

commit eb3c52fb44d64ff6ea486b0410bc27be9bf8f768
Author: Mark Thomas 
AuthorDate: Mon Jul 29 10:24:04 2019 +0100

Fix typo in error message
---
 res/tomcat.nsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/tomcat.nsi b/res/tomcat.nsi
index 0175f12..646487e 100644
--- a/res/tomcat.nsi
+++ b/res/tomcat.nsi
@@ -374,7 +374,7 @@ Section -post
   StrCmp $0 "0" SetPermissionsOk
 FileWrite $ServiceInstallLog "Install failed (setting file permissions): 
$0 $1$\r$\n"
 MessageBox MB_YESNO|MB_ICONSTOP \
-  "Failed to set file permisisons.$\r$\nCheck your settings and 
permissions.$\r$\nIgnore and continue anyway (not recommended)?" \
+  "Failed to set file permissions.$\r$\nCheck your settings and 
permissions.$\r$\nIgnore and continue anyway (not recommended)?" \
   /SD IDNO IDYES SetPermissionsOk
   Quit
   SetPermissionsOk:


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



[tomcat] branch 7.0.x updated: Fix typo in error message

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 77b92a2  Fix typo in error message
77b92a2 is described below

commit 77b92a2f38c1e29579c368d6fc29a3f786e749d5
Author: Mark Thomas 
AuthorDate: Mon Jul 29 10:24:04 2019 +0100

Fix typo in error message
---
 res/tomcat.nsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/tomcat.nsi b/res/tomcat.nsi
index 511c734..58d6d57 100644
--- a/res/tomcat.nsi
+++ b/res/tomcat.nsi
@@ -373,7 +373,7 @@ Section -post
   StrCmp $0 "0" SetPermissionsOk
 FileWrite $ServiceInstallLog "Install failed (setting file permissions): 
$0 $1$\r$\n"
 MessageBox MB_YESNO|MB_ICONSTOP \
-  "Failed to set file permisisons.$\r$\nCheck your settings and 
permissions.$\r$\nIgnore and continue anyway (not recommended)?" \
+  "Failed to set file permissions.$\r$\nCheck your settings and 
permissions.$\r$\nIgnore and continue anyway (not recommended)?" \
   /SD IDNO IDYES SetPermissionsOk
   Quit
   SetPermissionsOk:


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



[GitHub] [tomcat] markt-asf commented on issue #139: service.bat handles changed Service at installation

2019-07-29 Thread GitBox
markt-asf commented on issue #139: service.bat handles changed Service at 
installation
URL: https://github.com/apache/tomcat/pull/139#issuecomment-515918939
 
 
   I started to implement the above suggestion and hit another issue. If you 
install via the installer with a non-standard name you can;t rename the service 
because the .exe files have been renamed.
   
   Having looked at various options I think the best option is as follows:
   - leave the installer as is
   - require the service name to be provided unless the default name is used
   - rename .exe files when installing non-default service name from batch file 
(to align with installer behaviour)
   - rename .exe files to defaults when uninstalling non-default service name 
from batch file (to allow subsequent installations to use any valid service 
name)
   
   These last two points are the main change. Unless there are objections, I'll 
proceed on this basis later this week.


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


With regards,
Apache Git Services

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



[tomcat] branch 8.5.x updated (eb3c52f -> 4fa6a00)

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

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


from eb3c52f  Fix typo in error message
 new 51f00c2  Align with master. Back-port simple clean-up.
 new b5c04d5  Align with master. Back-port i18n support.
 new 703f85a  SpotBugs Refactor to remove some duplicated (and unused) code.
 new 4fa6a00  Address a few more SpotBugs warnings

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/org/apache/catalina/startup/ExpandWar.java| 13 +++-
 .../catalina/startup/LocalStrings.properties   |  3 +
 java/org/apache/catalina/startup/Tomcat.java   |  5 +-
 java/org/apache/catalina/util/URLEncoder.java  |  2 +-
 .../rewrite}/LocalStrings.properties   |  7 +-
 .../rewrite}/LocalStrings_fr.properties|  6 +-
 .../valves/rewrite}/LocalStrings_ja.properties |  9 +--
 .../catalina/valves/rewrite/RewriteCond.java   | 82 +++---
 .../catalina/valves/rewrite/RewriteRule.java   |  6 +-
 .../catalina/valves/rewrite/RewriteValve.java  | 39 +-
 .../catalina/valves/rewrite/Substitution.java  |  3 +-
 .../org/apache/el/stream/StreamELResolverImpl.java |  7 +-
 res/findbugs/filter-false-positives.xml| 12 
 13 files changed, 101 insertions(+), 93 deletions(-)
 copy java/org/apache/catalina/{ha/authenticator => 
valves/rewrite}/LocalStrings.properties (74%)
 copy java/org/apache/catalina/{filters => 
valves/rewrite}/LocalStrings_fr.properties (69%)
 copy java/{javax/servlet => 
org/apache/catalina/valves/rewrite}/LocalStrings_ja.properties (72%)


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



[tomcat] 04/04: Address a few more SpotBugs warnings

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

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

commit 4fa6a00a582ed6726451e71ac8f76e868631cb98
Author: Mark Thomas 
AuthorDate: Fri Dec 1 20:35:35 2017 +

Address a few more SpotBugs warnings
---
 java/org/apache/catalina/startup/ExpandWar.java   | 13 ++---
 java/org/apache/catalina/startup/LocalStrings.properties  |  3 +++
 java/org/apache/catalina/startup/Tomcat.java  |  5 -
 java/org/apache/catalina/util/URLEncoder.java |  2 +-
 java/org/apache/catalina/valves/rewrite/RewriteValve.java |  8 
 java/org/apache/el/stream/StreamELResolverImpl.java   |  7 ++-
 res/findbugs/filter-false-positives.xml   | 12 
 7 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/startup/ExpandWar.java 
b/java/org/apache/catalina/startup/ExpandWar.java
index 053464f..7fd7144 100644
--- a/java/org/apache/catalina/startup/ExpandWar.java
+++ b/java/org/apache/catalina/startup/ExpandWar.java
@@ -166,15 +166,22 @@ public class ExpandWar {
 expand(input, expandedFile);
 long lastModified = jarEntry.getTime();
 if ((lastModified != -1) && (lastModified != 0)) {
-expandedFile.setLastModified(lastModified);
+if (!expandedFile.setLastModified(lastModified)) {
+throw new IOException(
+
sm.getString("expandWar.lastModifiedFailed", expandedFile));
+}
 }
 }
 }
 
 // Create the warTracker file and align the last modified time
 // with the last modified time of the WAR
-warTracker.createNewFile();
-warTracker.setLastModified(warLastModified);
+if (!warTracker.createNewFile()) {
+throw new 
IOException(sm.getString("expandWar.createFileFailed", warTracker));
+}
+if (!warTracker.setLastModified(warLastModified)) {
+throw new 
IOException(sm.getString("expandWar.lastModifiedFailed", warTracker));
+}
 
 success = true;
 } catch (IOException e) {
diff --git a/java/org/apache/catalina/startup/LocalStrings.properties 
b/java/org/apache/catalina/startup/LocalStrings.properties
index a55f45d..8b1a617 100644
--- a/java/org/apache/catalina/startup/LocalStrings.properties
+++ b/java/org/apache/catalina/startup/LocalStrings.properties
@@ -87,9 +87,11 @@ engineConfig.stop=EngineConfig: Processing STOP
 
 expandWar.copy=Error copying [{0}] to [{1}]
 expandWar.createFailed=Unable to create the directory [{0}]
+expandWar.createFileFailed=Unable to create the file [{0}]
 expandWar.deleteFailed=[{0}] could not be completely deleted. The presence of 
the remaining files may cause problems
 expandWar.deleteOld=An expanded directory [{0}] was found with a last modified 
time that did not match the associated WAR. It will be deleted.
 expandWar.illegalPath=The archive [{0}] is malformed and will be ignored: an 
entry contains an illegal path [{1}] which was not expanded to [{2}] since that 
is outside of the defined docBase [{3}]
+expandWar.lastModifiedFailed=Unable to set the last modified time for [{0}]
 expandWar.missingJarEntry=Cannot get input stream for JarEntry [{0}] - broken 
WAR file?
 
 failedContext.start=Failed to process either the global, per-host or 
context-specific context.xml file therefore the [{0}] Context cannot be started.
@@ -136,6 +138,7 @@ passwdUserDatabase.readFail=Failed to obtain a complete set 
of users from /etc/p
 
 tomcat.addWebapp.conflictChild=Unable to deploy WAR at [{0}] to context path 
[{1}] because of existing context [{2}]
 tomcat.addWebapp.conflictFile=Unable to deploy WAR at [{0}] to context path 
[{1}] because of existing file [{2}]
+tomcat.homeDirMakeFail=Unable to create the directory [{0}] to use as the home 
directory
 
 userConfig.database=Exception loading user database
 userConfig.deploy=Deploying web application for user [{0}]
diff --git a/java/org/apache/catalina/startup/Tomcat.java 
b/java/org/apache/catalina/startup/Tomcat.java
index 5102a37..297f1f4 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -808,7 +808,10 @@ public class Tomcat {
 server.setCatalinaHome(baseFile);
 } else {
 File homeFile = new File(catalinaHome);
-homeFile.mkdirs();
+if (!homeFile.isDirectory() && !homeFile.mkdirs()) {
+// Failed to create home directory
+throw new 
IllegalStateException(sm.getString("tomcat.homeDirMakeFail", homeFile));
+}
 try {
 homeFile = homeFile.getCanonicalFile();
 } catch (IOExc

[tomcat] 03/04: SpotBugs Refactor to remove some duplicated (and unused) code.

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

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

commit 703f85abb7fbdb67ed9c2eea09832263a9b1bf09
Author: Mark Thomas 
AuthorDate: Thu Apr 5 18:10:22 2018 +

SpotBugs
Refactor to remove some duplicated (and unused) code.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1828459 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../catalina/valves/rewrite/RewriteCond.java   | 82 +++---
 1 file changed, 26 insertions(+), 56 deletions(-)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteCond.java 
b/java/org/apache/catalina/valves/rewrite/RewriteCond.java
index 973ba8f..47a904c 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteCond.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteCond.java
@@ -28,18 +28,22 @@ public class RewriteCond {
 
 public static class PatternCondition extends Condition {
 public Pattern pattern;
-public Matcher matcher = null;
+private ThreadLocal matcher = new ThreadLocal<>();
 
 @Override
 public boolean evaluate(String value, Resolver resolver) {
 Matcher m = pattern.matcher(value);
 if (m.matches()) {
-matcher = m;
+matcher.set(m);
 return true;
 } else {
 return false;
 }
 }
+
+public Matcher getMatcher() {
+return matcher.get();
+}
 }
 
 public static class LexicalCondition extends Condition {
@@ -119,40 +123,46 @@ public class RewriteCond {
 condPattern = condPattern.substring(1);
 }
 if (condPattern.startsWith("<")) {
-LexicalCondition condition = new LexicalCondition();
-condition.type = -1;
-condition.condition = condPattern.substring(1);
+LexicalCondition ncondition = new LexicalCondition();
+ncondition.type = -1;
+ncondition.condition = condPattern.substring(1);
+this.condition = ncondition;
 } else if (condPattern.startsWith(">")) {
-LexicalCondition condition = new LexicalCondition();
-condition.type = 1;
-condition.condition = condPattern.substring(1);
+LexicalCondition ncondition = new LexicalCondition();
+ncondition.type = 1;
+ncondition.condition = condPattern.substring(1);
+this.condition = ncondition;
 } else if (condPattern.startsWith("=")) {
-LexicalCondition condition = new LexicalCondition();
-condition.type = 0;
-condition.condition = condPattern.substring(1);
+LexicalCondition ncondition = new LexicalCondition();
+ncondition.type = 0;
+ncondition.condition = condPattern.substring(1);
+this.condition = ncondition;
 } else if (condPattern.equals("-d")) {
 ResourceCondition ncondition = new ResourceCondition();
 ncondition.type = 0;
+this.condition = ncondition;
 } else if (condPattern.equals("-f")) {
 ResourceCondition ncondition = new ResourceCondition();
 ncondition.type = 1;
+this.condition = ncondition;
 } else if (condPattern.equals("-s")) {
 ResourceCondition ncondition = new ResourceCondition();
 ncondition.type = 2;
+this.condition = ncondition;
 } else {
-PatternCondition condition = new PatternCondition();
+PatternCondition ncondition = new PatternCondition();
 int flags = 0;
 if (isNocase()) {
 flags |= Pattern.CASE_INSENSITIVE;
 }
-condition.pattern = Pattern.compile(condPattern, flags);
+ncondition.pattern = Pattern.compile(condPattern, flags);
+this.condition = ncondition;
 }
 }
 
 public Matcher getMatcher() {
-Object condition = this.condition.get();
 if (condition instanceof PatternCondition) {
-return ((PatternCondition) condition).matcher;
+return ((PatternCondition) condition).getMatcher();
 }
 return null;
 }
@@ -171,7 +181,7 @@ public class RewriteCond {
 
 protected Substitution test = null;
 
-protected ThreadLocal condition = new ThreadLocal<>();
+protected Condition condition = null;
 
 /**
  * This makes the test case-insensitive, i.e., there is no difference 
between
@@ -196,46 +206,6 @@ public class RewriteCond {
  */
 public boolean evaluate(Matcher rule, Matcher cond, Resolver resolver) {
 String value = test.evaluate(rule, cond, resolver);
-Condition condition = this.condition.get();
-if (condition == null) {
-if (condPattern.startsWith("<")) {
-LexicalCond

[tomcat] 01/04: Align with master. Back-port simple clean-up.

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

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

commit 51f00c256a7e7f0dc0f7bf5258fb40616dce3757
Author: Mark Thomas 
AuthorDate: Mon Jul 29 10:44:30 2019 +0100

Align with master. Back-port simple clean-up.
---
 java/org/apache/catalina/valves/rewrite/RewriteRule.java  | 6 ++
 java/org/apache/catalina/valves/rewrite/RewriteValve.java | 5 +++--
 java/org/apache/catalina/valves/rewrite/Substitution.java | 3 ++-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteRule.java 
b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
index e6dc0fa..0bee31f 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteRule.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
@@ -17,6 +17,7 @@
 package org.apache.catalina.valves.rewrite;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -68,10 +69,7 @@ public class RewriteRule {
 }
 
 public void addCondition(RewriteCond condition) {
-RewriteCond[] conditions = new RewriteCond[this.conditions.length + 1];
-for (int i = 0; i < this.conditions.length; i++) {
-conditions[i] = this.conditions[i];
-}
+RewriteCond[] conditions = Arrays.copyOf(this.conditions, 
this.conditions.length + 1);
 conditions[this.conditions.length] = condition;
 this.conditions = conditions;
 }
diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java 
b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
index 220aa60..52996a4 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
@@ -27,6 +27,7 @@ import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
@@ -225,8 +226,8 @@ public class RewriteValve extends ValveBase {
 }
 
 protected void parse(BufferedReader reader) throws LifecycleException {
-ArrayList rules = new ArrayList<>();
-ArrayList conditions = new ArrayList<>();
+List rules = new ArrayList<>();
+List conditions = new ArrayList<>();
 while (true) {
 try {
 String line = reader.readLine();
diff --git a/java/org/apache/catalina/valves/rewrite/Substitution.java 
b/java/org/apache/catalina/valves/rewrite/Substitution.java
index 4cd2aec..58ad20e 100644
--- a/java/org/apache/catalina/valves/rewrite/Substitution.java
+++ b/java/org/apache/catalina/valves/rewrite/Substitution.java
@@ -17,6 +17,7 @@
 package org.apache.catalina.valves.rewrite;
 
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
 
@@ -129,7 +130,7 @@ public class Substitution {
 
 private SubstitutionElement[] parseSubtitution(String sub, Map maps) {
 
-ArrayList elements = new ArrayList<>();
+List elements = new ArrayList<>();
 int pos = 0;
 int percentPos = 0;
 int dollarPos = 0;


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



[tomcat] 02/04: Align with master. Back-port i18n support.

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

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

commit b5c04d5e369d37599a7f9547a2eae944e8b9240d
Author: Mark Thomas 
AuthorDate: Mon Jul 29 10:49:01 2019 +0100

Align with master. Back-port i18n support.
---
 .../valves/rewrite/LocalStrings.properties | 20 +
 .../valves/rewrite/LocalStrings_fr.properties  | 20 +
 .../valves/rewrite/LocalStrings_ja.properties  | 20 +
 .../catalina/valves/rewrite/RewriteValve.java  | 26 +++---
 4 files changed, 73 insertions(+), 13 deletions(-)

diff --git a/java/org/apache/catalina/valves/rewrite/LocalStrings.properties 
b/java/org/apache/catalina/valves/rewrite/LocalStrings.properties
new file mode 100644
index 000..63ecfb3
--- /dev/null
+++ b/java/org/apache/catalina/valves/rewrite/LocalStrings.properties
@@ -0,0 +1,20 @@
+# 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.
+
+rewriteValve.closeError=Error closing configuration
+rewriteValve.invalidFlags=Invalid flag in [{0}] flags [{1}]
+rewriteValve.invalidLine=Invalid line [{0}]
+rewriteValve.invalidMapClassName=Invalid map class name [{0}]
+rewriteValve.readError=Error reading configuration
diff --git a/java/org/apache/catalina/valves/rewrite/LocalStrings_fr.properties 
b/java/org/apache/catalina/valves/rewrite/LocalStrings_fr.properties
new file mode 100644
index 000..aac8da4
--- /dev/null
+++ b/java/org/apache/catalina/valves/rewrite/LocalStrings_fr.properties
@@ -0,0 +1,20 @@
+# 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.
+
+rewriteValve.closeError=Erreur lors de la fermeture de la configuration
+rewriteValve.invalidFlags=Indicateur invalide dans [{0}] indicateurs [{1}]
+rewriteValve.invalidLine=Ligne invalide [{0}]
+rewriteValve.invalidMapClassName=Le nom de la classe [{0}] de la structure est 
invalide
+rewriteValve.readError=Erreur lors de la lecture de la configuration
diff --git a/java/org/apache/catalina/valves/rewrite/LocalStrings_ja.properties 
b/java/org/apache/catalina/valves/rewrite/LocalStrings_ja.properties
new file mode 100644
index 000..88604f1
--- /dev/null
+++ b/java/org/apache/catalina/valves/rewrite/LocalStrings_ja.properties
@@ -0,0 +1,20 @@
+# 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.
+
+rewriteValve.closeError=構成を閉じる際のエラー
+rewriteValve.invalidFlags=[{0}]に無効なフラグ [{1}]があります。
+rewriteValve.invalidLine=無効な行[{0}]
+rewriteValve.invalidMapClassName=Mapクラス名[{0}]が無効です。
+rewriteValve.readError=構成の読み取りエラー
diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java 
b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
index 52996a4..284a585 100644
--- a/java/org/apache/catal

[tomcat] branch master updated: Align with 8.5.x. Remove unnecessary code.

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 7c4852c  Align with 8.5.x. Remove unnecessary code.
7c4852c is described below

commit 7c4852c374e78d8396184cc753537756dd272ae6
Author: Mark Thomas 
AuthorDate: Mon Jul 29 13:26:07 2019 +0100

Align with 8.5.x. Remove unnecessary code.
---
 java/org/apache/catalina/valves/rewrite/RewriteValve.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java 
b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
index 22fa732..ca64326 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
@@ -136,7 +136,6 @@ public class RewriteValve extends ValveBase {
 protected synchronized void startInternal() throws LifecycleException {
 
 super.startInternal();
-context = (getContainer() instanceof Context);
 
 InputStream is = null;
 


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



[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63608 -ve pattern

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 0449873  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63608 -ve 
pattern
0449873 is described below

commit 044987365a41167083d2c9d3b73a43ebfa2567b9
Author: Mark Thomas 
AuthorDate: Mon Jul 29 15:38:05 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63608 -ve pattern

Align the implementation of the negative match feature for patterns used
with the RewriteValve with the description in the documentation.
---
 .../catalina/valves/rewrite/RewriteRule.java   |  8 +++-
 .../catalina/valves/rewrite/TestRewriteValve.java  | 24 ++
 webapps/docs/changelog.xml |  5 +
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteRule.java 
b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
index 0bee31f..450877d 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteRule.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
@@ -32,6 +32,7 @@ public class RewriteRule {
 protected String patternString = null;
 protected String substitutionString = null;
 protected String flagsString = null;
+protected boolean positive = true;
 
 public void parse(Map maps) {
 // Parse the substitution
@@ -42,6 +43,10 @@ public class RewriteRule {
 substitution.setEscapeBackReferences(isEscapeBackReferences());
 }
 // Parse the pattern
+if (patternString.startsWith("!")) {
+positive = false;
+patternString = patternString.substring(1);
+}
 int flags = 0;
 if (isNocase()) {
 flags |= Pattern.CASE_INSENSITIVE;
@@ -92,7 +97,8 @@ public class RewriteRule {
 this.pattern.set(pattern);
 }
 Matcher matcher = pattern.matcher(url);
-if (!matcher.matches()) {
+// Use XOR
+if (positive ^ matcher.matches()) {
 // Evaluation done
 return null;
 }
diff --git a/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java 
b/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
index 464f3b3..8e2e3f2 100644
--- a/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
+++ b/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
@@ -582,6 +582,30 @@ public class TestRewriteValve extends TomcatBaseTest {
 }
 
 
+@Test
+public void testNegativePattern01() throws Exception {
+doTestRewrite("RewriteRule !^/b/.* /c/", "/b", "/c/");
+}
+
+
+@Test
+public void testNegativePattern02() throws Exception {
+doTestRewrite("RewriteRule !^/b/.* /c/", "/d/e/f", "/c/");
+}
+
+
+@Test
+public void testNegativePattern03() throws Exception {
+doTestRewrite("RewriteRule !^/c/.* /b/", "/c/", "/c/");
+}
+
+
+@Test
+public void testNegativePattern04() throws Exception {
+doTestRewrite("RewriteRule !^/c/.* /b/", "/c/d", "/c/d");
+}
+
+
 private void doTestRewrite(String config, String request, String 
expectedURI) throws Exception {
 doTestRewrite(config, request, expectedURI, null);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f96bdfe..b70fc1c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -69,6 +69,11 @@
 reject them with a 400 response rather than triggering an internal 
error
 that results in a 500 response. (markt)
   
+  
+63608: Align the implementation of the negative match 
feature
+for patterns used with the RewriteValve with the
+description in the documentation. (markt)
+  
  
   
   


-
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: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63608 -ve pattern

2019-07-29 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 802d30b  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63608 -ve 
pattern
802d30b is described below

commit 802d30b9c66fc759f819d78d023341f35012df16
Author: Mark Thomas 
AuthorDate: Mon Jul 29 15:38:05 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63608 -ve pattern

Align the implementation of the negative match feature for patterns used
with the RewriteValve with the description in the documentation.
---
 .../catalina/valves/rewrite/RewriteRule.java   |  8 +++-
 .../catalina/valves/rewrite/TestRewriteValve.java  | 24 ++
 webapps/docs/changelog.xml |  5 +
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteRule.java 
b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
index 0bee31f..450877d 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteRule.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
@@ -32,6 +32,7 @@ public class RewriteRule {
 protected String patternString = null;
 protected String substitutionString = null;
 protected String flagsString = null;
+protected boolean positive = true;
 
 public void parse(Map maps) {
 // Parse the substitution
@@ -42,6 +43,10 @@ public class RewriteRule {
 substitution.setEscapeBackReferences(isEscapeBackReferences());
 }
 // Parse the pattern
+if (patternString.startsWith("!")) {
+positive = false;
+patternString = patternString.substring(1);
+}
 int flags = 0;
 if (isNocase()) {
 flags |= Pattern.CASE_INSENSITIVE;
@@ -92,7 +97,8 @@ public class RewriteRule {
 this.pattern.set(pattern);
 }
 Matcher matcher = pattern.matcher(url);
-if (!matcher.matches()) {
+// Use XOR
+if (positive ^ matcher.matches()) {
 // Evaluation done
 return null;
 }
diff --git a/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java 
b/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
index 464f3b3..8e2e3f2 100644
--- a/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
+++ b/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
@@ -582,6 +582,30 @@ public class TestRewriteValve extends TomcatBaseTest {
 }
 
 
+@Test
+public void testNegativePattern01() throws Exception {
+doTestRewrite("RewriteRule !^/b/.* /c/", "/b", "/c/");
+}
+
+
+@Test
+public void testNegativePattern02() throws Exception {
+doTestRewrite("RewriteRule !^/b/.* /c/", "/d/e/f", "/c/");
+}
+
+
+@Test
+public void testNegativePattern03() throws Exception {
+doTestRewrite("RewriteRule !^/c/.* /b/", "/c/", "/c/");
+}
+
+
+@Test
+public void testNegativePattern04() throws Exception {
+doTestRewrite("RewriteRule !^/c/.* /b/", "/c/d", "/c/d");
+}
+
+
 private void doTestRewrite(String config, String request, String 
expectedURI) throws Exception {
 doTestRewrite(config, request, expectedURI, null);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f93082f..dbca095 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -72,6 +72,11 @@
   
 Correct version information in X-Powered-By header. 
(markt)
   
+  
+63608: Align the implementation of the negative match 
feature
+for patterns used with the RewriteValve with the
+description in the documentation. (markt)
+  
  
   
   


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



[Bug 63608] Negative pattern match in rewrite rule is not as documented

2019-07-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63608

Mark Thomas  changed:

   What|Removed |Added

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

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

Fixed in:
- master for 9.0.23 onwards
- 8.5.x for 8.5.44 onwards

The RewriteValve is not present in 7.0.x

-- 
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: [RESULT][VOTE] Release Apache Tomcat 7.0.96

2019-07-29 Thread Violeta Georgieva
Hi,

На ср, 24.07.2019 г. в 16:56 ч. Violeta Georgieva 
написа:
>
> The proposed Apache Tomcat 7.0.96 release is now available for voting.
>
> For full details, see the changelog:
> https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.96/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1224/
> The git tag is:
> https://github.com/apache/tomcat/tree/7.0.96
> 5277b175db2e575022672856797240976ad23bcf
>
> The proposed 7.0.96 release is:
> [ ] Broken - do not release
> [ ] Stable - go ahead and release as 7.0.96 Stable


+1 (binding):markt, violetagg, fschumacher

No other voters were cast.

The vote has passed.

I'll do the release shortly and announce it once the mirrors catch up.

Regards,
Violeta


Nexus: Promotion Completed

2019-07-29 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.8.0_221; Windows 7 6.1)""userId" = "violetagg""ip" = "84.242.148.23"Details:The following artifacts have been promoted to the "Releases" [id=releases] repository/org/apache/tomcat/tomcat-juli/7.0.96/tomcat-juli-7.0.96-sources.jar.asc(SHA1: f428a7a414bab1229984468466b87ef015bc4005)/org/apache/tomcat/tomcat-juli/7.0.96/tomcat-juli-7.0.96.pom.asc(SHA1: 852e99567a387ae35f5e47271da32360fcb91252)/org/apache/tomcat/tomcat-juli/7.0.96/tomcat-juli-7.0.96.jar.asc(SHA1: 20cabbcabc8f07f059cc022b9dda95311fc5fa16)/org/apache/tomcat/tomcat-juli/7.0.96/tomcat-juli-7.0.96.jar(SHA1: 03994d33644aaa6444a19e42730d3f57488f442d)/org/apache/tomcat/tomcat-juli/7.0.96/tomcat-juli-7.0.96-sources.jar(SHA1: 7032537bddb34cc678f42a3ffb129c72f66be3b4)/org/apache/tomcat/tomcat-juli/7.0.96/tomcat-juli-7.0.96.pom(SHA1: 7552ea761dbdf21852364a61d27a4b6b3f38e6f5)/org/apache/tomcat/tomcat-util/7.0.96/tomcat-util-7.0.96.pom(SHA1: a20a160273466b1fd1914e5105f1313a507cf6bb)/org/apache/tomcat/tomcat-util/7.0.96/tomcat-util-7.0.96.jar.asc(SHA1: a2f4d0d30451c88012eeb5a53597cd328f2d)/org/apache/tomcat/tomcat-util/7.0.96/tomcat-util-7.0.96.pom.asc(SHA1: 5a44bf42d8b028d8bf8950846efe3d358ad2cdf8)/org/apache/tomcat/tomcat-util/7.0.96/tomcat-util-7.0.96-sources.jar(SHA1: beb4eda8f0e80b82c5511c9671ceb2a7cb4fbdc3)/org/apache/tomcat/tomcat-util/7.0.96/tomcat-util-7.0.96.jar(SHA1: 8e55beca056a9b0ab1ffecb0808f6b86885d92c1)/org/apache/tomcat/tomcat-util/7.0.96/tomcat-util-7.0.96-sources.jar.asc(SHA1: 933d9507c4109156e01884c06dfed8c078f93798)/org/apache/tomcat/tomcat-catalina/7.0.96/tomcat-catalina-7.0.96.pom(SHA1: cbe0df797c0587ba52d80652d302548fa445adbe)/org/apache/tomcat/tomcat-catalina/7.0.96/tomcat-catalina-7.0.96-sources.jar.asc(SHA1: 693b43d85a088c11a6e03b02c3cbe147a030d186)/org/apache/tomcat/tomcat-catalina/7.0.96/tomcat-catalina-7.0.96.pom.asc(SHA1: a62f6a1273661e55a9a0ca268af0f19124210057)/org/apache/tomcat/tomcat-catalina/7.0.96/tomcat-catalina-7.0.96.jar.asc(SHA1: 9230a6e9a40a4cd43a8123a68ecad85b8a118fc2)/org/apache/tomcat/tomcat-catalina/7.0.96/tomcat-catalina-7.0.96.jar(SHA1: 23cb3f0ba42ee86eef07129bc50e64cfb3eda413)/org/apache/tomcat/tomcat-catalina/7.0.96/tomcat-catalina-7.0.96-sources.jar(SHA1: 6c062abbc5f02cb7379d3c5e94ad6c838382adb3)/org/apache/tomcat/tomcat-catalina-ws/7.0.96/tomcat-catalina-ws-7.0.96-sources.jar(SHA1: d169fa2b5c655b67f36a682d595448b803a08499)/org/apache/tomcat/tomcat-catalina-ws/7.0.96/tomcat-catalina-ws-7.0.96-sources.jar.asc(SHA1: 7d6a679b74b6fc1ee396c4236d7154a07adbfb41)/org/apache/tomcat/tomcat-catalina-ws/7.0.96/tomcat-catalina-ws-7.0.96.jar.asc(SHA1: c4ef5189bb01c9a8fa35fc20570eb942370f)/org/apache/tomcat/tomcat-catalina-ws/7.0.96/tomcat-catalina-ws-7.0.96.pom.asc(SHA1: 712d832360f860200bec2699df97672804f5bb62)/org/apache/tomcat/tomcat-catalina-ws/7.0.96/tomcat-catalina-ws-7.0.96.jar(SHA1: f89bd5fbf1f339a635c3528e3a6d0baa40e345d8)/org/apache/tomcat/tomcat-catalina-ws/7.0.96/tomcat-catalina-ws-7.0.96.pom(SHA1: 0a2cf9b0d50edca8d113579c501a431366c1b8d6)/org/apache/tomcat/tomcat-i18n-fr/7.0.96/tomcat-i18n-fr-7.0.96.pom.asc(SHA1: a5c2be7ef9d4bbe532d94d1fe3253161ec0a5e3f)/org/apache/tomcat/tomcat-i18n-fr/7.0.96/tomcat-i18n-fr-7.0.96.jar.asc(SHA1: ae8aacc75d72df13e39c4f78c998cf1dcc2f7a03)/org/apache/tomcat/tomcat-i18n-fr/7.0.96/tomcat-i18n-fr-7.0.96.pom(SHA1: 1f023c3dbf3ca973f79dfe6a925241cdcbbea8c4)/org/apache/tomcat/tomcat-i18n-fr/7.0.96/tomcat-i18n-fr-7.0.96.jar(SHA1: 99d2432829ec877b38318d621129a8387d010406)/org/apache/tomcat/tomcat-jdbc/7.0.96/tomcat-jdbc-7.0.96.jar(SHA1: 1e73aae6faffafbbbfc0da84b63d46aa3bafb0af)/org/apache/tomcat/tomcat-jdbc/7.0.96/tomcat-jdbc-7.0.96-sources.jar.asc(SHA1: 6cdea1e52880a04c7ffb138cee254fb9e90d029e)/org/apache/tomcat/tomcat-jdbc/7.0.96/tomcat-jdbc-7.0.96-sources.jar(SHA1: d3f40c12f3c40a195b005df2af6ddee91d0dfedb)/org/apache/tomcat/tomcat-jdbc/7.0.96/tomcat-jdbc-7.0.96.pom(SHA1: c51ce199d943ecf8de97976f9b75992d2e019347)/org/apache/tomcat/tomcat-jdbc/7.0.96/tomcat-jdbc-7.0.96.pom.asc(SHA1: 25d8e5111c4d476274d57ed0e3a66b399f9ffc7d)/org/apache/tomcat/tomcat-jdbc/7.0.96/tomcat-jdbc-7.0.96.jar.asc(SHA1: c3af87acef96039226ba0183341113ec79438881)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.96/tomcat-embed-logging-log4j-7.0.96.jar.asc(SHA1: 37ae0ff4eb9728c7cfd94db4473e96b9243b51b0)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.96/tomcat-embed-logging-log4j-7.0.96.pom.asc(SHA1: df268672cf31fff50b8bb3fdf00a25246a1f750a)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.96/tomcat-embed-logging-log4j-7.0.96-sources.jar.asc(SHA1: 11c845985203ca550eb9774c5cbd9d496d296589)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.96/tomcat-embed-logging-log4j-7.0.96-sources.jar(SHA1: 57dc0fadfee43d3feec49bcfdf653b030a172e91)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.96/tomcat-embed-logging-log4j-7.0.96.pom(SHA1: 560f2c208c439d73bf1ce70ca2573dab71b29e10)/org/ap

[tomcat] branch master updated: Refactor to aid re-use

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

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


The following commit(s) were added to refs/heads/master by this push:
 new d0cfd66  Refactor to aid re-use
d0cfd66 is described below

commit d0cfd667d3cf5943b91dec6e4eb7c445030d9c88
Author: Mark Thomas 
AuthorDate: Mon Jul 29 18:08:09 2019 +0100

Refactor to aid re-use
---
 .../apache/tomcat/websocket/WebSocketBaseTest.java | 21 +++
 .../apache/tomcat/websocket/server/TestClose.java  | 44 ++
 ...esterWsCloseClient.java => TesterWsClient.java} | 12 --
 3 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/WebSocketBaseTest.java 
b/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
index 56c27ef..3d55c9d 100644
--- a/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
+++ b/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
@@ -19,10 +19,31 @@ package org.apache.tomcat.websocket;
 import org.junit.After;
 import org.junit.Assert;
 
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.servlets.DefaultServlet;
+import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.websocket.server.WsContextListener;
 
 public abstract class WebSocketBaseTest extends TomcatBaseTest {
 
+protected Tomcat startServer(
+final Class configClass)
+throws LifecycleException {
+
+Tomcat tomcat = getTomcatInstance();
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+ctx.addApplicationListener(configClass.getName());
+Tomcat.addServlet(ctx, "default", new DefaultServlet());
+ctx.addServletMappingDecoded("/", "default");
+
+tomcat.start();
+return tomcat;
+}
+
+
 @After
 public void checkBackgroundProcessHasStopped() throws Exception {
 // Need to stop Tomcat to ensure background processed have been 
stopped.
diff --git a/test/org/apache/tomcat/websocket/server/TestClose.java 
b/test/org/apache/tomcat/websocket/server/TestClose.java
index cc6360a..30c18bb 100644
--- a/test/org/apache/tomcat/websocket/server/TestClose.java
+++ b/test/org/apache/tomcat/websocket/server/TestClose.java
@@ -37,10 +37,6 @@ import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
-import org.apache.catalina.Context;
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.servlets.DefaultServlet;
-import org.apache.catalina.startup.Tomcat;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.websocket.WebSocketBaseTest;
@@ -127,7 +123,7 @@ public class TestClose extends WebSocketBaseTest {
 
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.closeSocket();
 
@@ -139,7 +135,7 @@ public class TestClose extends WebSocketBaseTest {
 public void testTcpReset() throws Exception {
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.forceCloseSocket();
 
@@ -153,7 +149,7 @@ public class TestClose extends WebSocketBaseTest {
 public void testWsCloseThenTcpClose() throws Exception {
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.sendCloseFrame(CloseCodes.GOING_AWAY);
 client.closeSocket();
@@ -166,7 +162,7 @@ public class TestClose extends WebSocketBaseTest {
 public void testWsCloseThenTcpReset() throws Exception {
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.sendCloseFrame(CloseCodes.GOING_AWAY);
 client.forceCloseSocket();
@@ -190,9 +186,9 @@ public class TestClose extends WebSocketBaseTest {
 
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
-client.sendMessage("Test")

[tomcat] branch 8.5.x updated: Refactor to aid re-use

2019-07-29 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 276450e  Refactor to aid re-use
276450e is described below

commit 276450ecfee85b157222ff48aecdaf58348dfacc
Author: Mark Thomas 
AuthorDate: Mon Jul 29 18:08:09 2019 +0100

Refactor to aid re-use
---
 .../apache/tomcat/websocket/WebSocketBaseTest.java | 21 +++
 .../apache/tomcat/websocket/server/TestClose.java  | 44 ++
 ...esterWsCloseClient.java => TesterWsClient.java} | 12 --
 3 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/WebSocketBaseTest.java 
b/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
index 56c27ef..3d55c9d 100644
--- a/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
+++ b/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
@@ -19,10 +19,31 @@ package org.apache.tomcat.websocket;
 import org.junit.After;
 import org.junit.Assert;
 
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.servlets.DefaultServlet;
+import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.websocket.server.WsContextListener;
 
 public abstract class WebSocketBaseTest extends TomcatBaseTest {
 
+protected Tomcat startServer(
+final Class configClass)
+throws LifecycleException {
+
+Tomcat tomcat = getTomcatInstance();
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+ctx.addApplicationListener(configClass.getName());
+Tomcat.addServlet(ctx, "default", new DefaultServlet());
+ctx.addServletMappingDecoded("/", "default");
+
+tomcat.start();
+return tomcat;
+}
+
+
 @After
 public void checkBackgroundProcessHasStopped() throws Exception {
 // Need to stop Tomcat to ensure background processed have been 
stopped.
diff --git a/test/org/apache/tomcat/websocket/server/TestClose.java 
b/test/org/apache/tomcat/websocket/server/TestClose.java
index cc6360a..30c18bb 100644
--- a/test/org/apache/tomcat/websocket/server/TestClose.java
+++ b/test/org/apache/tomcat/websocket/server/TestClose.java
@@ -37,10 +37,6 @@ import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
-import org.apache.catalina.Context;
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.servlets.DefaultServlet;
-import org.apache.catalina.startup.Tomcat;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.websocket.WebSocketBaseTest;
@@ -127,7 +123,7 @@ public class TestClose extends WebSocketBaseTest {
 
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.closeSocket();
 
@@ -139,7 +135,7 @@ public class TestClose extends WebSocketBaseTest {
 public void testTcpReset() throws Exception {
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.forceCloseSocket();
 
@@ -153,7 +149,7 @@ public class TestClose extends WebSocketBaseTest {
 public void testWsCloseThenTcpClose() throws Exception {
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.sendCloseFrame(CloseCodes.GOING_AWAY);
 client.closeSocket();
@@ -166,7 +162,7 @@ public class TestClose extends WebSocketBaseTest {
 public void testWsCloseThenTcpReset() throws Exception {
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
 client.sendCloseFrame(CloseCodes.GOING_AWAY);
 client.forceCloseSocket();
@@ -190,9 +186,9 @@ public class TestClose extends WebSocketBaseTest {
 
 startServer(TestEndpointConfig.class);
 
-TesterWsCloseClient client = new TesterWsCloseClient("localhost", 
getPort());
+TesterWsClient client = new TesterWsClient("localhost", getPort());
 client.httpUpgrade(BaseEndpointConfig.PATH);
-client.sendMessage("Test");

[tomcat] branch 7.0.x updated: Add release date for 7.0.96

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 2fb5a89  Add release date for 7.0.96
2fb5a89 is described below

commit 2fb5a897f280a2f11e99f4487e494fd6bb0f180a
Author: Violeta Georgieva 
AuthorDate: Mon Jul 29 20:11:00 2019 +0300

Add release date for 7.0.96
---
 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 d2cd6c9..ebe9f2a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,7 +105,7 @@
 
   
 
-
+
   
 
   


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



[Bug 63602] The temporary upload location is not valid

2019-07-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63602

--- Comment #3 from Christopher Schultz  ---
We have had previous requests to "create the temporary upload directory if it
does not exist" because we had decided it was a minor security issue. This is
at least a semi-legitimate case where it might make sense to auto-create the
directory if it does not exist.

I'm not saying that I support it; Spring Boot *should* use a different
location. Just another data point.

-- 
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



svn commit: r35059 - /dev/tomcat/tomcat-7/v7.0.96/ /release/tomcat/tomcat-7/v7.0.96/

2019-07-29 Thread violetagg
Author: violetagg
Date: Mon Jul 29 17:44:55 2019
New Revision: 35059

Log:
Release Tomcat 7.0.96

Added:
release/tomcat/tomcat-7/v7.0.96/
  - copied from r35058, dev/tomcat/tomcat-7/v7.0.96/
Removed:
dev/tomcat/tomcat-7/v7.0.96/


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



[Bug 63612] PooledConnection#connectUsingDriver, Thread.currentThread().getContextClassLoader() may be null

2019-07-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63612

Christopher Schultz  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #3 from Christopher Schultz  ---
(In reply to clemensdev from comment #2)
> th.set getContextClassLoader( null ) ; 
> th.run() ;

Um... why would you do such a thing?

-- 
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 63612] PooledConnection#connectUsingDriver, Thread.currentThread().getContextClassLoader() may be null

2019-07-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63612

--- Comment #4 from romain.manni-bucau  ---
Some libs do but pool and pool tries first tomcatjdbc classloader so if the
driver is in the webapp it fails. Init should cache the value per webapp imho.

-- 
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 63602] The temporary upload location is not valid

2019-07-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63602

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from Mark Thomas  ---
The security argument for automatically creating the upload dir wasn't
sufficiently strong to require a CVE.

It was argued that failure to ensure the directory existed was a configuration
error - hence why createUploadTargets defaults to false and a WARN level log
message is written if Tomcat does create that location.

Looking at the code, Tomcat checks and recreates the upload directory per
request. If Tomcat is appropriately configured, the OP will get the behaviour
they require. Note: 8.5.39 or later is required.

Configuration assistance, if required, is available on the users mailing list.

Closing this as INVALID since it is a configuration issue, not a bug.

-- 
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



tcnative and JDK13/14

2019-07-29 Thread Rainer Jung

OpenJDK 13/14 introduced change fb5b3981eac:

8222720: Provide extended VMWare/vSphere virtualization related info in 
the hs_error file on linux/windows x86_64


On SLES 12 (maybe also other Linuxes) the impl loads 
/usr/lib64/libguestlib.so.0 already during JVM startup. That library 
depends on /usr/lib64/libvmtools.so.0, which in turn depends on a lot of 
other libraries:


  NEEDED   libdnet.so.1
  NEEDED   libglib-2.0.so.0
  NEEDED   libicui18n.so.52.1
  NEEDED   libicuuc.so.52.1
  NEEDED   libpthread.so.0
  NEEDED   libdl.so.2
  NEEDED   libssl.so.1.0.0
  NEEDED   libcrypto.so.1.0.0
  NEEDED   libc.so.6
  NEEDED   ld-linux-x86-64.so.2
  NEEDED   libgcc_s.so.1

When building tcnative against OpenSSL 1.0.x, the JVM has already loaded 
OpenSSL 1.0 system libs via the above dependency and will not load our 
tcnative dependency. This lead to a subtle failure in my case:


/usr/local/jdk13/bin/java: symbol lookup error: 
/path/to/lib/libtcnative-1.so.0.2.23: undefined symbol: 
SSL_COMP_free_compression_methods


Even worse could be using OpenSSL 1.1.x for tcnative. Then the JVM would 
load the 1.0.x version, tcnative would load the 1.1.x version but 
symbols that exist in both would be resolved by the runtime linker in 
the older version, because it was loaded first (default symbol search 
order). All of that can be worked around by non-default linking tricks, 
but I wanted to point out this new behavior.


I have written to hotspot-runtime-...@openjdk.java.net about these new 
dependencies and potential problems.


Regards,

Rainer

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