[Bug 63654] Windows 7 Support Ends in January 2020

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

@Care2Technology  changed:

   What|Removed |Added

URL||http://drzafarsaifi.com/
 OS||All
   Keywords||NoFeedbackFromReporter

-- 
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 63654] New: Windows 7 Support Ends in January 2020

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

Bug ID: 63654
   Summary: Windows 7 Support Ends in January 2020
   Product: Tomcat 7
   Version: unspecified
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Servlet & JSP API
  Assignee: dev@tomcat.apache.org
  Reporter: toduc...@vmailcloud.com
  Target Milestone: ---

Windows 7 is a worldwide yet well-known working framework - as of January 2019,
despite running on more than 350 million PCs internationally. Accordingly, when
Microsoft reported that it would discontinue its Microsoft support number
support for decade-old Windows 7 from 14 January 2020, this naturally turned
into a significant factor for the vast base of Windows clients. 

Latest Update: http://drzafarsaifi.com/

-- 
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 62873] Tomcat Monitor application will update multi-string values in Windows registry with blank lines

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

@Care2Technology  changed:

   What|Removed |Added

   Keywords||MassUpdate
URL||http://800support-number.co
   ||m/microsoft-support/

--- Comment #3 from @Care2Technology  ---
The big news right now is that you usually don't have anything to do! If you
have fully enabled automatic updates, all new updates will be automatically
downloaded and installed when available on your system, so you do not need to
think about it. And if there is a problem, you can get help immediately by
calling the Microsoft support phone number.

-- 
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 62873] Tomcat Monitor application will update multi-string values in Windows registry with blank lines

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

@Care2Technology  changed:

   What|Removed |Added

 CC||toduc...@vmailcloud.com

-- 
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 63650] Unable to use own JSSE cipher implementation

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

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 OS||All
 Resolution|--- |FIXED

--- Comment #1 from Mark Thomas  ---
Fixed in:
- master for 9.0.23 onwards
- 8.5.x for 8.5.44 onwards

I have refactored the initialisation so it uses the sslProtocol value from the
SSLHostContext.

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



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

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

commit 9071b384d2df2872f5e44d930d2512c4e207eb8a
Author: Mark Thomas 
AuthorDate: Thu Aug 8 13:17:29 2019 +0100

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

Align the behaviour of service.bat with the Windows installer and rename
the executables on installation (and restore on removal).
---
 webapps/docs/changelog.xml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e6fd707..4da9efc 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -149,6 +149,15 @@
   
   
 
+  
+63285: Modify service.bat so that when
+installing a Windows service, by default, it changes the name of the
+executables used by the Windows service to match the service name. This
+makes the installation behaviour consistent with the Windows installer.
+The original executable names will be restored when the Windows service
+is removed. The renaming can be disabled by using the new
+--no-rename option after the service name. (markt)
+  
   
 Switch from Checkstyle to the JRE6 backport and update to version 8.22.
 This allows Tomcat 8.5 to use the newer Checkstyle releases while still


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

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

commit 4aac8d4b06bcf5a0ff5246d54d4fa4e00372f743
Author: Mark Thomas 
AuthorDate: Thu Aug 8 14:39:07 2019 +0100

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

Refactor initialisation for JSSE based TLS connectors to enable custom
JSSE providers that provide custom cipher suites to be used.
---
 java/org/apache/tomcat/util/net/jsse/JSSEUtil.java | 121 +++--
 webapps/docs/changelog.xml |   5 +
 2 files changed, 71 insertions(+), 55 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java 
b/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java
index c30dac2..5f662de 100644
--- a/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java
+++ b/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java
@@ -27,7 +27,6 @@ import java.util.Set;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.compat.JreVendor;
-import org.apache.tomcat.util.net.Constants;
 import org.apache.tomcat.util.net.SSLContext;
 import org.apache.tomcat.util.net.SSLHostConfigCertificate;
 import org.apache.tomcat.util.net.SSLUtilBase;
