Git repo for Tomcat Site

2019-07-08 Thread Igal Sapir

Can we move the Tomcat site to Git?  Possibly to a repo named "tomcat-site"?

I'd be happy to make the required changes per prior emails so that we 
can publish the new design in time for ACNA.


Thoughts?

Igal


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



Broken Download Links for Tomcat Native Binaries

2019-07-08 Thread Igal Sapir
The download page for the Tomcat Native Binaries [1] has broken links.  
Pretty much all of the links under "Binaries for Microsoft Windows", 
e.g. the one labeled "Native 1.2.23 Windows Binaries zip" [2] returns a 404.


Were the binaries created at all?  Perhaps at a different location?

Igal

[1] http://tomcat.apache.org/download-native.cgi

[2] 
https://www-us.apache.org/dist/tomcat/tomcat-connectors/native/1.2.23/binaries/tomcat-native-1.2.23-openssl-1.0.2q-win32-bin.zip




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



Re: [VOTE] Release Apache Tomcat 8.5.43

2019-07-08 Thread Igal Sapir

On 7/4/2019 2:19 PM, Mark Thomas wrote:

The proposed Apache Tomcat 8.5.43 release is now available for voting.

The proposed 8.5.43 release is:
[ ] Broken - do not release
[X] Stable - go ahead and release as 8.5.43


Unit tests passed on Windows 10 and Ubuntu 18.04 with Java 8

Igal


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



Re: [VOTE] Release Apache Tomcat 9.0.22

2019-07-08 Thread Igal Sapir

On 7/4/2019 12:33 PM, Mark Thomas wrote:

The proposed Apache Tomcat 9.0.22 release is now available for voting.

The proposed 9.0.22 release is:
[ ] Broken - do not release
[X] Stable - go ahead and release as 9.0.22


Unit tests passed on Windows 10 and Ubuntu 18.04 with Java 8

Igal



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



[Bug 62072] Add support for request compression

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

--- Comment #2 from Christopher Schultz  ---
When the request entity is compressed, the encoding should be specified in the
Content-Encoding header, not the Transfer-Encoding header.

Transfer-Encoding could also certainly be supported if Content-Encoding is also
supported.

This seems like the kind of thing that SHOULD be supported if possible. Using
e.g. gzip to upload data does give a good performance boost. Chips are fast
these days -- much faster than data pipes.

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
[2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding

-- 
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 55969] Security-related enhancements to the Windows Installer

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

--- Comment #4 from Konstantin Preißer  ---
Hi Mark,

thanks a lot for your work on this! (It seems I'm getting old, as I didn't even
remember having opened this issue when I got the emails today...)

-- 
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 63555] New: embedded jar manifests missing automatic module names

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

Bug ID: 63555
   Summary: embedded jar manifests missing automatic module names
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P2
 Component: Packaging
  Assignee: dev@tomcat.apache.org
  Reporter: rob.pl...@dai.co.uk
  Target Milestone: -

I'm happy to report that Tomcat 9 has been working reliably embedded in a
project using the Java 9+ module system over the past year. However, the
embedded jars do not provide the Automatic-Module-Name entry in their
MANIFEST.MF files. The result is that maven generates warnings -- and valid
warnings -- that the module names are unstable. For example:

***
* Required filename-based automodules detected: [tomcat-embed-el-9.0.21.jar].
Please don't publish this project to a public artifact repository! *
***

This limits downstream open sources projects from using tomcat, which should
heed this warning, and may create incompatibilities in future if the jar file
names change.

The affected maven modules are those in the org.apache.tomcat.embed group which
may be referenced from an embedded application, as well as some related jars
such as tomcat-jdbc which can be used embedded:

tomcat-embed-websocket
tomcat-embed-el
tomcat-embed-jasper
tomcat-embed-core
tomcat-jdbc

An obvious solution would be to put Automatic-Module-Names in each of these
jars at build time, to match maven's fallback filename-based automodule names.
That is to say, replace the hyphens with periods:

Automatic-Module-Name: tomcat.embed.websocket

With this approach, the Maven warning is resolved, and the existing
filename-based automatic module names become stable.

But there is a question of whether the embedded packaging should really include
the word "embed", when some of these jars are a repackaging of the code from
the tomcat webapp server packages. Alternative module names might make more
sense, and provide better compatibility with the non-embedded version of tomcat
if Tomcat is ever made fully modular. Example: tomcat-embed-websocket would
perhaps be better as "tomcat.websocket", and tomcat-embed-el would be
"apache.el" or "org.apache.el" as internally it doesn't reference tomcat... And
so on.

If taking this approach, which I can entirely appreciate, then I think
implementing it sooner rather than later would be wise. The long filename-based
automatic modules are relied upon, the more projects may come to rely
incorrectly upon the unstable filename-based naming, and break in future.

An example of a similar issue as resolved in other popular open source
projects: https://github.com/FasterXML/jackson-core/issues/397

-- 
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 62072] Add support for request compression

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

--- Comment #1 from Eugène Adell  ---

Compression can be used with both Content-Encoding or Transfer-Encoding, in
practice we see Transfer-Encoding much more than the other as the compression
is delegated to the web server, not to the filesystem itself or DB storage
(from my understanding Content-Encoding means the ressource is itself in
compressed state).

Compression is not always a good idea : it was removed from TLS (1.3) after
BREACH/CRIME since it can compromise client-side, and even when SSL is not used
it can lead to serious problems compromising server-side (such as
https://en.wikipedia.org/wiki/Zip_bomb )

However, I've seen big performance improvements on servers sending compressed
data when the homepage is heavy in text/javascript (10 mB)

-- 
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 55969] Security-related enhancements to the Windows Installer

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

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #3 from Mark Thomas  ---
Fixed in:
- master for 9.0.23 onwards
- 8.5.x for 8.5.44 onwards
- 7.0.x for 7.0.95 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