@@ -47,61 +46,10 @@ public class JSSEUtil extends SSLUtilBase {
 private static final Log log = LogFactory.getLog(JSSEUtil.class);
 private static final StringManager sm = 
StringManager.getManager(JSSEUtil.class);
 
-private static final Set implementedProtocols;
-private static final Set implementedCiphers;
-
-static {
-SSLContext context;
-try {
-context = new JSSESSLContext(Constants.SSL_PROTO_TLS);
-context.init(null,  null,  null);
-} catch (NoSuchAlgorithmException | KeyManagementException e) {
-// This is fatal for the connector so throw an exception to prevent
-// it from starting
-throw new IllegalArgumentException(e);
-}
+private volatile boolean initialized = false;
 
-String[] implementedProtocolsArray = 
context.getSupportedSSLParameters().getProtocols();
-implementedProtocols = new HashSet<>(implementedProtocolsArray.length);
-
-// Filter out SSLv2 from the list of implemented protocols (just in 
case
-// we are running on a JVM that supports it) since it is no longer
-// considered secure but allow SSLv2Hello.
-// Note SSLv3 is allowed despite known insecurities because some users
-// still have a requirement for it.
-for (String protocol : implementedProtocolsArray) {
-String protocolUpper = protocol.toUpperCase(Locale.ENGLISH);
-if (!"SSLV2HELLO".equals(protocolUpper) && 
!"SSLV3".equals(protocolUpper)) {
-if (protocolUpper.contains("SSL")) {
-log.debug(sm.getString("jsse.excludeProtocol", protocol));
-continue;
-}
-}
-implementedProtocols.add(protocol);
-}
-
-if (implementedProtocols.size() == 0) {
-log.warn(sm.getString("jsse.noDefaultProtocols"));
-}
-
-String[] implementedCipherSuiteArray = 
context.getSupportedSSLParameters().getCipherSuites();
-// The IBM JRE will accept cipher suites names SSL_xxx or TLS_xxx but
-// only returns the SSL_xxx form for supported cipher suites. Therefore
-// need to filter the requested cipher suites using both forms with an
-// IBM JRE.
-if (JreVendor.IS_IBM_JVM) {
-implementedCiphers = new 
HashSet<>(implementedCipherSuiteArray.length * 2);
-for (String name : implementedCipherSuiteArray) {
-implementedCiphers.add(name);
-if (name.startsWith("SSL")) {
-implementedCiphers.add("TLS" + name.substring(3));
-}
-}
-} else {
-implementedCiphers = new 
HashSet<>(implementedCipherSuiteArray.length);
-
implementedCiphers.addAll(Arrays.asList(implementedCipherSuiteArray));
-}
-}
+private volatile Set implementedProtocols;
+private volatile Set implementedCiphers;
 
 
 public JSSEUtil (SSLHostConfigCertificate certificate) {
@@ -122,12 +70,14 @@ public class JSSEUtil extends SSLUtilBase {
 
 @Override
 protected Set getImplementedProtocols() {
+initialise();
 return implementedProtocols;
 }
 
 
 @Override
 protected Set getImplementedCiphers() {
+initialise();
 return implementedCiphers;
 }
 
@@ -144,4 +94,65 @@ public class JSSEUtil extends SSLUtilBase {
 throws NoSuchAlgorithmException {

[GitHub] [tomcat] michael-o commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole()

2019-08-08 Thread GitBox
michael-o commented on a change in pull request #186: BZ 63636: 
Context#findRoleMapping() never called in RealmBase#hasRole()
URL: https://github.com/apache/tomcat/pull/186#discussion_r312022902
 
 

 ##
 File path: java/org/apache/catalina/realm/RealmBase.java
 ##
 @@ -928,6 +928,15 @@ public boolean hasRole(Wrapper wrapper, Principal 
principal, String role) {
 }
 }
 
+// Check for a role alias/mapping defined on context level
+if (getContainer() instanceof Context) {
+Context context = (Context) getContainer();
+String realRole = context.findRoleMapping(role);
 
 Review comment:
   I am not really skipping it, I have pushed into the check loop. You previous 
check ignored a valid case.


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 #139: service.bat handles changed Service at installation

2019-08-08 Thread GitBox
markt-asf commented on issue #139: service.bat handles changed Service at 
installation
URL: https://github.com/apache/tomcat/pull/139#issuecomment-519501770
 
 
   Closing at this has been implemented but with a modified approach that 
handled the renaming of the executables.


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 closed pull request #139: service.bat handles changed Service at installation

2019-08-08 Thread GitBox
markt-asf closed pull request #139: service.bat handles changed Service at 
installation
URL: https://github.com/apache/tomcat/pull/139
 
 
   


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 63285] service.bat does not handle changed "Windows Service Name" defined during Tomcat Windows Installation

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

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #1 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.97 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



[GitHub] [tomcat] markt-asf commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole()

2019-08-08 Thread GitBox
markt-asf commented on a change in pull request #186: BZ 63636: 
Context#findRoleMapping() never called in RealmBase#hasRole()
URL: https://github.com/apache/tomcat/pull/186#discussion_r312012092
 
 

 ##
 File path: java/org/apache/catalina/realm/RealmBase.java
 ##
 @@ -928,6 +928,15 @@ public boolean hasRole(Wrapper wrapper, Principal 
principal, String role) {
 }
 }
 
+// Check for a role alias/mapping defined on context level
+if (getContainer() instanceof Context) {
+Context context = (Context) getContainer();
+String realRole = context.findRoleMapping(role);
 
 Review comment:
   You can argue for and against the null check. If you prefer to skip it, I'm 
fine with that.


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] 01/02: Align the comments with the usage message

2019-08-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 4cca6b1f52abc181fed6f6931d57ff293951a037
Author: Mark Thomas 
AuthorDate: Thu Aug 8 08:37:26 2019 +0100

Align the comments with the usage message
---
 bin/service.bat | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/bin/service.bat b/bin/service.bat
index 221ef18..5d9e053 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -17,13 +17,19 @@ rem limitations under the License.
 rem ---
 rem NT Service Install/Uninstall script
 rem
+rem Usage: service.bat install/remove [service_name] [/user username]
+rem
 rem Options
-rem installInstall the service using Tomcat@VERSION_MAJOR@ as 
service name.
-remService is installed using default settings.
-rem remove Remove the service from the System.
+rem install Install the service using default settings.
+rem remove  Remove the service from the system.
+rem
+rem service_name (optional) The name to use for the service. If not specified,
+rem Tomcat@VERSION_MAJOR@ is used as the service name.
 rem
-rem name(optional) If the second argument is present it is considered
-remto be new service name
+rem username (optional) The name of the OS user to use to install/remove
+rem the service (not the name of the OS user the
+rem service will run as). If not specified, the current
+rem user is used.
 rem ---
 
 setlocal


-
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 (e914985 -> 659590c)

2019-08-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 e914985  Update expiring test certs
 new 4cca6b1  Align the comments with the usage message
 new 659590c  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285

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


Summary of changes:
 bin/service.bat| 122 ++---
 webapps/docs/changelog.xml |   9 +++
 webapps/docs/windows-service-howto.xml |  14 +++-
 3 files changed, 103 insertions(+), 42 deletions(-)


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



[tomcat] 02/02: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285

2019-08-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 659590c12916dd07ffef6f2d76c4273d5ed79ede
Author: Mark Thomas 
AuthorDate: Thu Aug 8 13:17:29 2019 +0100

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

Align the behaviour of service.bat with the Windows installer and rename
the executables on installation (and restore on removal).
---
 bin/service.bat| 110 ++---
 webapps/docs/changelog.xml |   9 +++
 webapps/docs/windows-service-howto.xml |  14 -
 3 files changed, 94 insertions(+), 39 deletions(-)

diff --git a/bin/service.bat b/bin/service.bat
index 5d9e053..6105b15 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -17,7 +17,7 @@ rem limitations under the License.
 rem ---
 rem NT Service Install/Uninstall script
 rem
-rem Usage: service.bat install/remove [service_name] [/user username]
+rem Usage: service.bat install/remove [service_name [--no-rename]] [--user 
username]
 rem
 rem Options
 rem install Install the service using default settings.
@@ -26,7 +26,10 @@ rem
 rem service_name (optional) The name to use for the service. If not specified,
 rem Tomcat@VERSION_MAJOR@ is used as the service name.
 rem
-rem username (optional) The name of the OS user to use to install/remove
+rem --no-rename  (optional) Don't rename tomcat@VERSION_MAJOR@.exe and 
tomcat@version_ma...@w.exe to match
+rem the non-default service name.
+rem
+rem username (optional) The name of the OS user to use to install/remove
 rem the service (not the name of the OS user the
 rem service will run as). If not specified, the current
 rem user is used.
@@ -35,21 +38,70 @@ rem 
---
 setlocal
 
 set "SELF=%~dp0%service.bat"
-rem Guess CATALINA_HOME if not defined
+
+set DEFAULT_SERVICE_NAME=Tomcat@VERSION_MAJOR@
+set SERVICE_NAME=%DEFAULT_SERVICE_NAME%
+
 set "CURRENT_DIR=%cd%"
+
+rem Parse the arguments
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_CMD=%1
+shift
+if "x%1x" == "xx" goto checkEnv
+:checkUser
+if "x%1x" == "x/userx" goto runAsUser
+if "x%1x" == "x--userx" goto runAsUser
+set SERVICE_NAME=%1
+shift
+if "x%1x" == "xx" goto checkEnv
+if "x%1x" == "x--no-renamex" (
+set NO_RENAME=%1
+shift
+)
+if "x%1x" == "xx" goto checkEnv
+goto checkUser
+:runAsUser
+shift
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_USER=%1
+shift
+runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" 
%SERVICE_CMD% %SERVICE_NAME%"
+goto end
+
+rem Check the environment
+:checkEnv
+
+rem Guess CATALINA_HOME if not defined
 if not "%CATALINA_HOME%" == "" goto gotHome
 set "CATALINA_HOME=%cd%"
-if exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome
+if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" goto okHome
+if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" goto okHome
 rem CD to the upper dir
 cd ..
 set "CATALINA_HOME=%cd%"
 :gotHome
-if exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome
-echo The tomcat@VERSION_MAJOR@.exe was not found...
-echo The CATALINA_HOME environment variable is not defined correctly.
-echo This environment variable is needed to run this program
+if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" (
+set "EXECUTABLE=%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe"
+goto okHome
+)
+if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" (
+set "EXECUTABLE=%CATALINA_HOME%\bin\%SERVICE_NAME%.exe"
+goto okHome
+)
+if "%DEFAULT_SERVICE_NAME%"== "%SERVICE_NAME%" (
+echo The file %DEFAULT_SERVICE_NAME%.exe was not found...
+) else (
+echo Neither the %DEFAULT_SERVICE_NAME%.exe file nor the 
%SERVICE_NAME%.exe file was found...
+)
+echo Either the CATALINA_HOME environment variable is not defined correctly or
+echo the incorrect service name has been used.
+echo Both the CATALINA_HOME environment variable and the correct service name
+echo are required to run this program.
 goto end
 :okHome
+cd "%CURRENT_DIR%"
+
 rem Make sure prerequisite environment variables are set
 if not "%JAVA_HOME%" == "" goto gotJdkHome
 if not "%JRE_HOME%" == "" goto gotJreHome
@@ -81,12 +133,6 @@ if not "%CATALINA_BASE%" == "" goto gotBase
 set "CATALINA_BASE=%CATALINA_HOME%"
 :gotBase
 
-set "EXECUTABLE=%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe"
-
-rem Set default Service name
-set SERVICE_NAME=Tomcat@VERSION_MAJOR@
-set DISPLAYNAME=Apache Tomcat @VERSION_MAJOR_MINOR@ %SERVICE_NAME%
-
 rem Java 9 no longer supports the java.endorsed.dirs
 rem system property. Only try to use it if
 rem JAVA_ENDORSED_DIRS was explicitly set
@@ -100,33 +146,14 @@ if not exist 

[tomcat] 01/02: Align the comments with the usage message

2019-08-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 69880c6d47cb2717af11e0d073df7f890c68b6be
Author: Mark Thomas 
AuthorDate: Thu Aug 8 08:37:26 2019 +0100

Align the comments with the usage message
---
 bin/service.bat | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/bin/service.bat b/bin/service.bat
index 221ef18..5d9e053 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -17,13 +17,19 @@ rem limitations under the License.
 rem ---
 rem NT Service Install/Uninstall script
 rem
+rem Usage: service.bat install/remove [service_name] [/user username]
+rem
 rem Options
-rem installInstall the service using Tomcat@VERSION_MAJOR@ as 
service name.
-remService is installed using default settings.
-rem remove Remove the service from the System.
+rem install Install the service using default settings.
+rem remove  Remove the service from the system.
+rem
+rem service_name (optional) The name to use for the service. If not specified,
+rem Tomcat@VERSION_MAJOR@ is used as the service name.
 rem
-rem name(optional) If the second argument is present it is considered
-remto be new service name
+rem username (optional) The name of the OS user to use to install/remove
+rem the service (not the name of the OS user the
+rem service will run as). If not specified, the current
+rem user is used.
 rem ---
 
 setlocal


-
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 (310a791 -> 838eefc)

2019-08-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 310a791  Update expiring test certs
 new 69880c6  Align the comments with the usage message
 new 838eefc  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285

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


Summary of changes:
 bin/service.bat| 122 ++---
 webapps/docs/changelog.xml |   9 +++
 webapps/docs/windows-service-howto.xml |  14 +++-
 3 files changed, 103 insertions(+), 42 deletions(-)


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



[tomcat] 02/02: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285

2019-08-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 838eefc539d8ea2a74a19d09ae158801b591d792
Author: Mark Thomas 
AuthorDate: Thu Aug 8 13:17:29 2019 +0100

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

Align the behaviour of service.bat with the Windows installer and rename
the executables on installation (and restore on removal).
---
 bin/service.bat| 110 ++---
 webapps/docs/changelog.xml |   9 +++
 webapps/docs/windows-service-howto.xml |  14 -
 3 files changed, 94 insertions(+), 39 deletions(-)

diff --git a/bin/service.bat b/bin/service.bat
index 5d9e053..6105b15 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -17,7 +17,7 @@ rem limitations under the License.
 rem ---
 rem NT Service Install/Uninstall script
 rem
-rem Usage: service.bat install/remove [service_name] [/user username]
+rem Usage: service.bat install/remove [service_name [--no-rename]] [--user 
username]
 rem
 rem Options
 rem install Install the service using default settings.
@@ -26,7 +26,10 @@ rem
 rem service_name (optional) The name to use for the service. If not specified,
 rem Tomcat@VERSION_MAJOR@ is used as the service name.
 rem
-rem username (optional) The name of the OS user to use to install/remove
+rem --no-rename  (optional) Don't rename tomcat@VERSION_MAJOR@.exe and 
tomcat@version_ma...@w.exe to match
+rem the non-default service name.
+rem
+rem username (optional) The name of the OS user to use to install/remove
 rem the service (not the name of the OS user the
 rem service will run as). If not specified, the current
 rem user is used.
@@ -35,21 +38,70 @@ rem 
---
 setlocal
 
 set "SELF=%~dp0%service.bat"
-rem Guess CATALINA_HOME if not defined
+
+set DEFAULT_SERVICE_NAME=Tomcat@VERSION_MAJOR@
+set SERVICE_NAME=%DEFAULT_SERVICE_NAME%
+
 set "CURRENT_DIR=%cd%"
+
+rem Parse the arguments
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_CMD=%1
+shift
+if "x%1x" == "xx" goto checkEnv
+:checkUser
+if "x%1x" == "x/userx" goto runAsUser
+if "x%1x" == "x--userx" goto runAsUser
+set SERVICE_NAME=%1
+shift
+if "x%1x" == "xx" goto checkEnv
+if "x%1x" == "x--no-renamex" (
+set NO_RENAME=%1
+shift
+)
+if "x%1x" == "xx" goto checkEnv
+goto checkUser
+:runAsUser
+shift
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_USER=%1
+shift
+runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" 
%SERVICE_CMD% %SERVICE_NAME%"
+goto end
+
+rem Check the environment
+:checkEnv
+
+rem Guess CATALINA_HOME if not defined
 if not "%CATALINA_HOME%" == "" goto gotHome
 set "CATALINA_HOME=%cd%"
-if exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome
+if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" goto okHome
+if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" goto okHome
 rem CD to the upper dir
 cd ..
 set "CATALINA_HOME=%cd%"
 :gotHome
-if exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome
-echo The tomcat@VERSION_MAJOR@.exe was not found...
-echo The CATALINA_HOME environment variable is not defined correctly.
-echo This environment variable is needed to run this program
+if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" (
+set "EXECUTABLE=%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe"
+goto okHome
+)
+if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" (
+set "EXECUTABLE=%CATALINA_HOME%\bin\%SERVICE_NAME%.exe"
+goto okHome
+)
+if "%DEFAULT_SERVICE_NAME%"== "%SERVICE_NAME%" (
+echo The file %DEFAULT_SERVICE_NAME%.exe was not found...
+) else (
+echo Neither the %DEFAULT_SERVICE_NAME%.exe file nor the 
%SERVICE_NAME%.exe file was found...
+)
+echo Either the CATALINA_HOME environment variable is not defined correctly or
+echo the incorrect service name has been used.
+echo Both the CATALINA_HOME environment variable and the correct service name
+echo are required to run this program.
 goto end
 :okHome
+cd "%CURRENT_DIR%"
+
 rem Make sure prerequisite environment variables are set
 if not "%JAVA_HOME%" == "" goto gotJdkHome
 if not "%JRE_HOME%" == "" goto gotJreHome
@@ -81,12 +133,6 @@ if not "%CATALINA_BASE%" == "" goto gotBase
 set "CATALINA_BASE=%CATALINA_HOME%"
 :gotBase
 
-set "EXECUTABLE=%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe"
-
-rem Set default Service name
-set SERVICE_NAME=Tomcat@VERSION_MAJOR@
-set DISPLAYNAME=Apache Tomcat @VERSION_MAJOR_MINOR@ %SERVICE_NAME%
-
 rem Java 9 no longer supports the java.endorsed.dirs
 rem system property. Only try to use it if
 rem JAVA_ENDORSED_DIRS was explicitly set
@@ -100,33 +146,14 @@ if not exist 

[tomcat] 02/02: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285

2019-08-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 7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7
Author: Mark Thomas 
AuthorDate: Thu Aug 8 13:17:29 2019 +0100

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

Align the behaviour of service.bat with the Windows installer and rename
the executables on installation (and restore on removal).
---
 bin/service.bat| 110 ++---
 webapps/docs/changelog.xml |   9 +++
 webapps/docs/windows-service-howto.xml |  14 -
 3 files changed, 94 insertions(+), 39 deletions(-)