[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969

2019-07-08 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 f7c73a2  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969
f7c73a2 is described below

commit f7c73a244f84681432e41b424c7d0f8e7c15f6f2
Author: Mark Thomas 
AuthorDate: Mon Jul 8 15:41:59 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969

Tighten security for the Windows installer.
Update to Daemon 1.2.0. This changes the default user from "Local
System" to "Local Service".
Disable the shutdown port by default (service doesn't use it).
Limit file permissions to local admins, "Local Service" and "Local
System".
---
 build.properties.default   | 14 +++---
 res/tomcat.nsi | 18 +-
 webapps/docs/changelog.xml | 13 +
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 0df0638..4a30427 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -202,21 +202,21 @@ 
nsis.system.dll=${nsis.home}/Plugins/${nsis.arch.dir}System.dll
 nsis.nsdialogs.dll=${nsis.home}/Plugins/${nsis.arch.dir}nsDialogs.dll
 nsis.loc=${base-sf.loc}/nsis/nsis-${nsis.version}.zip
 
-# - Commons Daemon, version 1.1.0 or later -
-commons-daemon.version=1.1.0
+# - Commons Daemon, version 1.2.0 or later -
+commons-daemon.version=1.2.0
 
-# checksum for commons-daemon-1.1.0-bin.tar.gz
+# checksum for commons-daemon-1.2.0-bin.tar.gz
 commons-daemon.bin.checksum.enabled=true
 commons-daemon.bin.checksum.algorithm=SHA-512
-commons-daemon.bin.checksum.value=43c33e52e0be11e73370083500592ee9df0431c3166dbc7ed95794cabb462ac2a140e3eb4bbe2a0b99882bb93d9244ff534f13e4933c13e7a31a37e58e0c8e1d
+commons-daemon.bin.checksum.value=81fbbd1115d735232bbcc426d958bd8fe149c97bfe96df1549a19332afd4954f3f75c3a693f214bfef065931a1d79c528dfb2cefb1bb3628d211e1761814c23b
 
-# checksums for commons-daemon-1.1.0-native-src.tar.gz, 
commons-daemon-1.1.0-bin-windows.zip
+# checksums for commons-daemon-1.1.0-native-src.tar.gz, 
commons-daemon-1.2.0-bin-windows.zip
 commons-daemon.native.src.checksum.enabled=true
 commons-daemon.native.src.checksum.algorithm=SHA-512
-commons-daemon.native.src.checksum.value=3443f1c95a4b267c4387a9ac7c79315422a51e896c0bcea48fbe959bc301094770aa8065b2388a84760a3e07e5d1753c2b351336fb2d3a8c996ee14d32088f6e
+commons-daemon.native.src.checksum.value=c37f506b129b8a0efface6745dcc6d0d9d3e2663d28eca0df9903301f0b9b65fd8306e361935887fb459daf0a29da6fa63ea60f742ce4e497dc53a2a2d86db12
 commons-daemon.native.win.checksum.enabled=true
 commons-daemon.native.win.checksum.algorithm=SHA-512
-commons-daemon.native.win.checksum.value=10cda04d9a44286cb67107fdb9d20958013f075cad4accba048801f3677765c334dc16f6901e1d2e4a9df5a2c702797370de63393568df6fceb9e7902421f9ea
+commons-daemon.native.win.checksum.value=8b6e0bb4172861338e0cb3238f6da715c3cef04a88e8bfab0cbb487ef638aa69fd34de9407b0b2ed54451fbbcbff8a999324289052a581a5d07d6f6ff84a83b6
 
 commons-daemon.home=${base.path}/commons-daemon-${commons-daemon.version}
 
commons-daemon.jar=${commons-daemon.home}/commons-daemon-${commons-daemon.version}.jar
diff --git a/res/tomcat.nsi b/res/tomcat.nsi
index fb15582..511c734 100644
--- a/res/tomcat.nsi
+++ b/res/tomcat.nsi
@@ -363,6 +363,22 @@ Section -post
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache 
Tomcat @VERSION_MAJOR_MINOR@ $TomcatServiceName" \
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\" 
-ServiceName=$\"$TomcatServiceName$\""
 
+  ; Configure file permissions
+  ; S-1-5-19 LocalService
+  ; S-1-5-32-544 Local Administrators group
+  ; S-1-5-18 Local System
+  nsExec::ExecToStack 'icacls "$INSTDIR" /inheritance:r /grant 
*S-1-5-19:(OI)(CI)(F) /grant *S-1-5-32-544:(OI)(CI)(F) /grant 
*S-1-5-18:(OI)(CI)(F)'
+  Pop $0
+  Pop $1
+  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)?" \
+  /SD IDNO IDYES SetPermissionsOk
+  Quit
+  SetPermissionsOk:
+  ClearErrors
+
 SectionEnd
 
 !define ReadFromConfigIni "!insertmacro ReadFromConfigIni"
@@ -411,7 +427,7 @@ Function .onInit
 
   ;Initialize default values
   StrCpy $JavaHome ""
-  StrCpy $TomcatPortShutdown "8005"
+  StrCpy $TomcatPortShutdown "-1"
   StrCpy $TomcatPortHttp "8080"
   StrCpy $TomcatPortAjp "8009"
   StrCpy $TomcatMenuEntriesEnable "0"
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7792e1a..b2d9092 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -240,6 +240,19 @@
   
 Update Checkstyle to version 8.22. (

[tomcat] branch 8.5.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969

2019-07-08 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 051f354  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969
051f354 is described below

commit 051f354871223dd5b0f72cf778852feb8fd45318
Author: Mark Thomas 
AuthorDate: Mon Jul 8 15:41:59 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969

Tighten security for the Windows installer.
Update to Daemon 1.2.0. This changes the default user from "Local
System" to "Local Service".
Disable the shutdown port by default (service doesn't use it).
Limit file permissions to local admins, "Local Service" and "Local
System".
---
 build.properties.default   | 14 +++---
 res/tomcat.nsi | 18 +-
 webapps/docs/changelog.xml | 13 +
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 0c5113a..78f9231 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -175,21 +175,21 @@ 
nsis.system.dll=${nsis.home}/Plugins/${nsis.arch.dir}System.dll
 nsis.nsdialogs.dll=${nsis.home}/Plugins/${nsis.arch.dir}nsDialogs.dll
 nsis.loc=${base-sf.loc}/nsis/nsis-${nsis.version}.zip
 
-# - Commons Daemon, version 1.1.0 or later -
-commons-daemon.version=1.1.0
+# - Commons Daemon, version 1.2.0 or later -
+commons-daemon.version=1.2.0
 
-# checksum for commons-daemon-1.1.0-bin.tar.gz
+# checksum for commons-daemon-1.2.0-bin.tar.gz
 commons-daemon.bin.checksum.enabled=true
 commons-daemon.bin.checksum.algorithm=SHA-512
-commons-daemon.bin.checksum.value=43c33e52e0be11e73370083500592ee9df0431c3166dbc7ed95794cabb462ac2a140e3eb4bbe2a0b99882bb93d9244ff534f13e4933c13e7a31a37e58e0c8e1d
+commons-daemon.bin.checksum.value=81fbbd1115d735232bbcc426d958bd8fe149c97bfe96df1549a19332afd4954f3f75c3a693f214bfef065931a1d79c528dfb2cefb1bb3628d211e1761814c23b
 
-# checksums for commons-daemon-1.1.0-native-src.tar.gz, 
commons-daemon-1.1.0-bin-windows.zip
+# checksums for commons-daemon-1.1.0-native-src.tar.gz, 
commons-daemon-1.2.0-bin-windows.zip
 commons-daemon.native.src.checksum.enabled=true
 commons-daemon.native.src.checksum.algorithm=SHA-512
-commons-daemon.native.src.checksum.value=3443f1c95a4b267c4387a9ac7c79315422a51e896c0bcea48fbe959bc301094770aa8065b2388a84760a3e07e5d1753c2b351336fb2d3a8c996ee14d32088f6e
+commons-daemon.native.src.checksum.value=c37f506b129b8a0efface6745dcc6d0d9d3e2663d28eca0df9903301f0b9b65fd8306e361935887fb459daf0a29da6fa63ea60f742ce4e497dc53a2a2d86db12
 commons-daemon.native.win.checksum.enabled=true
 commons-daemon.native.win.checksum.algorithm=SHA-512
-commons-daemon.native.win.checksum.value=10cda04d9a44286cb67107fdb9d20958013f075cad4accba048801f3677765c334dc16f6901e1d2e4a9df5a2c702797370de63393568df6fceb9e7902421f9ea
+commons-daemon.native.win.checksum.value=8b6e0bb4172861338e0cb3238f6da715c3cef04a88e8bfab0cbb487ef638aa69fd34de9407b0b2ed54451fbbcbff8a999324289052a581a5d07d6f6ff84a83b6
 
 commons-daemon.home=${base.path}/commons-daemon-${commons-daemon.version}
 
commons-daemon.jar=${commons-daemon.home}/commons-daemon-${commons-daemon.version}.jar
diff --git a/res/tomcat.nsi b/res/tomcat.nsi
index 8efe924..0175f12 100644
--- a/res/tomcat.nsi
+++ b/res/tomcat.nsi
@@ -364,6 +364,22 @@ Section -post
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache 
Tomcat @VERSION_MAJOR_MINOR@ $TomcatServiceName" \
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\" 
-ServiceName=$\"$TomcatServiceName$\""
 
+  ; Configure file permissions
+  ; S-1-5-19 LocalService
+  ; S-1-5-32-544 Local Administrators group
+  ; S-1-5-18 Local System
+  nsExec::ExecToStack 'icacls "$INSTDIR" /inheritance:r /grant 
*S-1-5-19:(OI)(CI)(F) /grant *S-1-5-32-544:(OI)(CI)(F) /grant 
*S-1-5-18:(OI)(CI)(F)'
+  Pop $0
+  Pop $1
+  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)?" \
+  /SD IDNO IDYES SetPermissionsOk
+  Quit
+  SetPermissionsOk:
+  ClearErrors
+
 SectionEnd
 
 !define ReadFromConfigIni "!insertmacro ReadFromConfigIni"
@@ -412,7 +428,7 @@ Function .onInit
 
   ;Initialize default values
   StrCpy $JavaHome ""
-  StrCpy $TomcatPortShutdown "8005"
+  StrCpy $TomcatPortShutdown "-1"
   StrCpy $TomcatPortHttp "8080"
   StrCpy $TomcatPortAjp "8009"
   StrCpy $TomcatMenuEntriesEnable "0"
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d9d75bc..437ef68 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -52,6 +52,19 @@
 This allows Tomcat 8.5 to use the newer Checks

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

2019-07-08 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 e110331  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969
e110331 is described below

commit e110331129f2089196925fc963d1e2cc2667dae4
Author: Mark Thomas 
AuthorDate: Mon Jul 8 15:41:59 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55969

Tighten security for the Windows installer.
Update to Daemon 1.2.0. This changes the default user from "Local
System" to "Local Service".
Disable the shutdown port by default (service doesn't use it).
Limit file permissions to local admins, "Local Service" and "Local
System".
---
 build.properties.default   | 14 +++---
 res/tomcat.nsi | 18 +-
 webapps/docs/changelog.xml | 13 +
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 4b79f07..86c46cf 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -171,21 +171,21 @@ 
nsis.system.dll=${nsis.home}/Plugins/${nsis.arch.dir}System.dll
 nsis.nsdialogs.dll=${nsis.home}/Plugins/${nsis.arch.dir}nsDialogs.dll
 nsis.loc=${base-sf.loc}/nsis/nsis-${nsis.version}.zip
 
-# - Commons Daemon, version 1.1.0 or later -
-commons-daemon.version=1.1.0
+# - Commons Daemon, version 1.2.0 or later -
+commons-daemon.version=1.2.0
 
-# checksum for commons-daemon-1.1.0-bin.tar.gz
+# checksum for commons-daemon-1.2.0-bin.tar.gz
 commons-daemon.bin.checksum.enabled=true
 commons-daemon.bin.checksum.algorithm=SHA-512
-commons-daemon.bin.checksum.value=43c33e52e0be11e73370083500592ee9df0431c3166dbc7ed95794cabb462ac2a140e3eb4bbe2a0b99882bb93d9244ff534f13e4933c13e7a31a37e58e0c8e1d
+commons-daemon.bin.checksum.value=81fbbd1115d735232bbcc426d958bd8fe149c97bfe96df1549a19332afd4954f3f75c3a693f214bfef065931a1d79c528dfb2cefb1bb3628d211e1761814c23b
 
-# checksums for commons-daemon-1.1.0-native-src.tar.gz, 
commons-daemon-1.1.0-bin-windows.zip
+# checksums for commons-daemon-1.1.0-native-src.tar.gz, 
commons-daemon-1.2.0-bin-windows.zip
 commons-daemon.native.src.checksum.enabled=true
 commons-daemon.native.src.checksum.algorithm=SHA-512
-commons-daemon.native.src.checksum.value=3443f1c95a4b267c4387a9ac7c79315422a51e896c0bcea48fbe959bc301094770aa8065b2388a84760a3e07e5d1753c2b351336fb2d3a8c996ee14d32088f6e
+commons-daemon.native.src.checksum.value=c37f506b129b8a0efface6745dcc6d0d9d3e2663d28eca0df9903301f0b9b65fd8306e361935887fb459daf0a29da6fa63ea60f742ce4e497dc53a2a2d86db12
 commons-daemon.native.win.checksum.enabled=true
 commons-daemon.native.win.checksum.algorithm=SHA-512
-commons-daemon.native.win.checksum.value=10cda04d9a44286cb67107fdb9d20958013f075cad4accba048801f3677765c334dc16f6901e1d2e4a9df5a2c702797370de63393568df6fceb9e7902421f9ea
+commons-daemon.native.win.checksum.value=8b6e0bb4172861338e0cb3238f6da715c3cef04a88e8bfab0cbb487ef638aa69fd34de9407b0b2ed54451fbbcbff8a999324289052a581a5d07d6f6ff84a83b6
 
 commons-daemon.home=${base.path}/commons-daemon-${commons-daemon.version}
 
commons-daemon.jar=${commons-daemon.home}/commons-daemon-${commons-daemon.version}.jar
diff --git a/res/tomcat.nsi b/res/tomcat.nsi
index f2d2758..173932d 100644
--- a/res/tomcat.nsi
+++ b/res/tomcat.nsi
@@ -364,6 +364,22 @@ Section -post
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache 
Tomcat @VERSION_MAJOR_MINOR@ $TomcatServiceName" \
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\" 
-ServiceName=$\"$TomcatServiceName$\""
 
+  ; Configure file permissions
+  ; S-1-5-19 LocalService
+  ; S-1-5-32-544 Local Administrators group
+  ; S-1-5-18 Local System
+  nsExec::ExecToStack 'icacls "$INSTDIR" /inheritance:r /grant 
*S-1-5-19:(OI)(CI)(F) /grant *S-1-5-32-544:(OI)(CI)(F) /grant 
*S-1-5-18:(OI)(CI)(F)'
+  Pop $0
+  Pop $1
+  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)?" \
+  /SD IDNO IDYES SetPermissionsOk
+  Quit
+  SetPermissionsOk:
+  ClearErrors
+
 SectionEnd
 
 !define ReadFromConfigIni "!insertmacro ReadFromConfigIni"
@@ -412,7 +428,7 @@ Function .onInit
 
   ;Initialize default values
   StrCpy $JavaHome ""
-  StrCpy $TomcatPortShutdown "8005"
+  StrCpy $TomcatPortShutdown "-1"
   StrCpy $TomcatPortHttp "8080"
   StrCpy $TomcatPortAjp "8009"
   StrCpy $TomcatMenuEntriesEnable "0"
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index bcc5a0c..93b6de2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -62,6 +62,19 @@
   
 Update Checkstyle to 8.22. (markt)
 

[GitHub] [tomcat] govi20 commented on issue #177: Code polish: replace classic for-loop with enhanced

2019-07-08 Thread GitBox
govi20 commented on issue #177: Code polish: replace classic for-loop with 
enhanced
URL: https://github.com/apache/tomcat/pull/177#issuecomment-509239212
 
 
   Cool Thanks!


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



[Bug 55969] Security-related enhancements to the Windows Installer

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

--- Comment #2 from Mark Thomas  ---
The Daemon 1.2.0 release has now happened and I am working on integrating this
into the Tomcat installer.

Providing an option to select a user looks to be a significant amount of work.
Therefore, I propose to use the default (which has changed to LocalService).
The user still has the option to configure the user via the Commons Daemon UI.

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



JDK 13 , JDK 14 & Valhalla Early Access builds are available.

2019-07-08 Thread Rory O'Donnell

 Hi Mark,

**OpenJDK* 13 Early Access build **28 is now available **at : - 
jdk.java.net/13/*


 * These early-access, open-source builds are provided under the GNU
   General Public License, version 2, with the Classpath Exception
   .
 * Changes in this build 28 [1]


*Reminder of a change in b24 - A jrt URI can only encode paths to files 
in /modules tree **(JDK-8224946 
)*


A |jrt| URL is a hierarchical URI with syntax |jrt:/[$MODULE[/$PATH]]|. 
When using the |jrt| file system, a |java.net.URI| object can be created 
with the |java.nio.file.Path::toUri| method to encode a normalized path 
to a file in the |/modules| tree. A |jrt| URL cannot encode a path to a 
file in the |/packages| tree. The |jrt| file system provider has changed 
in this release so that |toUri| fails with |IOError| when it is not 
possible to encode the file path as a jrt URI. *This change may impact 
tools have been making use of URLs that are not compliant with the 
syntax. Tools with paths to files in **|/packages|**can use the 
**|toRealPath()|**method to obtain the real path (in **|/modules|**) 
before attempting to convert the file path to a URI.*


*OpenJDK 14 **Early Access build 4 **is now available **at : - 
jdk.java.net/14/*


 * These early-access, open-source builds are provided under the GNU
   General Public License, version 2, with the Classpath Exception
   .
 * Changes in this build [2]


*Project Valhalla "L-World Inline Types" Early-Access Builds*

 * Build jdk-14-valhalla+1-8
 * These early-access builds are provided under the GNU General Public
   License, version 2, with the Classpath Exception
   .
 * Please send feedback via e-mail to valhalla-...@openjdk.java.net
   . To send e-mail to this
   address you must first subscribe to the mailing list.


*The Skara tooling is now open source *[3]
we are happy to announce that the tooling for project Skara is now open 
source and available at


 * https://github.com/openjdk/skara 

The Skara tooling includes both server-side tools (so called "bots") as 
well as several command-line tools **

If you have any questions, feedback etc. send them to Skara mailing list [4]

Rgds, Rory


[1] JDK 13 - Changes in b28 here 

[2] JDK 14 - Changes in b4 here 


[3] https://mail.openjdk.java.net/pipermail/skara-dev/2019-June/47.html
[4] https://mail.openjdk.java.net/mailman/listinfo/skara-dev

--
Rgds, Rory O'Donnell
Quality Engineering Manager
Oracle EMEA, Dublin, Ireland



[Bug 63551] Tomcat overrides default JAVA_HOME variable

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

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #1 from Mark Thomas  ---
That file is provided by your distribution, not by Apache Tomcat.

You need to open an issue with your distribution.

-- 
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 7.0.x updated (21a909b -> f3fe656)

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

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


from 21a909b  Update Checkstyle to 8.22
 new ffbd380  Update Javadoc comments (copied from 8.5.x)
 new 83c20cd  Add NPE clarifications from 4.0 spec
 new 5a3d373  Clean-up.
 new f3fe656  Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.

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/javax/servlet/ServletContext.java | 278 +++-
 .../apache/catalina/core/ApplicationContext.java   | 472 +
 2 files changed, 273 insertions(+), 477 deletions(-)


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



[tomcat] 03/04: Clean-up.

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

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

commit 5a3d3735c997a14856a0340363e6c8826e0de46f
Author: Mark Thomas 
AuthorDate: Mon Jul 8 11:03:32 2019 +0100

Clean-up.

Add service and use it. Whitespace. Use of final. Remove Javadoc where
it can/should be inherited. Remove unnecessary (). Remove unused code.
Align with 8.5.x where possible.
---
 .../apache/catalina/core/ApplicationContext.java   | 466 +
 1 file changed, 97 insertions(+), 369 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 1ac3996..433675f 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -29,7 +29,6 @@ import java.util.Enumeration;
 import java.util.EventListener;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -122,6 +121,7 @@ public class ApplicationContext implements ServletContext {
 public ApplicationContext(StandardContext context) {
 super();
 this.context = context;
+this.service = ((Engine) context.getParent().getParent()).getService();
 this.sessionCookieConfig = new ApplicationSessionCookieConfig(context);
 
 // Populate session tracking modes
@@ -135,8 +135,7 @@ public class ApplicationContext implements ServletContext {
 /**
  * The context attributes for this context.
  */
-protected Map attributes =
-new ConcurrentHashMap();
+protected Map attributes = new 
ConcurrentHashMap();
 
 
 /**
@@ -148,7 +147,13 @@ public class ApplicationContext implements ServletContext {
 /**
  * The Context instance with which we are associated.
  */
-private StandardContext context = null;
+private final StandardContext context;
+
+
+/**
+ * The Service instance with which we are associated.
+ */
+private final Service service;
 
 
 /**
@@ -156,6 +161,7 @@ public class ApplicationContext implements ServletContext {
  */
 private static final List emptyString = Collections.emptyList();
 
+
 /**
  * Empty Servlet collection to serve as the basis for empty enumerations.
  */
@@ -165,7 +171,7 @@ public class ApplicationContext implements ServletContext {
 /**
  * The facade around this object.
  */
-private ServletContext facade = new ApplicationContextFacade(this);
+private final ServletContext facade = new ApplicationContextFacade(this);
 
 
 /**
@@ -177,15 +183,13 @@ public class ApplicationContext implements ServletContext 
{
 /**
  * The string manager for this package.
  */
-private static final StringManager sm =
-StringManager.getManager(Constants.Package);
+private static final StringManager sm = 
StringManager.getManager(Constants.Package);
 
 
 /**
  * Thread local data used during request dispatch.
  */
-private ThreadLocal dispatchData =
-new ThreadLocal();
+private final ThreadLocal dispatchData = new 
ThreadLocal();
 
 
 /**
@@ -218,22 +222,12 @@ public class ApplicationContext implements ServletContext 
{
 
 // - ServletContext Methods
 
-/**
- * Return the value of the specified context attribute, if any;
- * otherwise return null.
- *
- * @param name Name of the context attribute to return
- */
 @Override
 public Object getAttribute(String name) {
 return attributes.get(name);
 }
 
 
-/**
- * Return an enumeration of the names of the context attributes
- * associated with this context.
- */
 @Override
 public Enumeration getAttributeNames() {
 Set names = new HashSet();
@@ -242,16 +236,6 @@ public class ApplicationContext implements ServletContext {
 }
 
 
-/**
- * Return a ServletContext object that corresponds to a
- * specified URI on the server.  This method allows servlets to gain
- * access to the context for various parts of the server, and as needed
- * obtain RequestDispatcher objects or resources from the
- * context.  The given path must be absolute (beginning with a "/"),
- * and is interpreted based on our virtual host's document root.
- *
- * @param uri Absolute URI of a resource on the server
- */
 @Override
 public ServletContext getContext(String uri) {
 
@@ -288,7 +272,7 @@ public class ApplicationContext implements ServletContext {
 pathMB.setString(uri);
 
 MappingData mappingData = new MappingData();
-((Engine) 
host.getParent()).getService().findConnectors()[0].getMapper().map(
+service.findConnectors()[

[tomcat] 04/04: Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.

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

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

commit f3fe6564d2866e5a12d9356ea447505f0f5c1740
Author: Mark Thomas 
AuthorDate: Mon Jul 8 13:02:38 2019 +0100

Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.
---
 java/org/apache/catalina/core/ApplicationContext.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 433675f..ff9ba95 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -735,11 +735,11 @@ public class ApplicationContext implements ServletContext 
{
 }
 ServletContextAttributeEvent event = new ServletContextAttributeEvent(
 context.getServletContext(), name, value);
-for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener)) {
+for (Object obj : listeners) {
+if (!(obj instanceof ServletContextAttributeListener)) {
 continue;
 }
-ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) obj;
 try {
 context.fireContainerEvent("beforeContextAttributeRemoved", 
listener);
 listener.attributeRemoved(event);
@@ -788,11 +788,11 @@ public class ApplicationContext implements ServletContext 
{
 event = new 
ServletContextAttributeEvent(context.getServletContext(), name, value);
 }
 
-for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener)) {
+for (Object obj : listeners) {
+if (!(obj instanceof ServletContextAttributeListener)) {
 continue;
 }
-ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) obj;
 try {
 if (replaced) {
 
context.fireContainerEvent("beforeContextAttributeReplaced", listener);


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



[tomcat] 02/04: Add NPE clarifications from 4.0 spec

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

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

commit 83c20cd258361f7a2a52996b2bde91341281c064
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:31:23 2019 +0100

Add NPE clarifications from 4.0 spec
---
 java/javax/servlet/ServletContext.java | 8 
 1 file changed, 8 insertions(+)

diff --git a/java/javax/servlet/ServletContext.java 
b/java/javax/servlet/ServletContext.java
index c22bcb0..f707ed5 100644
--- a/java/javax/servlet/ServletContext.java
+++ b/java/javax/servlet/ServletContext.java
@@ -437,6 +437,8 @@ public interface ServletContext {
  *whose value is requested
  * @return a String containing the value of the initialization
  * parameter
+ * @throws NullPointerException If the provided parameter name is
+ * null
  * @see ServletConfig#getInitParameter
  */
 public String getInitParameter(String name);
@@ -469,6 +471,8 @@ public interface ServletContext {
  *{@link javax.servlet.annotation.WebListener}. For example, a
  *{@link ServletContextListener} defined in a TLD would not be able to
  *use this method.
+ * @throws NullPointerException If the provided parameter name is
+ * null
  * @since Servlet 3.0
  */
 public boolean setInitParameter(String name, String value);
@@ -490,6 +494,8 @@ public interface ServletContext {
  *a String specifying the name of the attribute
  * @return an Object containing the value of the attribute, or
  * null if no attribute exists matching the given name
+ * @throws NullPointerException If the provided attribute name is
+ * null
  * @see ServletContext#getAttributeNames
  */
 public Object getAttribute(String name);
@@ -523,6 +529,8 @@ public interface ServletContext {
  *a String specifying the name of the attribute
  * @param object
  *an Object representing the attribute to be bound
+ * @throws NullPointerException If the provided attribute name is
+ * null
  */
 public void setAttribute(String name, Object object);
 


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



[tomcat] 01/04: Update Javadoc comments (copied from 8.5.x)

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

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

commit ffbd38048e52a1d1d3d1e6d6395bf0e6df33b9bd
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:29:39 2019 +0100

Update Javadoc comments (copied from 8.5.x)
---
 java/javax/servlet/ServletContext.java | 270 -
 1 file changed, 165 insertions(+), 105 deletions(-)

diff --git a/java/javax/servlet/ServletContext.java 
b/java/javax/servlet/ServletContext.java
index 7c229b0..c22bcb0 100644
--- a/java/javax/servlet/ServletContext.java
+++ b/java/javax/servlet/ServletContext.java
@@ -46,7 +46,6 @@ import javax.servlet.descriptor.JspConfigDescriptor;
  * {@link ServletConfig} object, which the Web server provides the servlet when
  * the servlet is initialized.
  *
- * @author Various
  * @see Servlet#getServletConfig
  * @see ServletConfig#getServletContext
  */
@@ -60,6 +59,15 @@ public interface ServletContext {
 public static final String ORDERED_LIBS = 
"javax.servlet.context.orderedLibs";
 
 /**
+ * Return the main path associated with this context.
+ *
+ * @return The main context path
+ *
+ * @since Servlet 2.5
+ */
+public String getContextPath();
+
+/**
  * Returns a ServletContext object that corresponds to a
  * specified URL on the server.
  * 
@@ -82,8 +90,6 @@ public interface ServletContext {
  */
 public ServletContext getContext(String uripath);
 
-public String getContextPath();
-
 /**
  * Returns the major version of the Java Servlet API that this servlet
  * container supports. All implementations that comply with Version 3.0 
must
@@ -286,46 +292,54 @@ public interface ServletContext {
 public RequestDispatcher getNamedDispatcher(String name);
 
 /**
+ * Do not use. This method was originally defined to retrieve a servlet 
from
+ * a ServletContext. In this version, this method always
+ * returns null and remains only to preserve binary
+ * compatibility. This method will be permanently removed in a future
+ * version of the Java Servlet API.
+ * 
+ * In lieu of this method, servlets can share information using the
+ * ServletContext class and can perform shared business logic
+ * by invoking methods on common non-servlet classes.
+ *
+ * @param name Not used
+ *
+ * @return Always null
+ *
+ * @throws ServletException never
+ *
  * @deprecated As of Java Servlet API 2.1, with no direct replacement.
- * 
- * This method was originally defined to retrieve a servlet 
from
- * a ServletContext. In this version, this method
- * always returns null and remains only to 
preserve
- * binary compatibility. This method will be permanently 
removed
- * in a future version of the Java Servlet API.
- * 
- * In lieu of this method, servlets can share information using
- * the ServletContext class and can perform shared
- * business logic by invoking methods on common non-servlet
- * classes.
  */
 @SuppressWarnings("dep-ann")
 // Spec API does not use @Deprecated
 public Servlet getServlet(String name) throws ServletException;
 
 /**
+ * Do not use. This method was originally defined to return an
+ * Enumeration of all the servlets known to this servlet
+ * context. In this version, this method always returns an empty 
enumeration
+ * and remains only to preserve binary compatibility. This method will be
+ * permanently removed in a future version of the Java Servlet API.
+ *
+ * @return Always and empty Enumeration
+ *
  * @deprecated As of Java Servlet API 2.0, with no replacement.
- * 
- * This method was originally defined to return an
- * Enumeration of all the servlets known to this
- * servlet context. In this version, this method always returns
- * an empty enumeration and remains only to preserve binary
- * compatibility. This method will be permanently removed in a
- * future version of the Java Servlet API.
  */
 @SuppressWarnings("dep-ann")
 // Spec API does not use @Deprecated
 public Enumeration getServlets();
 
 /**
+ * Do not use. This method was originally defined to return an
+ * Enumeration of all the servlet names known to this context.
+ * In this version, this method always returns an empty
+ * Enumeration and remains only to preserve binary
+ * compatibility. This method will be permanently removed in a future
+ * version of the Java Servlet API.
+ *
+ * @return Always and empty Enumeration
+ *
  * @deprecated As of Java Servlet API 2.1, 

[tomcat] 02/03: Clean-up.

2019-07-08 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 9b773c025172253bde78c675a2f3327a0201ba2c
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:58:45 2019 +0100

Clean-up.

Whitespace. Braces. Use service. Use ReflectiveOperationException. Use
interfaces rather than concrete types.
Improves alignment with 9.0.x.
---
 .../apache/catalina/core/ApplicationContext.java   | 113 +
 1 file changed, 46 insertions(+), 67 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 9d9f306..250061a 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -182,8 +182,7 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 /**
  * The string manager for this package.
  */
-private static final StringManager sm =
-  StringManager.getManager(Constants.Package);
+private static final StringManager sm = 
StringManager.getManager(Constants.Package);
 
 
 /**
@@ -264,7 +263,7 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 pathMB.setString(uri);
 
 MappingData mappingData = new MappingData();
-((Engine) 
host.getParent()).getService().getMapper().map(hostMB, pathMB, null, 
mappingData);
+service.getMapper().map(hostMB, pathMB, null, mappingData);
 child = mappingData.context;
 }
 } catch (Throwable t) {
@@ -596,8 +595,7 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 return null;
 }
 if (!path.startsWith("/")) {
-throw new IllegalArgumentException
-(sm.getString("applicationContext.resourcePaths.iae", path));
+throw new IllegalArgumentException 
(sm.getString("applicationContext.resourcePaths.iae", path));
 }
 
 WebResourceRoot resources = context.getResources();
@@ -678,26 +676,23 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 
 // Notify interested application event listeners
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0))
+if ((listeners == null) || (listeners.length == 0)) {
 return;
-ServletContextAttributeEvent event =
-  new ServletContextAttributeEvent(context.getServletContext(),
-name, value);
+}
+ServletContextAttributeEvent event = new ServletContextAttributeEvent(
+context.getServletContext(), name, value);
 for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener))
+if (!(listeners[i] instanceof ServletContextAttributeListener)) {
 continue;
-ServletContextAttributeListener listener =
-(ServletContextAttributeListener) listeners[i];
+}
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
 try {
-context.fireContainerEvent("beforeContextAttributeRemoved",
-   listener);
+context.fireContainerEvent("beforeContextAttributeRemoved", 
listener);
 listener.attributeRemoved(event);
-context.fireContainerEvent("afterContextAttributeRemoved",
-   listener);
+context.fireContainerEvent("afterContextAttributeRemoved", 
listener);
 } catch (Throwable t) {
 ExceptionUtils.handleThrowable(t);
-context.fireContainerEvent("afterContextAttributeRemoved",
-   listener);
+context.fireContainerEvent("afterContextAttributeRemoved", 
listener);
 // FIXME - should we do anything besides log these?
 log(sm.getString("applicationContext.attributeEvent"), t);
 }
@@ -709,8 +704,7 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 public void setAttribute(String name, Object value) {
 // Name cannot be null
 if (name == null) {
-throw new NullPointerException
-(sm.getString("applicationContext.setAttribute.namenull"));
+throw new 
NullPointerException(sm.getString("applicationContext.setAttribute.namenull"));
 }
 
 // Null value is the same as removeAttribute()
@@ -721,53 +715,47 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 
  

[tomcat] 01/03: Add NPE clarifications from 4.0 spec

2019-07-08 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 1128724c40b66437e9364993715282b74142e393
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:31:05 2019 +0100

Add NPE clarifications from 4.0 spec
---
 java/javax/servlet/ServletContext.java | 8 
 1 file changed, 8 insertions(+)

diff --git a/java/javax/servlet/ServletContext.java 
b/java/javax/servlet/ServletContext.java
index 8f96e66..91b4f34 100644
--- a/java/javax/servlet/ServletContext.java
+++ b/java/javax/servlet/ServletContext.java
@@ -437,6 +437,8 @@ public interface ServletContext {
  *whose value is requested
  * @return a String containing the value of the initialization
  * parameter
+ * @throws NullPointerException If the provided parameter name is
+ * null
  * @see ServletConfig#getInitParameter
  */
 public String getInitParameter(String name);
@@ -469,6 +471,8 @@ public interface ServletContext {
  *{@link javax.servlet.annotation.WebListener}. For example, a
  *{@link ServletContextListener} defined in a TLD would not be able to
  *use this method.
+ * @throws NullPointerException If the provided parameter name is
+ * null
  * @since Servlet 3.0
  */
 public boolean setInitParameter(String name, String value);
@@ -490,6 +494,8 @@ public interface ServletContext {
  *a String specifying the name of the attribute
  * @return an Object containing the value of the attribute, or
  * null if no attribute exists matching the given name
+ * @throws NullPointerException If the provided attribute name is
+ * null
  * @see ServletContext#getAttributeNames
  */
 public Object getAttribute(String name);
@@ -523,6 +529,8 @@ public interface ServletContext {
  *a String specifying the name of the attribute
  * @param object
  *an Object representing the attribute to be bound
+ * @throws NullPointerException If the provided attribute name is
+ * null
  */
 public void setAttribute(String name, Object object);
 


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



[tomcat] 03/03: Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.

2019-07-08 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 f4a5572b1493de260085e78df4d24d3c36a45173
Author: Mark Thomas 
AuthorDate: Mon Jul 8 13:02:38 2019 +0100

Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.
---
 java/org/apache/catalina/core/ApplicationContext.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 250061a..c243072 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -681,11 +681,11 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 }
 ServletContextAttributeEvent event = new ServletContextAttributeEvent(
 context.getServletContext(), name, value);
-for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener)) {
+for (Object obj : listeners) {
+if (!(obj instanceof ServletContextAttributeListener)) {
 continue;
 }
-ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) obj;
 try {
 context.fireContainerEvent("beforeContextAttributeRemoved", 
listener);
 listener.attributeRemoved(event);
@@ -734,11 +734,11 @@ public class ApplicationContext implements 
org.apache.catalina.servlet4preview.S
 event = new 
ServletContextAttributeEvent(context.getServletContext(), name, value);
 }
 
-for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener)) {
+for (Object obj : listeners) {
+if (!(obj instanceof ServletContextAttributeListener)) {
 continue;
 }
-ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) obj;
 try {
 if (replaced) {
 
context.fireContainerEvent("beforeContextAttributeReplaced", listener);


-
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 (c810721 -> f4a5572)

2019-07-08 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 c810721  Update to Checkstyle 8.22
 new 1128724  Add NPE clarifications from 4.0 spec
 new 9b773c0  Clean-up.
 new f4a5572  Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.

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


Summary of changes:
 java/javax/servlet/ServletContext.java |   8 ++
 .../apache/catalina/core/ApplicationContext.java   | 119 +
 2 files changed, 57 insertions(+), 70 deletions(-)


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



[GitHub] [tomcat] markt-asf closed pull request #177: Code polish: replace classic for-loop with enhanced

2019-07-08 Thread GitBox
markt-asf closed pull request #177: Code polish: replace classic for-loop with 
enhanced
URL: https://github.com/apache/tomcat/pull/177
 
 
   


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


With regards,
Apache Git Services

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



[GitHub] [tomcat] markt-asf commented on issue #177: Code polish: replace classic for-loop with enhanced

2019-07-08 Thread GitBox
markt-asf commented on issue #177: Code polish: replace classic for-loop with 
enhanced
URL: https://github.com/apache/tomcat/pull/177#issuecomment-509198246
 
 
   `for (Object obj : listeners) {...` results in a cleaner patch. I've applied 
that version to master and will back-port shortly. I've also applied some other 
clean-up and will back-port that too.


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] 02/04: Clean-up. Whitespace, braces

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

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

commit 7d27aa967306fbd0167d5c69faa267b40dd2ff66
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:10:22 2019 +0100

Clean-up. Whitespace, braces
---
 .../apache/catalina/core/ApplicationContext.java   | 94 +-
 1 file changed, 39 insertions(+), 55 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 87eab5a..fe70a32 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -180,8 +180,7 @@ public class ApplicationContext implements ServletContext {
 /**
  * The string manager for this package.
  */
-private static final StringManager sm =
-  StringManager.getManager(Constants.Package);
+private static final StringManager sm = 
StringManager.getManager(Constants.Package);
 
 
 /**
@@ -594,8 +593,7 @@ public class ApplicationContext implements ServletContext {
 return null;
 }
 if (!path.startsWith("/")) {
-throw new IllegalArgumentException
-(sm.getString("applicationContext.resourcePaths.iae", path));
+throw new IllegalArgumentException 
(sm.getString("applicationContext.resourcePaths.iae", path));
 }
 
 WebResourceRoot resources = context.getResources();
@@ -676,26 +674,23 @@ public class ApplicationContext implements ServletContext 
{
 
 // Notify interested application event listeners
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0))
+if ((listeners == null) || (listeners.length == 0)) {
 return;
-ServletContextAttributeEvent event =
-  new ServletContextAttributeEvent(context.getServletContext(),
-name, value);
+}
+ServletContextAttributeEvent event = new ServletContextAttributeEvent(
+context.getServletContext(), name, value);
 for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener))
+if (!(listeners[i] instanceof ServletContextAttributeListener)) {
 continue;
-ServletContextAttributeListener listener =
-(ServletContextAttributeListener) listeners[i];
+}
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
 try {
-context.fireContainerEvent("beforeContextAttributeRemoved",
-   listener);
+context.fireContainerEvent("beforeContextAttributeRemoved", 
listener);
 listener.attributeRemoved(event);
-context.fireContainerEvent("afterContextAttributeRemoved",
-   listener);
+context.fireContainerEvent("afterContextAttributeRemoved", 
listener);
 } catch (Throwable t) {
 ExceptionUtils.handleThrowable(t);
-context.fireContainerEvent("afterContextAttributeRemoved",
-   listener);
+context.fireContainerEvent("afterContextAttributeRemoved", 
listener);
 // FIXME - should we do anything besides log these?
 log(sm.getString("applicationContext.attributeEvent"), t);
 }
@@ -707,8 +702,7 @@ public class ApplicationContext implements ServletContext {
 public void setAttribute(String name, Object value) {
 // Name cannot be null
 if (name == null) {
-throw new NullPointerException
-(sm.getString("applicationContext.setAttribute.namenull"));
+throw new 
NullPointerException(sm.getString("applicationContext.setAttribute.namenull"));
 }
 
 // Null value is the same as removeAttribute()
@@ -719,53 +713,47 @@ public class ApplicationContext implements ServletContext 
{
 
 // Add or replace the specified attribute
 // Check for read only attribute
-if (readOnlyAttributes.containsKey(name))
+if (readOnlyAttributes.containsKey(name)) {
 return;
+}
 
 Object oldValue = attributes.put(name, value);
 boolean replaced = oldValue != null;
 
 // Notify interested application event listeners
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0))
+if ((listeners == null) || (listeners.length == 0)) {
 return;
+}
 ServletContextAttributeEvent event = null;
-if (replaced)
-event =
-new Servl

[tomcat] 03/04: Simplify code. We already have the Service for this Context so use it.

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

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

commit cc90fc683f36d7c853b7bde56f36a570a131d6c6
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:14:52 2019 +0100

Simplify code. We already have the Service for this Context so use it.
---
 java/org/apache/catalina/core/ApplicationContext.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index fe70a32..79f2a8b 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -261,7 +261,7 @@ public class ApplicationContext implements ServletContext {
 pathMB.setString(uri);
 
 MappingData mappingData = new MappingData();
-((Engine) 
host.getParent()).getService().getMapper().map(hostMB, pathMB, null, 
mappingData);
+service.getMapper().map(hostMB, pathMB, null, mappingData);
 child = mappingData.context;
 }
 } catch (Throwable t) {
@@ -1010,8 +1010,7 @@ public class ApplicationContext implements ServletContext 
{
 
 // SSL not enabled by default as it can only used on its own
 // Context > Host > Engine > Service
-Service s = ((Engine) context.getParent().getParent()).getService();
-Connector[] connectors = s.findConnectors();
+Connector[] connectors = service.findConnectors();
 // Need at least one SSL enabled connector to use the SSL session ID.
 for (Connector connector : connectors) {
 if (Boolean.TRUE.equals(connector.getAttribute("SSLEnabled"))) {


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



[tomcat] branch master updated (22acea9 -> 2edb9b0)

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

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


from 22acea9  Update checkstyle to 8.22
 new 802caad  Add a check, commented out by default, that helps when 
tidying up code
 new 7d27aa9  Clean-up. Whitespace, braces
 new cc90fc6  Simplify code. We already have the Service for this Context 
so use it.
 new 2edb9b0  Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.

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:
 .../apache/catalina/core/ApplicationContext.java   | 105 +
 res/checkstyle/checkstyle.xml  |   9 +-
 2 files changed, 52 insertions(+), 62 deletions(-)


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



[tomcat] 01/04: Add a check, commented out by default, that helps when tidying up code

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

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

commit 802caad5a32f4cf4feb754deef09f061338a8d36
Author: Mark Thomas 
AuthorDate: Mon Jul 8 10:06:43 2019 +0100

Add a check, commented out by default, that helps when tidying up code
---
 res/checkstyle/checkstyle.xml | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/res/checkstyle/checkstyle.xml b/res/checkstyle/checkstyle.xml
index 60596c1..711212e 100644
--- a/res/checkstyle/checkstyle.xml
+++ b/res/checkstyle/checkstyle.xml
@@ -78,7 +78,14 @@
 
 
 
-
+
+
+
+
 
 

[tomcat] 04/04: Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.

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

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

commit 2edb9b000e77967b651fe78df81d47ac5fb828fb
Author: Mark Thomas 
AuthorDate: Mon Jul 8 13:02:38 2019 +0100

Use enhanced for-loops. Based on PR #177 by Govinda Sakhare.
---
 java/org/apache/catalina/core/ApplicationContext.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 79f2a8b..79628e0 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -679,11 +679,11 @@ public class ApplicationContext implements ServletContext 
{
 }
 ServletContextAttributeEvent event = new ServletContextAttributeEvent(
 context.getServletContext(), name, value);
-for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener)) {
+for (Object obj : listeners) {
+if (!(obj instanceof ServletContextAttributeListener)) {
 continue;
 }
-ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) obj;
 try {
 context.fireContainerEvent("beforeContextAttributeRemoved", 
listener);
 listener.attributeRemoved(event);
@@ -732,11 +732,11 @@ public class ApplicationContext implements ServletContext 
{
 event = new 
ServletContextAttributeEvent(context.getServletContext(), name, value);
 }
 
-for (int i = 0; i < listeners.length; i++) {
-if (!(listeners[i] instanceof ServletContextAttributeListener)) {
+for (Object obj : listeners) {
+if (!(obj instanceof ServletContextAttributeListener)) {
 continue;
 }
-ServletContextAttributeListener listener = 
(ServletContextAttributeListener) listeners[i];
+ServletContextAttributeListener listener = 
(ServletContextAttributeListener) obj;
 try {
 if (replaced) {
 
context.fireContainerEvent("beforeContextAttributeReplaced", listener);


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



Re: [VOTE] Release Apache Tomcat 8.5.43

2019-07-08 Thread Rémy Maucherat
On Thu, Jul 4, 2019 at 11:19 PM Mark Thomas  wrote:

> The proposed Apache Tomcat 8.5.43 release is now available for voting.
>
> The major changes compared to the 8.5.42 release are:
>
> - Add the ability for a UserDatabase to monitor the backing XML file
>   for changes and reload the source file if a change in the last
>   modified time is detected. This is enabled by default meaning that
>   changes to $CATALINA_BASE/conf/tomcat-users.xml will now take
>   effect a short time after the file is saved.
>
> - Update to Tomcat Native 1.2.23 including Windows binaries built
>   with OpenSSL 1.1.1c
>
>
> Along with lots of other bug fixes and improvements.
>
> For full details, see the changelog:
> https://ci.apache.org/projects/tomcat/tomcat85/docs/changelog.html
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-8/v8.5.43/
>
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1216/
>
> The tag is:
> https://github.com/apache/tomcat/tree/8.5.43
> 4e32ede8c5c5ed6937d29a37b5108dfcd13c5954
>
> The proposed 8.5.43 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 8.5.43
>
>
> Rémy


[Bug 63551] New: Tomcat overrides default JAVA_HOME variable

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

Bug ID: 63551
   Summary: Tomcat overrides default JAVA_HOME variable
   Product: Tomcat 8
   Version: 8.5.39
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: apache@marco.sulla.e4ward.com
  Target Milestone: 

In /etc/init.d/tomcat8 there's this code:



# this is a work-around until there is a suitable runtime replacement
# for dpkg-architecture for arch:all packages
# this function sets the variable JDK_DIRS
find_jdks()
{
for java_version in 11 10 9 8
do
for jvmdir in /usr/lib/jvm/java-${java_version}-openjdk-* \
  /usr/lib/jvm/jdk-${java_version}-oracle-* \
  /usr/lib/jvm/jre-${java_version}-oracle-* \
  /usr/lib/jvm/java-${java_version}-oracle
do
if [ -d "${jvmdir}" ]
then
JDK_DIRS="${JDK_DIRS} ${jvmdir}"
fi
done
done
}

# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not
# defined in $DEFAULT)
JDK_DIRS="/usr/lib/jvm/default-java"
find_jdks

# Look for the right JVM to use
for jdir in $JDK_DIRS; do
if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
  JAVA_HOME="$jdir"
fi
done
export JAVA_HOME


Can't be JAVA_HOME overwritten only if it does not exists or is empty or
invalid?

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