diff --git a/bin/service.bat b/bin/service.bat
index 5d9e053..6105b15 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -17,7 +17,7 @@ rem limitations under the License.
 rem ---
 rem NT Service Install/Uninstall script
 rem
-rem Usage: service.bat install/remove [service_name] [/user username]
+rem Usage: service.bat install/remove [service_name [--no-rename]] [--user 
username]
 rem
 rem Options
 rem install Install the service using default settings.
@@ -26,7 +26,10 @@ rem
 rem service_name (optional) The name to use for the service. If not specified,
 rem Tomcat@VERSION_MAJOR@ is used as the service name.
 rem
-rem username (optional) The name of the OS user to use to install/remove
+rem --no-rename  (optional) Don't rename tomcat@VERSION_MAJOR@.exe and 
tomcat@version_ma...@w.exe to match
+rem the non-default service name.
+rem
+rem username (optional) The name of the OS user to use to install/remove
 rem the service (not the name of the OS user the
 rem service will run as). If not specified, the current
 rem user is used.
@@ -35,21 +38,70 @@ rem 
---
 setlocal
 
 set "SELF=%~dp0%service.bat"
-rem Guess CATALINA_HOME if not defined
+
+set DEFAULT_SERVICE_NAME=Tomcat@VERSION_MAJOR@
+set SERVICE_NAME=%DEFAULT_SERVICE_NAME%
+
 set "CURRENT_DIR=%cd%"
+
+rem Parse the arguments
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_CMD=%1
+shift
+if "x%1x" == "xx" goto checkEnv
+:checkUser
+if "x%1x" == "x/userx" goto runAsUser
+if "x%1x" == "x--userx" goto runAsUser
+set SERVICE_NAME=%1
+shift
+if "x%1x" == "xx" goto checkEnv
+if "x%1x" == "x--no-renamex" (
+set NO_RENAME=%1
+shift
+)
+if "x%1x" == "xx" goto checkEnv
+goto checkUser
+:runAsUser
+shift
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_USER=%1
+shift
+runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" 
%SERVICE_CMD% %SERVICE_NAME%"
+goto end
+
+rem Check the environment
+:checkEnv
+
+rem Guess CATALINA_HOME if not defined
 if not "%CATALINA_HOME%" == "" goto gotHome
 set "CATALINA_HOME=%cd%"
-if exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome
+if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" goto okHome
+if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" goto okHome
 rem CD to the upper dir
 cd ..
 set "CATALINA_HOME=%cd%"
 :gotHome
-if exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome
-echo The tomcat@VERSION_MAJOR@.exe was not found...
-echo The CATALINA_HOME environment variable is not defined correctly.
-echo This environment variable is needed to run this program
+if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" (
+set "EXECUTABLE=%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe"
+goto okHome
+)
+if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" (
+set "EXECUTABLE=%CATALINA_HOME%\bin\%SERVICE_NAME%.exe"
+goto okHome
+)
+if "%DEFAULT_SERVICE_NAME%"== "%SERVICE_NAME%" (
+echo The file %DEFAULT_SERVICE_NAME%.exe was not found...
+) else (
+echo Neither the %DEFAULT_SERVICE_NAME%.exe file nor the 
%SERVICE_NAME%.exe file was found...
+)
+echo Either the CATALINA_HOME environment variable is not defined correctly or
+echo the incorrect service name has been used.
+echo Both the CATALINA_HOME environment variable and the correct service name
+echo are required to run this program.
 goto end
 :okHome
+cd "%CURRENT_DIR%"
+
 rem Make sure prerequisite environment variables are set
 if not "%JAVA_HOME%" == "" goto gotJdkHome
 if not "%JRE_HOME%" == "" goto gotJreHome
@@ -81,12 +133,6 @@ if not "%CATALINA_BASE%" == "" goto gotBase
 set "CATALINA_BASE=%CATALINA_HOME%"
 :gotBase
 
-set "EXECUTABLE=%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe"
-
-rem Set default Service name
-set SERVICE_NAME=Tomcat@VERSION_MAJOR@
-set DISPLAYNAME=Apache Tomcat @VERSION_MAJOR_MINOR@ %SERVICE_NAME%
-
 rem Java 9 no longer supports the java.endorsed.dirs
 rem system property. Only try to use it if
 rem JAVA_ENDORSED_DIRS was explicitly set
@@ -100,33 +146,14 @@ if not exist 

[tomcat] branch master updated (e3a59c3 -> 7ac5fc8)

2019-08-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 e3a59c3  Update expiring test certs
 new 62da9b7  Align the comments with the usage message
 new 7ac5fc8  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285

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


Summary of changes:
 bin/service.bat| 122 ++---
 webapps/docs/changelog.xml |   9 +++
 webapps/docs/windows-service-howto.xml |  14 +++-
 3 files changed, 103 insertions(+), 42 deletions(-)


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



[tomcat] 01/02: Align the comments with the usage message

2019-08-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 62da9b70f775d55bfa517661e1442a739282ce72
Author: Mark Thomas 
AuthorDate: Thu Aug 8 08:37:26 2019 +0100

Align the comments with the usage message
---
 bin/service.bat | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/bin/service.bat b/bin/service.bat
index 221ef18..5d9e053 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -17,13 +17,19 @@ rem limitations under the License.
 rem ---
 rem NT Service Install/Uninstall script
 rem
+rem Usage: service.bat install/remove [service_name] [/user username]
+rem
 rem Options
-rem installInstall the service using Tomcat@VERSION_MAJOR@ as 
service name.
-remService is installed using default settings.
-rem remove Remove the service from the System.
+rem install Install the service using default settings.
+rem remove  Remove the service from the system.
+rem
+rem service_name (optional) The name to use for the service. If not specified,
+rem Tomcat@VERSION_MAJOR@ is used as the service name.
 rem
-rem name(optional) If the second argument is present it is considered
-remto be new service name
+rem username (optional) The name of the OS user to use to install/remove
+rem the service (not the name of the OS user the
+rem service will run as). If not specified, the current
+rem user is used.
 rem ---
 
 setlocal


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



[Bug 63650] New: Unable to use own JSSE cipher implementation

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

Bug ID: 63650
   Summary: Unable to use own JSSE cipher implementation
   Product: Tomcat 9
   Version: 9.0.21
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Connectors
  Assignee: dev@tomcat.apache.org
  Reporter: arne.stahlb...@governikus.de
  Target Milestone: -

Due to our need to use certain TLS cipher suites which are not supported by the
SunJSSE provider by Oracle, we have created an own implementation of a JSSE
provider.
In Tomcat 7, we are able to use it easily by registering our provider in the
JRE and configuring



where "TLSPSK" is the name of our SSLContext implementation.

However we are unable to use it in Tomcat 9 (or 8.5).
Startup of Tomcat 9 (with same connector configuration) results in following
exception:

Caused by: java.lang.IllegalArgumentException: Keine der spezifizierten
[ciphers] wird von der SSL Engine unterstützt:
[[TLS_RSA_PSK_WITH_AES_256_GCM_SHA384]]
at org.apache.tomcat.util.net.SSLUtilBase.getEnabled(SSLUtilBase.java:151)
at org.apache.tomcat.util.net.SSLUtilBase.(SSLUtilBase.java:125)
at org.apache.tomcat.util.net.jsse.JSSEUtil.(JSSEUtil.java:113)
at org.apache.tomcat.util.net.jsse.JSSEUtil.(JSSEUtil.java:108)
at
org.apache.tomcat.util.net.jsse.JSSEImplementation.getSSLUtil(JSSEImplementation.java:50)
at
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:88)
at
org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:218)
at
org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1124)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1137)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:574)
at
org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)

meaning given ciphers not supported.
An investigation showed us that SSLUtilBase.getEnabled always produces an empty
list with operations

enabled.addAll(configured);
enabled.retainAll(implemented);

where "configured" holds exactly the ciphers we give in the config, and
"implemented" holds a number of ciphers but not ours.
Tracking down where "implemented" comes from led us to JSSEUtil static
initializer

SSLContext context;
try {
context = new JSSESSLContext(Constants.SSL_PROTO_TLS);

... and later

String[] implementedCipherSuiteArray =
context.getSupportedSSLParameters().getCipherSuites();

So, the "implemented" ciphers are always taken from the SSLContext one receives
from SSLContext.getInstance("TLS") which is usually the SunJSSE implementation,
essentially locking out all other ciphers.
A workaround by naming our SSLContext "TLS" and assigning it higher priority
than SunJSSE, so JSSEUtil would then always use ours, is not feasible as we
also need SunJSSE (on other connectors).

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



[GitHub] [tomcat] michael-o commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole()

2019-08-08 Thread GitBox
michael-o commented on a change in pull request #186: BZ 63636: 
Context#findRoleMapping() never called in RealmBase#hasRole()
URL: https://github.com/apache/tomcat/pull/186#discussion_r311972092
 
 

 ##
 File path: java/org/apache/catalina/realm/RealmBase.java
 ##
 @@ -928,6 +928,15 @@ public boolean hasRole(Wrapper wrapper, Principal 
principal, String role) {
 }
 }
 
+// Check for a role alias/mapping defined on context level
+if (getContainer() instanceof Context) {
+Context context = (Context) getContainer();
+String realRole = context.findRoleMapping(role);
 
 Review comment:
   @markt-asf I have added another commit with the requested change. If that 
meets your expectations, I will modify the tests accordingly.


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] michael-o commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole()

2019-08-08 Thread GitBox
michael-o commented on a change in pull request #186: BZ 63636: 
Context#findRoleMapping() never called in RealmBase#hasRole()
URL: https://github.com/apache/tomcat/pull/186#discussion_r311972092
 
 

 ##
 File path: java/org/apache/catalina/realm/RealmBase.java
 ##
 @@ -928,6 +928,15 @@ public boolean hasRole(Wrapper wrapper, Principal 
principal, String role) {
 }
 }
 
+// Check for a role alias/mapping defined on context level
+if (getContainer() instanceof Context) {
+Context context = (Context) getContainer();
+String realRole = context.findRoleMapping(role);
 
 Review comment:
   @markt-asf I have added another commit with the requested change. It that 
meets your expectations, I will modify the tests accordingly.


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] 01/02: Change position in changelog.xml

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

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

commit 7b9ff2cbc6b0f00ef2cad3a8e608d3184cd3dc03
Author: Michael Osipov 
AuthorDate: Thu Aug 8 12:37:01 2019 +0200

Change position in changelog.xml
---
 webapps/docs/changelog.xml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c56fbfb..f0d8121 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -47,10 +47,6 @@
 
   
 
-  
-63636: Context.findRoleMapping() never called
-in RealmBase#hasRole(). (michaelo)
-  
   
 63627: Implement more fine-grained handling in
 RealmBase.authenticate(GSSContext, boolean). (michaelo)
@@ -91,6 +87,10 @@
 for patterns used with the RewriteValve with the
 description in the documentation. (markt)
   
+  
+63636: Context.findRoleMapping() never called
+in RealmBase#hasRole(). (michaelo)
+  
  
   
   


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



[tomcat] 02/02: Move Context#findRoleMapping() to Wrapper#findSecurityReference()

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

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

commit 64f5402368b797888dec9b7d5ce15a7c79b2910d
Author: Michael Osipov 
AuthorDate: Thu Aug 8 12:48:47 2019 +0200

Move Context#findRoleMapping() to Wrapper#findSecurityReference()
---
 java/org/apache/catalina/core/StandardWrapper.java | 14 +-
 java/org/apache/catalina/realm/RealmBase.java  | 11 +--
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/java/org/apache/catalina/core/StandardWrapper.java 
b/java/org/apache/catalina/core/StandardWrapper.java
index a28dd73..7bfb512 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -920,14 +920,26 @@ public class StandardWrapper extends ContainerBase
  */
 @Override
 public String findSecurityReference(String name) {
+String reference = null;
 
 referencesLock.readLock().lock();
 try {
-return references.get(name);
+reference = references.get(name);
 } finally {
 referencesLock.readLock().unlock();
 }
 
+// If not specified on the Wrapper, check the Context
+if (getParent() instanceof Context) {
+Context context = (Context) getParent();
+if (reference != null) {
+reference = context.findRoleMapping(reference);
+} else {
+reference = context.findRoleMapping(name);
+}
+}
+
+return reference;
 }
 
 
diff --git a/java/org/apache/catalina/realm/RealmBase.java 
b/java/org/apache/catalina/realm/RealmBase.java
index dbeeaa3..833973a 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -920,7 +920,7 @@ public abstract class RealmBase extends LifecycleMBeanBase 
implements Realm {
  */
 @Override
 public boolean hasRole(Wrapper wrapper, Principal principal, String role) {
-// Check for a role alias defined in a  element
+// Check for a role alias
 if (wrapper != null) {
 String realRole = wrapper.findSecurityReference(role);
 if (realRole != null) {
@@ -928,15 +928,6 @@ public abstract class RealmBase extends LifecycleMBeanBase 
implements Realm {
 }
 }
 
-// Check for a role alias/mapping defined on context level
-if (getContainer() instanceof Context) {
-Context context = (Context) getContainer();
-String realRole = context.findRoleMapping(role);
-if (realRole != null) {
-role = realRole;
-}
-}
-
 // Should be overridden in JAASRealm - to avoid pretty inefficient 
conversions
 if (principal == null || role == null) {
 return false;


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



[GitHub] [tomcat] michael-o commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole()

2019-08-08 Thread GitBox
michael-o commented on a change in pull request #186: BZ 63636: 
Context#findRoleMapping() never called in RealmBase#hasRole()
URL: https://github.com/apache/tomcat/pull/186#discussion_r311971810
 
 

 ##
 File path: webapps/docs/changelog.xml
 ##
 @@ -47,6 +47,10 @@
 
   
 
+  
+63636: Context.findRoleMapping() never called
+in RealmBase#hasRole(). (michaelo)
+  
   
 
 Review comment:
   Done.


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 BZ-63636/tomcat-9.0.x updated (738380b -> 64f5402)

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

michaelo pushed a change to branch BZ-63636/tomcat-9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 738380b  BZ 63636: Context#findRoleMapping() never called in 
RealmBase#hasRole()
 new 7b9ff2c  Change position in changelog.xml
 new 64f5402  Move Context#findRoleMapping() to 
Wrapper#findSecurityReference()

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


Summary of changes:
 java/org/apache/catalina/core/StandardWrapper.java | 14 +-
 java/org/apache/catalina/realm/RealmBase.java  | 11 +--
 webapps/docs/changelog.xml |  8 
 3 files changed, 18 insertions(+), 15 deletions(-)


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



[Bug 63648] certificates: testsuite will break tomorrow

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

--- Comment #3 from Sylvain Beucler  ---
Thanks for the prompt fix!

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